# Error Responses

Types of errors you may expect to receive from the Fera API.

We follow RESTful standards for returning error messages and the status is set according to the [MDN standards found here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses).

Here are some examples:

| Status | Reason |
| --- | --- |
| [400 Bad Request](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400) | Your request is probably malformed. This is probably because you're trying to filter by a parameter that isn't allowed, or you're trying to set an attribute that does not exist. |
| [401 Unauthorized](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401) | Your API key (or auth token) is either not authorized to act upon the store, or your parameters/headers provided for the request including the key or auth token are malformed. |
| [404 Not Found](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404) | We couldn't find the thing you were looking for because it does not exist or never existed in the first place. Check your ID if you're making a "Retrieve" request. |
| [405 Method Not Allowed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405) | You won't see this one very often, but it might be returned if you try to edit a review that you're not allowed to edit (because of verification), or if you're an app that's trying to perform an action that the app is not allowed to do. |
| [422 Unprocessable Entity](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422) | This is what we use to return validation errors. Read the message response carefully. The errors returned in this response are safe to show to a customer. |
| [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) | You've hit our rate limit. See the Rate Limit section below for more information about this. |

## Validation Errors

When there is a validation failure you'll get a response like this:

```json
// Status: 422 Unprocessable Entity
{
  message: "Rating must be between 1 and 5 and be a positive number.",
  errors: {
    rating: ["must be between 1 and 5", "be a positive number"]
  }
}
```

| Error Response Attribute | Description |
| --- | --- |
| `message` | This is always returned in error responses. It gives you a summary of what went wrong. |
| `errors` | This may, or may not be returned in the response - usually reserved for validation errors. It comes as an object where the key is the attribute that failed and the value is an array of problem strings. |

# Rate Limits

If you hit our rate limits you will receive **429** error as is standard for any API.

The Private and Partners APIs are limited to **60 requests per minute** per IP address.

Other requests, including the Public API, are limited to **200 requests per minute** per IP address.

Contact us to request a higher rate limit if you need it.

Source: https://developers.fera.ai/errors
