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.kirim.chat/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' },})Requirements
Section titled “Requirements”| Field | Constraint |
|---|---|
audio.link | Public HTTPS URL; either link or id (not both) |
| Format | AAC, M4A, AMR, MP3, OGG (Opus codec only) |
| Max size | 16 MB |