> ## 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.

# Letters & Telegram

> Create and track Correios orders: letters, AR, telegrams, mala direta, Sedex and e-Carta.

The `v2` order API covers every physical and hybrid product. The `shipType`
field selects the product and determines which fields are required.

## Shipment types

| `shipType` | Product                              | Document       |
| ---------- | ------------------------------------ | -------------- |
| 1          | Carta Simples (Simple letter)        | `pdfFile`      |
| 2          | Carta Registrada (Registered letter) | `pdfFile`      |
| 3          | Carta Registrada + AR                | `pdfFile`      |
| 4          | Telegrama                            | `telegram_msg` |
| 5          | Mala Direta                          | `pdfFile`      |
| 6          | Sedex                                | `pdfFile`      |
| 7          | Sedex + AR                           | `pdfFile`      |
| 8          | eCarta Simples                       | `ecarta_msg`   |
| 9          | eCarta Registrada                    | `ecarta_msg`   |
| 10         | eCarta Registrada + AR               | `ecarta_msg`   |

## Endpoints

| Method   | Path                                               | Description            |
| -------- | -------------------------------------------------- | ---------------------- |
| `POST`   | `/api/v2/post`                                     | Create an order        |
| `GET`    | `/api/v2/get/{securityToken}/{job_id}`             | Get an order           |
| `DELETE` | `/api/v2/delete/{securityToken}/{job_id}`          | Cancel an order        |
| `GET`    | `/api/v2/download/{securityToken}/{job_id}/{type}` | Download an order file |

Full request/response schemas live in the **API Reference** tab.

## Sending the document

The `pdfFile` field accepts three forms:

* **Base64** — a base64-encoded PDF string
* **URL** — a publicly reachable URL (fetched server-side through a proxy);
  public Google Docs/Drive links are supported
* **File upload** — a `multipart/form-data` file part

PDFs must be **≤ 150 pages** and **not password-protected**.

<Tip>
  Always run a `test=1` request first to validate the address, page count and
  pricing without charging credits.
</Tip>

## Telegrams & e-Carta

These products carry a text body instead of a PDF (rendered content is limited
to **10 pages**):

* `shipType=4` requires `telegram_msg` (min 10 chars) **and** the flags
  `telegram_post_dated`, `telegram_sender_copy` and
  `telegram_delivery_confirmation` (each must be present with value 0 or 1).
  When `telegram_post_dated=1`, `telegram_post_dated_date` must be a future
  date.
* `shipType=8|9|10` require `ecarta_msg` (min 10 chars, may contain HTML).

## Downloading files

`/api/v2/download/{securityToken}/{job_id}/{type}` returns base64 content. The `type` parameter selects the
file:

| `type`          | File                                                                                                    |
| --------------- | ------------------------------------------------------------------------------------------------------- |
| `pdf`           | The submitted document                                                                                  |
| `letter_front`  | Rendered envelope front                                                                                 |
| `rr`            | Physical return receipt (AR) — optional `file_name` selects one of several; defaults to the most recent |
| `rr_electronic` | Electronic return receipt — optional `file_name`, same behavior                                         |
| `sender_copy`   | Sender's copy                                                                                           |
