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

VALIDATION_ERROR responses also include a details array of per-field messages to help you pinpoint the offending input field.

Validation error example