> ## Documentation Index
> Fetch the complete documentation index at: https://docs.escrybe.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors & Response Envelopes

> How responses and errors are shaped across the API.

Most of the API shares a single response envelope; a few endpoint groups wrap
responses differently. All of them use standard HTTP status codes — check
those first.

## Status codes

| Status | Meaning                                                |
| ------ | ------------------------------------------------------ |
| `200`  | Success                                                |
| `400`  | Invalid or incomplete request                          |
| `401`  | Missing or invalid credentials                         |
| `403`  | Authenticated, but forbidden                           |
| `404`  | Resource not found                                     |
| `405`  | HTTP method not allowed                                |
| `429`  | Too many failed authentication attempts (rate limited) |
| `500`  | Internal error                                         |
| `503`  | Under maintenance                                      |

## Envelopes

<Tabs>
  <Tab title="Standard (letters, e-mail, WhatsApp messages)">
    ```json theme={null}
    { "status": 200, "status_message": "Sucesso", "data": { } }
    ```

    Used by the Letters/Telegram (v2), Registered E-mail, Receipts (errors)
    and WhatsApp **message and sender** endpoints. `status` mirrors the HTTP
    status code.
  </Tab>

  <Tab title="WhatsApp templates / logo">
    ```json theme={null}
    { "code": 200, "status": "success", "message": null, "data": { }, "request_id": "req_..." }
    ```

    Used by the WhatsApp **template** endpoints and template sync. The sender
    logo endpoint uses the same shape without `request_id`.
  </Tab>

  <Tab title="Favorites / number check">
    ```json theme={null}
    { "success": true, "favorites": [ ] }
    ```

    Saved contacts and the WhatsApp number check return a plain
    `{ "success": ... }` object.
  </Tab>
</Tabs>

<Note>
  The envelope's `status` / `code` field always mirrors the real HTTP status
  code — errors are never wrapped in an HTTP `200`.
</Note>
