Send messages
Send document
Send any file type WhatsApp recognises as a document. The filename
shown to the recipient defaults to the URL’s last segment if you
don’t override it.
curl -X POST \ https://api.kirim.chat/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "document", "document": { "link": "https://cdn.example.com/invoices/INV-4521.pdf", "filename": "INV-4521.pdf", "caption": "Invoice bulan Mei" } }'import { Kirim } from '@kirimdev/sdk'
const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!)
await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'document', document: { link: 'https://cdn.example.com/invoices/INV-4521.pdf', filename: 'INV-4521.pdf', caption: 'Invoice bulan Mei', },})Requirements
Section titled “Requirements”| Field | Constraint |
|---|---|
document.link | Public HTTPS URL; either link or id (not both) |
document.filename | Optional, ≤ 255 chars — shown to the recipient |
document.caption | Optional, ≤ 1024 chars |
| Format | PDF, Word, Excel, PowerPoint, plain text, more |
| Max size | 100 MB |