Available from Blnk Core 0.15.0.
error_detail.code on API errors. Use this code for programmatic handling.
Treat error, errors, and error_detail.message as display text only.
Error response shape
Error responses includeerror_detail and error (or errors on some list and filter endpoints):
Error response
| Field | Description |
|---|---|
error_detail.code | Stable code from the catalog below. Branch on this field, not on message text or error / errors. |
error_detail.message | Human-readable message. May change between releases. |
error_detail.details | Optional structured context (filter parse errors, reindex progress, batch IDs, and similar). |
error or errors | Exist for backwards compatibility and display. |
Unclassified server failures return HTTP
500 with the sanitized message "internal server error". The underlying error is logged server-side and is not echoed to clients.How to handle errors
Handle Blnk API errors in two steps:- Use the HTTP status code to understand the type of failure.
- Use
error_detail.codeto decide what your application should do.
Recommended flow
- HTTP status
code error_detail.codeerror_detail.detailswhen present
Error-code catalog
Codes are domain-prefixed. Each code has one default HTTP status.Platform
- Generic
- Authentication
- API keys
Errors that apply across endpoints: malformed requests, validation failures, rate limits, lock contention, and unexpected server failures. Codes use the
GEN_* prefix.| Code | HTTP | Meaning |
|---|---|---|
GEN_MALFORMED_REQUEST | 400 | Request body could not be parsed (invalid JSON, wrong types, or body too large) |
GEN_VALIDATION_ERROR | 400 | Request failed validation (invalid params, filters, fields) |
GEN_MISSING_PARAMETER | 400 | A required route or query parameter is missing |
GEN_BAD_REQUEST | 400 | Request rejected; no more specific code applies |
GEN_NOT_FOUND | 404 | Resource not found; no domain-specific code applies |
GEN_CONFLICT | 409 | Request conflicts with current resource state |
GEN_RESOURCE_LOCKED | 423 | A concurrent operation holds the lock; retry shortly |
GEN_RATE_LIMITED | 429 | Too many requests |
GEN_INTERNAL | 500 | Unexpected server failure; message is sanitized |
Core resources
- Ledgers
- Balances
- Transactions
- Identities
- Reconciliation
Errors when creating or fetching ledgers. Codes use the
LGR_* prefix.| Code | HTTP | Meaning |
|---|---|---|
LGR_NOT_FOUND | 404 | Ledger does not exist |
LGR_DUPLICATE | 409 | Ledger with this name or ID already exists |
Other operations
- Metadata
- Hooks
- Search
- Admin
Errors when updating metadata on ledgers, balances, transactions, and other entities. Codes use the
META_* prefix.| Code | HTTP | Meaning |
|---|---|---|
META_ENTITY_NOT_FOUND | 404 | Entity for metadata update does not exist |
META_UNSUPPORTED_ENTITY | 400 | Entity type does not support metadata |
META_INVALID_ENTITY_ID | 400 | Entity ID is missing or malformed |
Bulk commit and void
Bulk commit and void have two types of failures:- Request-level failures
- Per-item failures
- Request-level
- Per-item
Request-level failures reject the whole request, i.e. they reject the whole call before any item runs. Per-item failures are returned inside the bulk result.The response applies the standard transaction error shape with codes such as Bulk commit expects a
TXN_BULK_EMPTY or TXN_BULK_LIMIT_EXCEEDED.Empty batch
transactions array. Bulk void expects transaction_ids. Sending the wrong shape returns TXN_BULK_EMPTY because unrecognized fields are dropped.Legacy codes
Blnk normalizes older generic error names to canonicalerror_detail.code values before the response leaves the server.
You will not receive legacy error names in error_detail.code. To handle legacy behaviour:
- Use
error_detail.codefrom the catalog above. - Prefer domain-specific codes over generic codes. For example, a missing transaction returns
TXN_NOT_FOUND, notGEN_NOT_FOUND. - Do not parse
error,errors, orerror_detail.messageto infer the code.
| Legacy internal code | Canonical error_detail.code |
|---|---|
NOT_FOUND | GEN_NOT_FOUND |
CONFLICT | GEN_CONFLICT |
BAD_REQUEST | GEN_BAD_REQUEST |
INVALID_INPUT | GEN_VALIDATION_ERROR |
INTERNAL_SERVER_ERROR | GEN_INTERNAL |
RATE_LIMITED | GEN_RATE_LIMITED |