Errors
The Treasure API returns structured error responses when a request cannot be completed. Errors may result from invalid request formatting, business-rule violations (such as requesting wire instructions before an account is open), or temporary system unavailability.
Each response includes an error_code, a human-readable error_message, and a details array with field-level context when applicable. See the ErrorResponse schema for the full response shape. An example looks like:
{
"error_code": "INVALID_PARAMS",
"error_message": "Invalid parameter(s)",
"details": [
{
"target_type": "HTTP_REQUEST_BODY",
"target": "some_unexpected_field",
"message": "Unexpected parameter",
"reason_code": "PARAM_IS_UNEXPECTED"
}
]
}
Error Code Reference
| Error Code | HTTP Status | Message | Description |
|---|---|---|---|
INVALID_PARAMS |
400 | Invalid parameter(s) | The request contains invalid, missing, or unrecognized parameters. Check details for affected fields. |
INVALID_PATH |
404 | The path requested is invalid | The requested URL does not match a valid API endpoint. |
INVALID_PORTFOLIO_SETTINGS |
400 | The portfolio settings provided are not valid | Portfolio allocation values are invalid (for example, percentages do not sum to 100). |
ACCOUNT_NOT_OPEN |
400 | The account is not open | The requested operation requires an open account. |
FEATURE_NOT_SUPPORTED |
400 | That capability is not supported | The requested capability is not available for this account or environment. |
HTTP_BODY_IS_UNEXPECTED |
400 | Invalid parameter(s) | The request body contains unexpected or unsupported content. |
INVALID_HEADERS |
400 | Invalid parameter(s) | One or more request headers are missing or invalid. |
JSON_PARSE_FAILURE |
400 | Invalid parameter(s) | The request body contains malformed JSON. |
NOT_ACCEPTABLE |
406 | — | The requested response format is not supported. |
URI_TOO_LONG |
414 | — | The request URI exceeds the maximum allowed length. |
UNSUPPORTED_MEDIA_TYPE |
415 | The media type is not supported | The Content-Type header is missing or not supported. Use application/json. |
COULD_NOT_AUTHENTICATE |
401 | — | Authentication credentials are missing or invalid. |
NOT_AUTHORIZED |
401 or 403 | Varies | |
HTTP_METHOD_NOT_ALLOWED |
405 | That HTTP method is not allowed | The HTTP method is not supported for this endpoint. |
RESOURCE_CONFLICT |
409 | — | The request conflicts with the current state of the resource. |
SIMULATION_STATE_TRANSITION_IMPOSSIBLE |
409 | Invalid state transition from %s to %s | A sandbox simulation attempted an invalid onboarding or account state change. |
INSUFFICIENT_FUNDS |
409 | Insufficient funds | The account does not have sufficient balance to complete the requested transfer or withdrawal. |
THROTTLE_EXCEEDED |
429 | There were too many requests, please wait a moment and try again | Rate limit exceeded. Retry after a brief delay. |
UNEXPECTED_ERROR |
500 | There was an unknown error | An unexpected server error occurred. Retry the request; contact support if the issue persists. |
SERVICE_TEMPORARILY_UNAVAILABLE |
503 | Service is temporarily unavailable. Please retry your request later | A downstream dependency is temporarily unavailable. Retry with exponential backoff. |
