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

# Document Messages

> Send documents and files via WhatsApp

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

## Send a Document

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

  ```python Python theme={null}
  message = zavu.messages.send(
      to="+14155551234",
      channel="whatsapp",
      message_type="document",
      content={
          "media_url": "https://example.com/invoice.pdf",
          "filename": "Invoice-12345.pdf"
      }
  )
  ```

  ```ruby Ruby theme={null}
  message = client.messages.send(
    to: "+14155551234",
    channel: "whatsapp",
    message_type: "document",
    content: {
      media_url: "https://example.com/invoice.pdf",
      filename: "Invoice-12345.pdf"
    }
  )
  ```

  ```go Go theme={null}
  message, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
      To:          zavudev.String("+14155551234"),
      Channel:     zavudev.String("whatsapp"),
      MessageType: zavudev.String("document"),
      Content: &zavudev.MessageContentParams{
          MediaURL: zavudev.String("https://example.com/invoice.pdf"),
          Filename: zavudev.String("Invoice-12345.pdf"),
      },
  })
  ```

  ```php PHP theme={null}
  $message = $client->messages->send([
      'to' => '+14155551234',
      'channel' => 'whatsapp',
      'messageType' => 'document',
      'content' => [
          'mediaUrl' => 'https://example.com/invoice.pdf',
          'filename' => 'Invoice-12345.pdf',
      ],
  ]);
  ```

  ```bash cURL theme={null}
  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"
      }
    }'
  ```
</CodeGroup>

## Document with Caption

<CodeGroup>
  ```typescript TypeScript theme={null}
  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"
    }
  });
  ```

  ```python Python theme={null}
  message = zavu.messages.send(
      to="+14155551234",
      channel="whatsapp",
      message_type="document",
      text="Your invoice for January 2024",
      content={
          "media_url": "https://example.com/invoice.pdf",
          "filename": "Invoice-12345.pdf"
      }
  )
  ```

  ```ruby Ruby theme={null}
  message = client.messages.send(
    to: "+14155551234",
    channel: "whatsapp",
    message_type: "document",
    text: "Your invoice for January 2024",
    content: {
      media_url: "https://example.com/invoice.pdf",
      filename: "Invoice-12345.pdf"
    }
  )
  ```

  ```go Go theme={null}
  message, err := client.Messages.Send(context.TODO(), zavudev.MessageSendParams{
      To:          zavudev.String("+14155551234"),
      Channel:     zavudev.String("whatsapp"),
      MessageType: zavudev.String("document"),
      Text:        zavudev.String("Your invoice for January 2024"),
      Content: &zavudev.MessageContentParams{
          MediaURL: zavudev.String("https://example.com/invoice.pdf"),
          Filename: zavudev.String("Invoice-12345.pdf"),
      },
  })
  ```

  ```php PHP theme={null}
  $message = $client->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 theme={null}
  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"
      }
    }'
  ```
</CodeGroup>

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

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