# Error codes

> The centralized catalog of error codes and slugs, each with a localized message.
{/* generated:versioned-pages - edit _pm-authored, not this file */}

An **Error code** is one entry in Flowkiwi's centralized error catalog. Every domain error and every validation violation the API returns is keyed to a catalog entry by its `code` and `slug`, so you can resolve a stable, localized message for anything the API reports.

When a write fails with a `422`, each constraint violation carries a `slug` (and, for templated messages, a set of `parameters`). A domain error - a `404`, for instance - carries a top-level `code` and `slug`. Look either up in this catalog to render a user-facing message in the caller's language, rather than hard-coding one per error.

The `message` is localized from the `Flowkiwi-Locale` header; `description` stays in English for developers. This is a **read-only reference** resource: you list the catalog once and match incoming errors against it.

## The Error code object

## Conventions

### Authentication and headers

All requests require an OAuth 2.0 bearer token:

```
Authorization: Bearer <token>
```

Set the language you want `message` localized in:

```
Flowkiwi-Locale: fr-FR
```

This resource is read-only - it has no create, update or delete operations.
