ChatofyDevelopers
REST APIMCP Server (AI)New
API KeysWebhooks
Chatofy API
/
Getting Started
API Resources
API v1.0 Live
Developer APIMessagesSend Document

Send Document

Sends PDFs, Word docs, or other files. Uses same endpoint as media but with document payload. Supports filename and caption.

POST/api/v1/contact/{phone}/send-media-message

Note

Supported formats: PDF, DOCX, XLSX, PPTX, TXT. Max file size is 100 MB.

Request Body Schema

application/json
phonestringrequired

Recipient phone number with country code

Example:+919000000000
document.linkstringrequired

Publicly accessible document URL

Example:https://example.com/invoice.pdf
document.captionstringoptional

Caption text for the document

Example:Your invoice for June 2026
document.filenamestringoptional

Display filename shown to recipient

Example:invoice.pdf

Response Payload

200 OKapplication/json
successbooleanrequired

Whether request succeeded

data.message_idstringrequired

Platform message ID (wamid)

data.raw.messages[].idstringrequired

Meta message ID

Code Snippets & Examples

1curl -X POST "https://app.chatofy.in/api/v1/contact/+919000000000/send-media-message" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{"document":{"link":"https://example.com/invoice.pdf","caption":"Your invoice","filename":"invoice.pdf"}}'

Was this endpoint guide helpful?

Previous Endpoint
Send Media Message
Next Endpoint
Send Template Message
© 2026 Chatofy Cloud Platform. All rights reserved.
1curl -X POST "https://app.chatofy.in/api/v1/contact/+919000000000/send-media-message" \
2 -H "Authorization: Bearer YOUR_API_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{"document":{"link":"https://example.com/invoice.pdf","caption":"Your invoice","filename":"invoice.pdf"}}'
200 OKapplication/json
1{
2 "success": true,
3 "data": {
4 "message_id": "wamid.HBgLMTIzNDU2...",
5 "raw": {
6 "messaging_product": "whatsapp",
7 "contacts": [
8 {
9 "input": "+919000000000",
10 "wa_id": "919000000000"
11 }
12 ],
13 "messages": [
14 {
15 "id": "wamid.HBgLMTIzNDU2..."
16 }
17 ]
18 }
19 },
20 "message": "Message sent successfully"
21}