Send audio
Send audio and voice messages on WhatsApp.
Deliver voice notes or audio files — spoken updates, pronunciation guides, or support messages customers can listen to on the go.
At a glance
| Item | Detail |
|---|---|
type |
audio |
| Supported formats | AAC, AMR, MP3, M4A (audio/mp4), OGG |
| Maximum file size | 16 MB |
| Media field | content.media_url (aliases: media, url) |
content.media_type |
Optional; inferred from type: audio when omitted |
| Channel support | Official and unofficial |
Request body
| Field | Required | Description |
|---|---|---|
channel_id |
Yes | Sender channel ID |
to |
Yes | Recipient phone number |
type |
Yes | audio |
content.media_url |
Yes | HTTPS URL to the audio file |
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": "audio",
"content": {
"media_url": "https://cdn.example.com/audio/voice-note.ogg"
}
}'import { WazapinClient, audioMessage } from "@wazapin/sdk";
const wazapin = new WazapinClient({ apiKey: process.env.WAZAPIN_API_KEY! });
await wazapin.messages.send(
audioMessage({
channel_id: "wzp_abc123",
to: "6281234567890",
media_url: "https://cdn.example.com/audio/voice-note.ogg",
}),
);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": "audio",
"content": {"media_url": "https://cdn.example.com/audio/voice-note.ogg"},
},
timeout=30,
).raise_for_status()