> For the complete documentation index, see [llms.txt](https://doc.api-engagement.beta.gouv.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.api-engagement.beta.gouv.fr/api-reference/errors.md).

# Erreurs

## Format standard

Toutes les erreurs retournent un objet JSON avec la structure suivante :

```json
{
  "ok": false,
  "code": "ERROR_CODE",
  "message": "Description lisible de l'erreur"
}
```

## Codes d'erreur

| Code                      | HTTP | Description                                                                        |
| ------------------------- | ---- | ---------------------------------------------------------------------------------- |
| `INVALID_BODY`            | 400  | Corps de requête invalide — champ manquant, mauvais type ou valeur hors contrainte |
| `INVALID_PARAMS`          | 400  | Paramètre de chemin invalide (ex. : identifiant mal formé)                         |
| `INVALID_QUERY`           | 400  | Paramètre de query invalide                                                        |
| `NOT_FOUND`               | 404  | Ressource introuvable                                                              |
| `RESSOURCE_ALREADY_EXIST` | 409  | Conflit — une mission avec ce `clientId` existe déjà                               |
| `NO_PARTNER`              | 400  | Aucun partenaire diffuseur configuré pour cette clé API                            |
| `UNAUTHORIZED`            | 401  | Clé API absente ou invalide                                                        |
| `TOO_MANY_REQUESTS`       | 429  | Limite de débit atteinte                                                           |

## Limite de débit (rate limiting)

L'API autorise **600 requêtes par fenêtre de 60 secondes**, identifiées par votre clé API.

En cas de dépassement, l'API retourne un `429 Too Many Requests`. Les headers de réponse indiquent l'état de votre quota :

| Header                  | Description                                          |
| ----------------------- | ---------------------------------------------------- |
| `X-RateLimit-Limit`     | Nombre maximum de requêtes autorisées sur la fenêtre |
| `X-RateLimit-Remaining` | Requêtes restantes sur la fenêtre en cours           |
| `X-RateLimit-Reset`     | Timestamp Unix de réinitialisation du compteur       |

## Erreurs de validation

Pour les erreurs `INVALID_BODY`, le champ `message` précise le ou les champs en cause :

```json
{
  "ok": false,
  "code": "INVALID_BODY",
  "message": "\"title\" is required"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://doc.api-engagement.beta.gouv.fr/api-reference/errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
