ChatofyDevelopersv1.0
API KeysWebhooks
Chatofy API
/
Getting Started
API Resources
API v1.0 Live
99.99%
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:+917838343515
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

curl -X POST "https://app.chatofy.in/api/v1/contact/+917838343515/send-media-message" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -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.
Enterprise SLA•99.99% Guaranteed
curl -X POST "https://app.chatofy.in/api/v1/contact/+917838343515/send-media-message" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"document":{"link":"https://example.com/invoice.pdf","caption":"Your invoice","filename":"invoice.pdf"}}'
200 OKapplication/json
{
  "success": true,
  "data": {
    "message_id": "wamid.HBgLMTIzNDU2...",
    "raw": {
      "messaging_product": "whatsapp",
      "contacts": [
        {
          "input": "+917838343515",
          "wa_id": "917838343515"
        }
      ],
      "messages": [
        {
          "id": "wamid.HBgLMTIzNDU2..."
        }
      ]
    }
  },
  "message": "Message sent successfully"
}