POST
/api/send-messageSends a message with a document attached via a URL.
Send Document Message
Send a message with a document attached. Provide the document via a publicly accessible URL in the documentUrl parameter. You can optionally include caption text in the text parameter and specify a filename.
Most common document types are supported (PDF, DOCX, XLSX, etc.). Maximum file size: 100MB.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | Recipient phone number in E.164 format or, Group JID. |
| text | string | No | The text content of the message. Required if no media/contact/location is sent. |
| documentUrl | string | Yes | URL of the document to send. |
| fileName | string | No | The file name of the document. If not provided, document.{extension} will be used. |
Code Examples
curl -X POST "https://www.wasenderapi.com/api/send-message"
-H "Authorization: Bearer YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"to": "+1234567890",
"text": "Quarterly report",
"documentUrl": "https://example.com/report.pdf",
"fileName:"report-02-2025.pdf"
}'Response Examples
{
"success": true,
"data": {
"msgId": 100000,
"jid": "+123456789",
"status": "in_progress"
}
}