Send messages
Send text
Send a plain-text message — up to 4,096 characters, optional URL preview. Body shape mirrors Meta’s WhatsApp Cloud API exactly.
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": "text", "text": { "body": "Halo dari Kirim" } }'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: 'text', text: { body: 'Halo dari Kirim' },})Optional: link previews
Section titled “Optional: link previews”Set text.preview_url: true to ask WhatsApp to render a rich preview
for the first URL found in body. Meta fetches the page server-side —
no extra payload needed from your side.
{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": { "body": "Cek harga terbaru: https://example.com/pricing", "preview_url": true }}See also
Section titled “See also”- API Reference — Send a WhatsApp message
- Quickstart — full account-setup walkthrough before your first send
- Idempotency — safely retrying a send