Send messages
Send audio
Send a hosted audio file by passing its HTTPS URL in audio.link.
Use this for music clips, podcasts, or pre-recorded voice notes.
curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "audio", "audio": { "link": "https://cdn.example.com/welcome.mp3" } }'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: 'audio', audio: { link: 'https://cdn.example.com/welcome.mp3' },})Send as a voice note
Section titled “Send as a voice note”Set audio.voice: true to have WhatsApp render the message as a
voice-note bubble (waveform + play icon + microphone glyph) instead of
a generic audio file attachment. Voice-note presentation is also what
unlocks the recipient-side speech-to-text transcript feature, where
the recipient sees a typed-out version of the audio below the bubble
(when they have enabled it in their WhatsApp settings).
curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "audio", "audio": { "link": "https://cdn.example.com/order-ready.ogg", "voice": true } }'await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'audio', audio: { link: 'https://cdn.example.com/order-ready.ogg', voice: true, },})Omit the field (or set it to false) to fall back to the default
audio-file presentation. Forwarded verbatim to Meta — see Meta’s
audio message guide
for the original spec.
Requirements
Section titled “Requirements”| Field | Constraint |
|---|---|
audio.link | Public HTTPS URL; either link or id (not both) |
audio.voice | Optional boolean. true renders the message as a voice note bubble. |
| Format | AAC, M4A, AMR, MP3, OGG (Opus codec only) |
| Max size | 16 MB |