Actions51
- API Actions
- Chat Actions
- Contact Actions
- Group Actions
- Instance Actions
- Message Actions
- Message Queue Actions
- Product Actions
- Status Actions
Message → Send a Document
AI-generatedSummary
Send a document to a WhatsApp contact or group
Inputs
- phone (required) — Contact number (or group ID) in international format, digits only. Example: 5511999999999.
- delayMessage — Delay in seconds before sending the message. Z-API recommends between 1 and 15 seconds. If 0, uses the API default behavior.
- fileName — File name to be sent (with or without extension).
- caption — Caption that will be displayed along with the sent document.
- document (required) — Document to be sent (PDF, DOCX, etc.).
Output shape
JSON object representing the API response for the sent document
The response may include success fields such as message ID or status; errors are propagated as operation errors.
Examples
Example 1: Send an invoice PDF to a client with a 2‑second delay
phone: 5511999999999, delayMessage: 2, fileName: "invoice.pdf", caption: "Invoice", document: "invoice.pdf"
Example 2: Send a contract document without delay or caption
phone: 5511999999999, fileName: "contract.docx", document: "https://example.com/contract.docx"