# Errors

Glomo uses standard HTTP status codes to indicate the success or failure of an API request:

- **2xx Success**: The request was successful.
- **4xx Client Error**: There was an error with the request.
- **5xx Server Error**: An error occurred on our end.


## 4xx Client Errors

| **HTTP Status Code** | **Description** |
|  --- | --- |
| **400** | The request is invalid or missing required parameters. |
| **401** | Authentication failed due to invalid API keys. |
| **403** | You do not have permission to perform the requested operation. |
| **404** | The requested resource does not exist. |
| **409** | The request could not be completed due to a conflict with the current state of the resource. |
| **422** | The request was well-formed but could not be processed. |
| **429** | Too many requests have been made in a short period. |


## 5xx Server Errors

| **HTTP Status Code** | **Description** |
|  --- | --- |
| **500** | An internal error occurred on Glomo's servers. |
| **502** | Glomo is temporarily unavailable. |
| **503** | The service is temporarily unavailable. |
| **504** | The request to Glomo timed out. |


### Error Response Format

An error response is a flat JSON object:

* `error`: the HTTP status name, for example `"Bad Request"` or `"Not Found"`.
* `message`: a human-readable description of what went wrong.
* `code`: a machine-readable error code. Present only on some `400` and `422` responses; branch on it when it is there.


```json
{
  "error": "Not Found",
  "message": "Payment not found"
}
```

With a `code`:

```json
{
  "error": "Bad Request",
  "message": "Account has insufficient balance to process this transaction. Additional amount required: 5000.",
  "code": "INSUFFICIENT_BALANCE"
}
```

A `429` comes from the API gateway before the request reaches the API, so its body does not follow this format. See [Rate Limits](/platform/rate_limit).