curl --request POST \
--url https://api.wsapi.chat/messages/audio \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"to": "1234567890@s.whatsapp.net",
"url": "https://example.com/audio.mp3",
"mimeType": "audio/mpeg"
}
'{
"id": "01234567890123456"
}{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 403,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Messages
Send an audio message
Send an audio message via URL or base64-encoded data. The response contains the message ID.
POST
/
messages
/
audio
curl --request POST \
--url https://api.wsapi.chat/messages/audio \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>' \
--data '
{
"to": "1234567890@s.whatsapp.net",
"url": "https://example.com/audio.mp3",
"mimeType": "audio/mpeg"
}
'{
"id": "01234567890123456"
}{
"status": 400,
"detail": "invalid request body"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 403,
"detail": "device not paired"
}{
"status": 503,
"detail": "instance not available"
}Authorizations
Instance or customer-level API key. Either the instance's own API key or the customer's API key is accepted. Must be paired with the X-Instance-Id header to identify the target instance.
Headers
The ID of the WhatsApp instance to use
Body
application/json
Recipient JID
Base64-encoded file data (mutually exclusive with url)
URL to download the media from (mutually exclusive with data, max 50 MB)
MIME type of the file (auto-detected if omitted)
Media caption
Send as view-once media
Available options:
off, 24h, 7d, 90d Response
Resource created
ID of the created resource
⌘I