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
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.Core resources
- Ledgers
- Balances
- Transactions
- Identities
- Reconciliation
Errors when creating or fetching ledgers. Codes use the
LGR_* prefix.Other operations
- Metadata
- Hooks
- Search
- Admin
Errors when updating metadata on ledgers, balances, transactions, and other entities. Codes use the
META_* prefix.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.