

curl 'https://graph.facebook.com/<API_VERSION>/<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <ACCESS_TOKEN>' \ -d ' { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<WHATSAPP_USER_PHONE_NUMBER>", "type": "audio", "audio": { "id": "<MEDIA_ID>", <!-- Only if using uploaded media --> "link": "<MEDIA_URL>", <!-- Only if using hosted media (not recommended) --> "voice": <IS_VOICE?> <!-- Only include if sending voice message --> } }'
| Placeholder | Description | Example Value |
|---|---|---|
<ACCESS_TOKEN>String | Required. | EAAAN6tcBzAUBOZC82CW7iR2LiaZBwUHS4Y7FDtQxRUPy1PHZClDGZBZCgWdrTisgMjpFKiZAi1FBBQNO2IqZBAzdZAA16lmUs0XgRcCf6z1LLxQCgLXDEpg80d41UZBt1FKJZCqJFcTYXJvSMeHLvOdZwFyZBrV9ZPHZASSqxDZBUZASyFdzjiy2A1sippEsF4DVV5W2IlkOSr2LrMLuYoNMYBy8xQczzOKDOMccqHEZD |
<API_VERSION>String | Optional. Graph API version. | v25.0 |
<IS_VOICE?>Boolean | Optional. Set to true if sending a voice message. Voice messages must be Ogg files encoded with the OPUS codec.To send a basic audio message, set to false or omit entirely. | true |
<MEDIA_ID>String | Required if using uploaded media, otherwise omit. ID of the uploaded media asset. | 1013859600285441 |
<MEDIA_URL>String | Required if using hosted media, otherwise omit. URL of the media asset hosted on your public server. For better performance, we recommend using id and an uploaded media asset ID instead. | https://www.luckyshrub.com/media/ringtones/wind-chime.mp3 |
<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>String | Required. WhatsApp business phone number ID. | 106540352242922 |
<WHATSAPP_USER_PHONE_NUMBER>String | Required. WhatsApp user phone number. | +16505551234 |
| Audio Type | Extension | MIME Type | Max Size |
|---|---|---|---|
AAC | .aac | audio/aac | 16 MB |
AMR | .amr | audio/amr | 16 MB |
MP3 | .mp3 | audio/mpeg | 16 MB |
MP4 Audio | .m4a | audio/mp4 | 16 MB |
OGG Audio | .ogg | audio/ogg (OPUS codecs only; base audio/ogg not supported; mono input only) | 16 MB |
curl 'https://graph.facebook.com/v25.0/106540352242922/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+16505551234",
"type": "audio",
"audio": {
"id" : "1013859600285441",
"voice": true
}
}'
{ "messaging_product": "whatsapp", "contacts": [ { "input": "+16505551234", "wa_id": "16505551234" } ], "messages": [ { "id": "wamid.HBgLMTY0NjcwNDM1OTUVAgARGBI1RjQyNUE3NEYxMzAzMzQ5MkEA" } ] }