# Responses

### HTTP status codes <a href="#status-codes" id="status-codes"></a>

Hakuna uses conventional HTTP status codes to indicate the success or failure of an API request. Codes in the `2XX` range indicate a successful request, and codes in the `4XX` range indicate a failed request, typically due to invalid inputs or operations.

Here's a summary of the HTTP status codes you could receive from the Hakuna API:

| STATUS CODE | DESCRIPTION      |
| ----------- | ---------------- |
| 200         | Success          |
| 400         | Bad Request      |
| 401         | Unauthorized     |
| 404         | Entity Not Found |

### Error responses <a href="#error-responses" id="error-responses"></a>

When an unsuccessful request occurs, you will receive a payload in the following format:

```json
{
    "error": {
        "error_code": "supported_error_code",
        "validation_errors": []
    }
}
```

All error payloads will contain a unique `error_code` which you can use to identify the error. In case of a badly formed request, Hakuna will also return additional `validation_errors`.
