Response format
Success responses
Successful requests return a JSON object with the following shape:Error responses
Failed requests return a JSON object with the following shape:Common error scenarios
400 - Bad request
Returned when the request is invalid or violates a business rule. Duplicate wallet label:401 - Unauthorized
Returned when authentication credentials are missing or invalid. Ensure you are sending the correctx-app-id and x-app-secret headers, and that the X-Breet-Env header is set to either development or production. See the quickstart for how to obtain and configure your credentials.
403 - Forbidden
Returned when your account does not have permission to perform the requested action.404 - Not found
Returned when the requested resource does not exist. Wallet not found:409 - Conflict
Returned when the request conflicts with the current state of a resource, such as attempting to create a resource that already exists.422 - Unprocessable entity
Returned when the request is well-formed but cannot be processed due to a validation or business logic constraint.429 - Too many requests
Returned when you exceed the rate limit. Back off and retry after the time indicated in theRetry-After response header (value in seconds).
The 429 response body does not follow the standard error shape. It only returns a Your error handling should account for this exception.
message field:500 - Internal server error
Returned when an unexpected error occurs on the server. The response body includessuccess, message, meta, and errors, but does not include a data field:
Best practices
- Always check the
successfield before processing the response. - Use the
messagefield for logging and debugging. Do not rely on exact message text for control flow, as messages may change. - Handle
4xxerrors gracefully in your application with appropriate user feedback. - For
429errors, read theRetry-Afterheader to determine how long to wait before retrying. - For
5xxerrors, implement retry logic with exponential backoff.