curl --request POST \
--url https://api.omni.z-api.io/channels/{channel_id}/token/{channel_token}/send-document/{extension} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "5511999999999",
"document": "https://example.com/file.pdf",
"fileName": "My document"
}
'{
"zaapId": "3999984263738042930CD6ECDE9VDWSA",
"messageId": "D241XXXX732339502B68",
"id": "D241XXXX732339502B68"
}{
"error": 405,
"message": "Method not allowed"
}{
"error": 415,
"message": "Unsupported media type"
}Messages
Send document
Send documents (PDF, DOC, XLS, etc) via WhatsApp
POST
/
send-document
/
{extension}
curl --request POST \
--url https://api.omni.z-api.io/channels/{channel_id}/token/{channel_token}/send-document/{extension} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phone": "5511999999999",
"document": "https://example.com/file.pdf",
"fileName": "My document"
}
'{
"zaapId": "3999984263738042930CD6ECDE9VDWSA",
"messageId": "D241XXXX732339502B68",
"id": "D241XXXX732339502B68"
}{
"error": 405,
"message": "Method not allowed"
}{
"error": 415,
"message": "Unsupported media type"
}Overview
Method for sending documents. The file extension must be specified in the URL path (e.g.,/send-document/pdf). You can send via URL or Base64.
When sending as Base64, you must include the prefix with the document type, for example:
data:application/pdf;base64,.File size limits and supported formats follow WhatsApp policies. See the official WhatsApp documentation for details.
Authorizations
Secret Key generated in the Omni Z-API Security panel
Path Parameters
File extension (e.g. pdf, docx, xlsx)
Example:
"pdf"
Body
application/json
Recipient phone number (country code + area code + number)
Example:
"5511999999999"
Document URL or Base64 data
File name
Document description
ID of an existing message to reply to
Delay in seconds before sending (1-15)
Required range:
1 <= x <= 15