# Errors

Errors come as `application/problem+json`:

```json title="422 response"
{
  "type": "https://docs.lelemon.cl/errors/channel_window_closed",
  "title": "Channel window closed",
  "status": 422,
  "code": "channel_window_closed",
  "detail": "More than 24 hours passed since the last message of the person and WhatsApp only accepts approved templates now. The message was not sent.",
  "docUrl": "https://docs.lelemon.cl/errors/channel_window_closed",
  "requestId": "req_7Hc2LmQ0x8bVw1TqS9mYp3"
}
```


`fix` appears when the code has a known remedy: what to do, as an action a program can follow. See [Actions and MCP in v2](/guides/actions-and-mcp#let-the-error-tell-you-what-to-do).

`param` names the field when the error is about one. `detail` is for people and may change. `code` never does, so branch on it. Every response, success or error, carries a `Request-Id` header; send it when you write to support.

An unknown `/v2` route answers `404`, a method the route does not have answers `405` with an `Allow` header, and broken JSON answers `400`. A `500` never shows internal messages.

| Status | Meaning | What to do |
| --- | --- | --- |
| 400 | Malformed request | Fix it. `param` names the field |
| 401 | Missing, invalid or revoked key | Check the key |
| 403 | The key lacks a scope, or the organization is closed | `detail` names the scope |
| 404 | Does not exist, or is not yours | Check the id and `Lelemon-Subaccount` |
| 405 | Method not supported on this route | Check the method |
| 409 | Conflicts with the current state | Read the resource again and decide |
| 413 | Payload too large | Send less |
| 422 | Valid, but a rule does not allow it | Show `detail` or change the input |
| 429 | Too many requests | Wait `Retry-After` seconds |
| 5xx | Our side failed | Retry with backoff and the same `Idempotency-Key` |

The body also rejects unknown shapes: a missing required field, `null` in a field that does not accept it, an array where an object is expected, text with the NUL character, and a body nested more than 32 levels deep all answer `400 invalid_request`. A field the route does not document answers `400 unknown_field`. See [Strict bodies](/basics/versioning#strict-bodies).

See every code in the [error catalog](/errors).
