Send a document message with an optional filename and caption to an existing contact.
| Field | Type | Required | Description |
|---|---|---|---|
phone_number | string | Yes | Recipient phone number with country code |
message_type | string | Yes | Must be "document" |
media_url | string | Yes | Publicly accessible URL to the document |
filename | string | No | Display filename shown to the recipient |
caption | string | No | Optional caption |
context_message_id | string | No | WhatsApp message ID to reply to |
Bearer token for authentication. Format: Bearer YOUR_BEARER_TOKEN
Recipient phone number with country code
"+27123456789"
Must be "document"
document "document"
Publicly accessible URL to the document file
"https://example.com/invoice.pdf"
Display filename shown to the recipient
"Invoice_2025.pdf"
Optional caption for the document
"Please find your invoice attached"
WhatsApp message ID to reply to
"wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI..."