# 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`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hellohakuna.com/using-the-api/responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
