# Errors

The Didomi API uses standard HTTP response codes to indicate that an API request is a success or a failure. In general, the codes act as follows:

* `2xx` codes indicate a success
* `4xx` codes indicate an error in the parameters sent to the server (e.g., the authentication information is invalid, a required parameter is missing, etc.)
* `5xx` codes indicate a Didomi server-side error

When an error happens, you can look at the JSON response body to find more about the reason. The body will be an object with the following properties:

| Property  | Description                                                                   | Example                            |
| --------- | ----------------------------------------------------------------------------- | ---------------------------------- |
| `code`    | The HTTP response code                                                        | 400                                |
| `name`    | The name of the error (tied to the response code)                             | BadRequest                         |
| `message` | An explanation of the error                                                   | Invalid authentication information |
| `errors`  | An array containing more errors if multiple errors have been batched together |                                    |

Example:

```javascript
{
    "code": 400,
    "errors": {},
    "message": "Invalid authentication information",
    "name": "BadRequest"
}
```


---

# 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://developers.didomi.io/api-and-platform/introduction/errors.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.
