2xxindicates a successful request4xxindicates a client-side problem such as invalid input, missing authentication, or an action that cannot be performed5xxindicates an unexpected server-side failure
Error categories
Errors generally fall into two groups:- Client errors: the request must be corrected before retrying
- Server errors: the request may be valid, but the API failed while handling it
Client errors
Client errors return a4xx status code. These usually mean one of the
following:
- The request body or query parameters are invalid
- Authentication is missing or invalid
- The requested resource does not exist
- The requested action is not allowed in the current state
- Your account does not have enough balance to perform the action
- You have exceeded the rate limit
Server errors
Server errors return a5xx status code. These indicate that the API failed
while processing an otherwise valid request.
When you receive a server error:
- Treat the result as indeterminate
- Retry only when it is safe for your use case
- Capture the
x-request-idresponse header - Include the request ID if you contact support
Error response format
Error responses are returned as JSON. In most cases, you can expect at least a stablecode field and a human-readable message field.
The examples below show a typical authentication error, a validation error, and
a server-side failure:
- Validation errors can include a structured
data.errorsarray with field-level information such as the invalid path, the validation code, and a specific message. - Malformed JSON may return a simpler
400response with onlycodeandmessage. - Server errors can include a
requestIdfield in the response body so you can correlate the failure with logs or share it with support.
Common status codes
Common error codes
The API may return error codes such as:request_errorsnot_authorizedinsufficient_balancemember_not_foundapi_key_not_foundapi_key_disabledusername_already_existmacaddress_already_existline_not_authorizedline_not_foundunavailable_durationrate_limitserver_error
code field programmatically when you need stable application logic,
and use the message field for human-readable debugging information.