# Message: 'Unauthorized: Token was not accepted.',

**URL:** <https://community.fireblocks.com/t/message-unauthorized-token-was-not-accepted/2387>\
**Category:** Developer Discussion\
**Tags:** docs, help-center, getting-started\
**Created:** [April 23, 2025, 2:06pm UTC](https://community.fireblocks.com/t/message-unauthorized-token-was-not-accepted/2387 "2025-04-23T14:06:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rishi33785](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rishi33785](https://community.fireblocks.com/u/rishi33785)\
**Post date:** [April 23, 2025, 2:06pm UTC](https://community.fireblocks.com/t/message-unauthorized-token-was-not-accepted/2387/1 "2025-04-23T14:06:54Z")

</div>

code

async createApiUser(){  
const projectRoot = join(\_\_dirname, ‘..’);  
const secretKeyPath = join(projectRoot, ‘src’, ‘fireblocks\_secret.key’);  
try {  
const data = await this.fireblocks.apiUser.createApiUser({  
createAPIUser:{  
name:“api user Rishikesh Singh”,  
role:“admin”,  
csrPem:process.env.API\_SECERETE\_KEY||“”  
},  
idempotencyKey: randomUUID(),  
})  
console.log(“New Internal Wallet Created”, JSON.stringify(data, null, 2))  
} catch (error) {  
console.log(error)  
}  
}

error message

message: ‘Unauthorized: Token was not accepted.’,  
response: FireblocksResponse {  
data: { message: ‘Unauthorized: Token was not accepted.’, code: -7 },  
statusCode: 401,  
headers: {  
date: ‘Wed, 23 Apr 2025 14:01:23 GMT’,  
‘content-type’: ‘application/json; charset=utf-8’,  
‘content-length’: ‘61’,  
connection: ‘keep-alive’,  
‘x-powered-by’: ‘Express’,  
‘x-request-id’: ‘72dadeaac76e095560cf4b89d9848670’,  
‘x-reason’: ‘{“message”:“Unauthorized: Token was not accepted.”,“code”:-7}’,  
etag: ‘W/“3d-zomXnAy0H/hxycUcfr0PgHC7HLw”’,  
‘strict-transport-security’: ‘max-age=31536000; includeSubDomains’,  
‘cf-cache-status’: ‘DYNAMIC’,  
server: ‘cloudflare’,  
‘cf-ray’: ‘934de47feb76c995-IAD’  
}  
},

first four keys of api key → baa4

please let me know what am i ding wrong??

---

<div class="post-metadata">

**Author:** ![Rajalakshmi](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@Rajalakshmi](https://community.fireblocks.com/u/Rajalakshmi)\
**Post date:** [April 29, 2025, 2:00am UTC](https://community.fireblocks.com/t/message-unauthorized-token-was-not-accepted/2387/2 "2025-04-29T02:00:52Z")

</div>

Hi Rishi,

This error usually occurs when the base URL is defined incorrectly. I want to ask you to check the baseURL defined in your code.  
Please find in the [article](https://developers.fireblocks.com/docs/postman-guide).
