Send an audio message
Sends an audio file. Needs an open
24-hour window.
Give the file as a public link or as an id from
POST /v1/{phone_number_id}/media.
Example
Section titled “Example”curl -X POST "$HELLO_API_URL/v1/<your-phone-number-id>/messages" \ -H "Authorization: Bearer $HELLO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "to": "+919999999999", "type": "audio", "audio": { "link": "https://example.com/audio/appointment-reminder.mp3" } }'By media ID:
{ "to": "+919999999999", "type": "audio", "audio": { "id": "1099999999999012" }}Response
Section titled “Response”202 Accepted (queued), or 200 in synchronous mode (?sync=true or the key’s default) once WhatsApp accepts it. See
Send a message.
Fields
Section titled “Fields”| Field | Type | Required | Description |
|---|---|---|---|
audio.link |
string | One of link / id |
Public HTTPS URL of the audio file |
audio.id |
string | One of link / id |
Media id from POST /v1/{phone_number_id}/media. Takes precedence if both are set. |
WhatsApp doesn’t allow captions on audio, so a caption field is ignored.
Supported formats: audio/aac, audio/amr, audio/mpeg (MP3), audio/mp4 and audio/ogg
(Opus codec only), up to 16 MB. An OGG/Opus file is shown as a voice note.
Common errors
Section titled “Common errors”| Status | code |
Cause |
|---|---|---|
403 |
OUTSIDE_24H_WINDOW |
The recipient’s 24-hour window is closed |
400 |
VALIDATION_ERROR |
audio is missing or the wrong shape |
422 |
SEND_FAILED |
(synchronous mode only) WhatsApp rejected the send |