# Errors

## Errors

Error responses may be returned for several reasons. It is recommended to check the HTTP status code first to confirm if the request was successful:

<table><thead><tr><th width="162.7578125">Code</th><th>Description</th><th>Reason</th></tr></thead><tbody><tr><td>200/201</td><td>Successful</td><td>-</td></tr><tr><td>204</td><td>Successful but no content returned</td><td>-</td></tr><tr><td>400</td><td>Bad request</td><td>The request had some other issue not covered by a 422 response.</td></tr><tr><td>401</td><td>Unauthenticated</td><td>The API key or token is invalid, expired or revoked.</td></tr><tr><td>403</td><td>Unauthorised</td><td>The user associated with the API key or token does not have sufficient permission to perform the action.</td></tr><tr><td>404</td><td>Endpoint not found</td><td>-</td></tr><tr><td>405</td><td>Method not allowed</td><td>Using the wrong HTTP verb in the request.</td></tr><tr><td>409</td><td>Conflict</td><td>Usually occurs when attempt is made to create something that already exists.</td></tr><tr><td>413</td><td>Content too large</td><td>May be encountered when initialising a flow with a payload.</td></tr><tr><td>415</td><td>Unsupported media type</td><td>The content-type header value is incorrect, ensure it is <code>application/json</code>.</td></tr><tr><td>422</td><td>Unprocessible request</td><td>The content in the request has failed validation. See the response for a description of errors.</td></tr><tr><td>429</td><td>Too many requests</td><td>You have hit a rate limit.</td></tr><tr><td>500</td><td>Server error</td><td>Something went wrong on the receiving server.</td></tr></tbody></table>

The most common error is a `422 Unprocessible Request`. This means that the request was valid, but could not be processed by the server. The response will contain a JSON object with a description of the error, usually in this format:

{% code lineNumbers="true" %}

```json
{
  "message": "...",
  "errors": {
    "field1": [
      {"rule":  "failure reason"}
    ]
  }
}
```

{% endcode %}

Where `field1` is the name of the field that failed validation, `rule` is the name of the validation rule that failed, and `failure reason` is the reason why validation failed.
