# Document Messages

> Send WhatsApp document messages: PDF, DOCX, XLSX up to 100MB. Include filenames and captions, with automatic CDN hosting.

Send documents like PDFs, spreadsheets, or presentations to share invoices, contracts, or reports.

## Send a Document

```typescript
const message = await zavu.messages.send({
  to: "+14155551234",
  channel: "whatsapp",
  messageType: "document",
  content: {
    mediaUrl: "https://example.com/invoice.pdf",
    filename: "Invoice-12345.pdf"
  }
});
```

```bash
curl -X POST https://api.zavu.dev/v1/messages \
  -H "Authorization: Bearer zv_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155551234",
    "channel": "whatsapp",
    "messageType": "document",
    "content": {
      "mediaUrl": "https://example.com/invoice.pdf",
      "filename": "Invoice-12345.pdf"
    }
  }'
```

## Document with Caption

```typescript
const message = await zavu.messages.send({
  to: "+14155551234",
  channel: "whatsapp",
  messageType: "document",
  text: "Your invoice for January 2024",
  content: {
    mediaUrl: "https://example.com/invoice.pdf",
    filename: "Invoice-12345.pdf"
  }
});
```

```bash
curl -X POST https://api.zavu.dev/v1/messages \
  -H "Authorization: Bearer zv_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155551234",
    "channel": "whatsapp",
    "messageType": "document",
    "text": "Your invoice for January 2024",
    "content": {
      "mediaUrl": "https://example.com/invoice.pdf",
      "filename": "Invoice-12345.pdf"
    }
  }'
```

## Specifications

| Property | Requirement |
|----------|-------------|
| Formats | PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT |
| Max size | 100 MB |
| Filename | Optional but recommended |
| Caption | Optional, max 1024 chars |

> **Tip:**
> Always provide a descriptive `filename` so users know what they're downloading.

## URL Requirements

Your document URL must:

- Be publicly accessible (no authentication)
- Use HTTPS
- Return the correct `Content-Type` header
- Be available for at least 24 hours

## Use Cases

- Invoices and receipts
- Contracts and agreements
- Reports and presentations
- User manuals
- Shipping labels
