> For the complete documentation index, see [llms.txt](https://3commas.gitbook.io/3commas-official-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://3commas.gitbook.io/3commas-official-api-docs/general-information/errors.md).

# 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:

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

{% hint style="success" %}
Success responses return a 2xx status code.
{% endhint %}

## 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:

```json
{
   "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)"]
   }
}
```

<br>

## Error Object Fields

**error** `mandatory`\
Specific error codes and messages defined in another document

**error\_description** `optional`\
Localized, extended description of the error

**error\_attributes** `optional`\
Lists fields that did not pass validation
