Skip to content
Wazapin
Esc
navigateopen⌘Jpreview
On this page

Send document

Send PDF and document files on WhatsApp.

Send PDFs, invoices, or Office files the customer can open directly in WhatsApp.

At a glance

Item Detail
type document
Common formats PDF, DOC/DOCX, XLS/XLSX, PPT/PPTX, plain text
Maximum file size 100 MB
Media field content.media_url (aliases: media, url)
File name Recommended: content.file_name (alias: fileName)
Caption Optional content.caption
Channel support Official and unofficial

Request body

Field Required Description
channel_id Yes Sender channel ID
to Yes Recipient phone number
type Yes document
content.media_url Yes HTTPS URL to the document
content.file_name No Display name in the chat (recommended)
content.caption No Optional caption

Example

curl -X POST "https://api.wazapin.com/v1/messages" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "wzp_abc123",
    "to": "6281234567890",
    "type": "document",
    "content": {
      "media_url": "https://cdn.example.com/docs/invoice-2026-001.pdf",
      "file_name": "invoice-2026-001.pdf",
      "caption": "Invoice terbaru kamu"
    }
  }'
import { WazapinClient, documentMessage } from "@wazapin/sdk";

const wazapin = new WazapinClient({ apiKey: process.env.WAZAPIN_API_KEY! });

await wazapin.messages.send(
  documentMessage({
    channel_id: "wzp_abc123",
    to: "6281234567890",
    media_url: "https://cdn.example.com/docs/invoice-2026-001.pdf",
    file_name: "invoice-2026-001.pdf",
    caption: "Invoice terbaru kamu",
  }),
);
import requests

requests.post(
    "https://api.wazapin.com/v1/messages",
    headers={"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
    json={
        "channel_id": "wzp_abc123",
        "to": "6281234567890",
        "type": "document",
        "content": {
            "media_url": "https://cdn.example.com/docs/invoice-2026-001.pdf",
            "file_name": "invoice-2026-001.pdf",
            "caption": "Invoice terbaru kamu",
        },
    },
    timeout=30,
).raise_for_status()

Was this page helpful?