Skip to main content
The Blockra API wraps every response in a consistent envelope so your error-handling logic stays uniform across all endpoints. On success, the data field is populated and error is null. On failure, data is null and error carries both a human-readable message and a stable machine-readable code.

Response envelope

Success response:
Error response:
Always check the HTTP status code first, then use error.code for programmatic branching and error.message for displaying a human-readable description to users.

Handling errors in code

Error codes

HTTPCodeMeaning
400VALIDATION_ERRORThe request body or query string failed validation
400AMOUNT_TOO_SMALLThe amount is below the $1 minimum, or the asset’s payable precision
401HTTP_401Missing, malformed, or invalid API key
403HTTP_403Your key lacks the required scope for this endpoint
404NOT_FOUNDThe resource does not exist or does not belong to your account
409INSUFFICIENT_BALANCENot enough available balance to complete a withdrawal
429RATE_LIMIT_EXCEEDEDToo many requests — back off and retry
503RATE_UNAVAILABLELive FX rate temporarily unavailable — retry shortly
500INTERNAL_ERRORAn unexpected error occurred on Blockra’s side
VALIDATION_ERROR responses also include a details array of per-field messages to help you pinpoint the offending input field.

Validation error example