How to Send Document Messages Using the WhatsApp Official API
- Bot Automation

- Apr 8
- 3 min read
Businesses often need to send invoices, reports, brochures, contracts, and order confirmations directly to customers on WhatsApp. With the WhatsApp Official API, you can send these files as Document Messages, making it easy for users to download and view them instantly.
At Hibot, Document Messages help businesses automate important customer communication while keeping everything simple and professional.
What Are WhatsApp Document Messages?
Document Messages are WhatsApp messages that display a document icon along with a downloadable file. When a customer taps the message, the document is downloaded directly inside WhatsApp.
This is ideal for sending:
Invoices
Order confirmations
Product catalogs
Contracts
Reports
Presentations
Price lists
Excel sheets
PDF guides
For example, an ecommerce business can automatically send a PDF invoice after an order is placed, while a real estate company can share a property brochure instantly.
Why Businesses Use Document Messages
Using Document Messages through Hibot and the WhatsApp Official API gives businesses several advantages:
Faster communication with customers
Professional document delivery inside WhatsApp
Higher engagement compared to email attachments
Instant sharing of invoices, quotations, and reports
Better customer experience without leaving the chat
Since customers already use WhatsApp daily, document delivery becomes much easier and more convenient.
How to Send a Document Message with the WhatsApp API
To send a document message, use the following API endpoint:
POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages
You need to include:
Your WhatsApp Business Phone Number ID
The customer’s WhatsApp number
The document type
Either an uploaded media ID or a hosted file URL
Example API request:
curl 'https://graph.facebook.com/v25.0/<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "<CUSTOMER_PHONE_NUMBER>",
"type": "document",
"document": {
"id": "<MEDIA_ID>",
"filename": "invoice.pdf",
"caption": "Your invoice is ready"
}
}'
Important Document Parameters
When sending a document message, you can include the following fields:
Parameter | Description |
id | Media ID of an uploaded file. Recommended for better performance. |
link | Public URL of the file if it is hosted on your server. |
filename | The name of the file shown to the customer. |
caption | A short description displayed below the document. |
Recommended Approach
Hibot recommends uploading the file first and then using the media ID instead of a public link. This ensures:
Faster delivery
Better reliability
Improved file security
Supported File Types on WhatsApp
The WhatsApp Official API officially supports the following document formats:
File Type | Extension | Maximum Size |
Text File | .txt | 100 MB |
Excel File | .xls, .xlsx | 100 MB |
Word Document | .doc, .docx | 100 MB |
PowerPoint Presentation | .ppt, .pptx | 100 MB |
PDF Document | 100 MB |
Although other file formats may sometimes work, WhatsApp only guarantees proper display and download for these supported types.
Example: Sending a PDF Invoice
Here is a simple example of sending a PDF invoice to a customer:
curl 'https://graph.facebook.com/v25.0/106540352242922/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+16505551234",
"type": "document",
"document": {
"id": "1376223850470843",
"filename": "order_abc123.pdf",
"caption": "Your order confirmation (PDF)"
}
}'
If the request is successful, WhatsApp returns a message ID confirming that the document was sent.
Example response:
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "+16505551234",
"wa_id": "16505551234"
}
],
"messages": [
{
"id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA"
}
]
}
Best Practices for Sending Document Messages
To get the best results, follow these tips:
Keep filenames simple and easy to understand.
Good example: invoice-march-2026.pdf
Avoid: file123_final_v2_latest.pdf
Add a helpful caption.Customers are more likely to open the document if they know what it contains.
Use PDFs whenever possible.PDF files work well across devices and are the most commonly used format.
Avoid very large files.While WhatsApp supports up to 100 MB, smaller files load much faster.
Upload files to WhatsApp before sending.Using a media ID provides better performance than using a hosted link.
Common Use Cases for Businesses
Ecommerce
Send invoices, shipping labels, and order confirmations.
Healthcare
Share reports, prescriptions, and appointment documents.
Real Estate
Send brochures, floor plans, and agreements.
Education
Deliver study materials, certificates, and presentations.
Finance
Share account statements, KYC forms, and payment receipts.
Send WhatsApp Documents Easily with Hibot
With Hibot’s WhatsApp Official API platform, you can automate document sharing and send files to customers in just a few clicks.
Whether you need to send invoices, reports, contracts, or catalogs, Hibot helps you:
Upload and manage documents
Automate document delivery
Send files instantly through WhatsApp
Improve customer communication
Start using Hibot today and make document sharing on WhatsApp faster, easier, and more professional.
.png)
Comments