Send Document

Supported & Tested

Send a PDF, word file, or other document attachments.

POSThttps://api.waplix.io/api/v1/messages/media
Authentication
Authorization: Bearer YOUR_API_KEY
Parameters Specification
instance_id
stringReq

Waplix instance id slot

number
stringReq

Recipient phone number

type
stringReq

Must be document

media_url
stringReq

Direct URL of the document file

caption
stringOpt

Optional file caption description overlay

Request Payload Example
Request
curl -X POST "https://api.waplix.io/api/v1/messages/media" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "instance_id": "demo_instance",
  "number": "15551234567",
  "type": "document",
  "media_url": "https://example.com/media/sample.pdf",
  "caption": "Hello from Waplix API docs."
}'
Success Response
Response · 200 OK
{
  "success": true,
  "instance_id": "demo_instance",
  "to": "15551234567@s.whatsapp.net",
  "message_id": "MSG_DEMO_001",
  "status": "sent",
  "type": "document"
}
Related Webhook Events

The API response confirms that Waplix accepted or processed the request. Delivery and read updates may arrive asynchronously through configured webhooks.

message.sentDocs →

Triggered when Waplix successfully sends the media message to the WhatsApp network.

{
  "event": "message.sent",
  "instance_id": "demo_instance",
  "to": "15551234567@s.whatsapp.net",
  "message_type": "image",
  "message": "Hello from Waplix API docs.",
  "media_url": "https://example.com/media/sample.jpg",
  "message_id": "MSG_DEMO_001",
  "timestamp": 1782582288
}
message.deliveredDocs →

Triggered when the recipient's phone receives and acknowledges the media message.

{
  "event": "message.delivered",
  "instance_id": "demo_instance",
  "message_id": "MSG_DEMO_001",
  "chat_id": "15551234567@s.whatsapp.net",
  "from": null,
  "to": "15551234567@s.whatsapp.net",
  "message_type": "image",
  "status": "DELIVERY_ACK",
  "receipts": [],
  "timestamp": 1782582293
}
message.readDocs →

Triggered when the recipient opens and reads the media message (blue ticks).

{
  "event": "message.read",
  "instance_id": "demo_instance",
  "message_id": "MSG_DEMO_001",
  "chat_id": "15551234567@s.whatsapp.net",
  "from": null,
  "to": "15551234567@s.whatsapp.net",
  "message_type": "image",
  "status": "READ",
  "receipts": [],
  "timestamp": 1782582293
}
Was this page helpful?