Skip to main content

Errors

When a request fails, 3Commas API returns an error object with a relevant HTTP response code and additional information to help identify and resolve the issue.

HTTP Status Codes

Errors generally return a 4xx response code:

4XXMalformed requests (issue is on the sender's side).
429Request rate limit exceeded.
418IP auto-banned for continuing to send requests after receiving 429 codes.
5XXInternal errors (issue is on 3Commas's side).
504Gateway timeout, indicating the API couldn’t get a timely response.

Success responses return a 2xx status code.

Attributes

errorstringrequired

Specific error codes and messages defined in another document.

error_descriptionstring

Localized, extended description of the error.

error_attributesstring

Lists fields that did not pass validation.

Error Object

When an error occurs, the API returns an error object instead of a data object or array.

Error responses have the following payload format:

{
"error": "record_invalid",
"error_description": "Invalid parameters",
"error_attributes": {
"api_key": ["is too short (minimum is 5 characters)"],
"secret": ["is too short (minimum is 5 characters)"],
"name": ["is too short (minimum is 2 characters)"]
}
}