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

# Send a document

> Send a PDF, Office, or text document via POST /v1/whatsapp/messages/document.

Use `POST /v1/whatsapp/messages/document` for invoices, statements, and PDFs. Point at a publicly reachable `media_url`; WhatsApp fetches it **at send time**, so it must be reachable then and serve the correct `Content-Type`. Needs an **open 24-hour window**.

## Endpoint

```http theme={null}
POST https://karibu.briq.tz/v1/whatsapp/messages/document
```

**Headers:** `X-API-Key` (required), `Content-Type: application/json`.

## Fields

| Field             | Type   | Required   | Notes                                                                                                                 |
| ----------------- | ------ | ---------- | --------------------------------------------------------------------------------------------------------------------- |
| `media_url`       | string | one source | Public HTTPS URL to the document.                                                                                     |
| `file_id`         | string | one source | Uploaded media id (first-party). Use `media_url` for external integrations.                                           |
| `filename`        | string | no         | Recommended — the name and icon shown to the recipient, e.g. `Invoice-A1234.pdf`.                                     |
| `caption`         | string | no         | Optional, up to 1024 characters.                                                                                      |
| `to` + `sender`   | —      | target     | Customer number (E.164) and which of your numbers to send from. `sender` is optional when you have one active number. |
| `conversation_id` | uuid   | alt        | Alternative to `to` + `sender`: an existing thread to reply in.                                                       |

## Constraints

|          |                                                                         |
| -------- | ----------------------------------------------------------------------- |
| Formats  | PDF, Word (`.doc`/`.docx`), Excel (`.xls`/`.xlsx`), plain text (`.txt`) |
| Max size | 100 MB                                                                  |

## Example

```bash cURL theme={null}
curl -X POST "https://karibu.briq.tz/v1/whatsapp/messages/document" \
  -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
  -d '{ "to": "255712345678", "media_url": "https://example.com/invoice.pdf", "filename": "Invoice-A1234.pdf", "caption": "Your invoice" }'
```

Returns **202** `{ message_id, status: "pending" }`. Then [track delivery](/guides/whatsapp-track-messages). Build and send a live request from the [Send a document](/Karibu-WhatsApp/messages/send-document) reference page.
