Issue description
This error code typically indicates the JSON Web Token (JWT) supplied with the API user’s request was not accepted. API requests to Fireblocks are authenticated using the provided JWT. If the JWT is invalid, you will receive the error code. The cause of the error is likely either the wrong API key being used or the wrong baseURL being used.
For SDK users, this typically means an incorrect API key was used to create the client. For users with native API client implementations, this typically indicates an error with your JWT creation logic.
Fireblocks API body response
{ message 'Unauthorized: Token was not accepted.', code: -7 }
Python SDK error message
fireblocks_sdk.api_types.FireblocksApiException: Got an error from fireblocks server: { "message": "Unauthorized: Token was not accepted.", "code": -7 }
JavaScript SDK error response
response: {
status: 401,
statusText: 'Unauthorized',
headers: {
server: 'nginx',
date: ‘Tue, 28 Feb 2023 20:58:37 GMT’,
'Content-Type': 'application/octet-stream',
'content-length': '79',
'content-type': 'application/json',
connection: ‘keep-alive’
},
config: <REMOVED_CONFIG_DATA>,
request: <REMOVED_REQUEST_DATA>,
data: { "message": "Unauthorized: Token was not accepted.", "code": -7 }
}
Resolution
- If you’re using our SDK, check the API key you used to create the SDK client.
- If you’re using a native REST implementation, check your JWT creation logic to ensure the correct API key is specified and that all fields in the JWT are provided according to our JWT specifications.
-
If you confirm the API key and JWT are correct, make sure you use the correct baseURL, out of the following options:
- Sandbox URL: https://sandbox-api.fireblocks.io/v1
- US mainnet or testnet URL: https://api.fireblocks.io/v1
- EU mainnet or testnet URL: https://eu-api.fireblocks.io/v1
If you attempt the resolutions above and the problem persists, contact Fireblocks Support.