Skip to main content
POST
/
api
/
call
/
audio
/
:instance
Audio Call
curl --request POST \
  --url https://api.example.com/api/call/audio/:instance \
  --header 'Content-Type: <content-type>' \
  --header 'token: <token>' \
  --data '
{
  "number": "<string>",
  "mediaUrl": "<string>",
  "mediaBase64": "<string>"
}
'
Auth: TokenAccount or TokenInstanceRate-limit: Global (100/min) • Idempotent: no

Description

Starts a voice call and, when the recipient answers, plays an audio file. The audio is converted automatically (via ffmpeg) to the format required by WhatsApp voice calls. Provide the media in exactly one field: mediaUrl (accepts a public URL or base64/data URI) or mediaBase64 (base64 only). Sending both, or neither, is an error.

Examples

Audio from a URL

curl -X POST "https://ryzeapi.cloud/api/call/audio/$Instance_Name" \
  -H "token: $Token_Instance" \
  -H "Content-Type: application/json" \
  -d '{
    "number":   "5511999999999",
    "mediaUrl": "https://example.com/message.mp3"
  }'

Audio as base64

Use mediaBase64 when you already have the file bytes (no public URL).
curl -X POST "https://ryzeapi.cloud/api/call/audio/$Instance_Name" \
  -H "token: $Token_Instance" \
  -H "Content-Type: application/json" \
  -d '{
    "number":      "5511999999999",
    "mediaBase64": "SUQzBAAAAAAA...="
  }'

Success response

200 OK
{
  "success": true,
  "message": "Audio call placed",
  "callId":  "3EB08FCF27E532F1D3D3",
  "number":  "5511999999999"
}
The audio only plays if the recipient answers the call. Conversion to WhatsApp’s voice format is done automatically on the server.

Path parameters

instance
string
required
Instance name (e.g., $Instance_Name).

Headers

token
string
required
TokenAccount or TokenInstance.
Content-Type
string
required
application/json

Request body

number
string
required
Destination: phone (5511999999999) or JID (@s.whatsapp.net).
mediaUrl
string
Audio source: accepts a public URL (http(s)://…) or the file contents as base64 — raw base64 or a data URI (data:audio/mpeg;base64,…). The server auto-detects which one you sent. Provide this or mediaBase64, never both.
mediaBase64
string
Audio file contents as base64. Provide this or mediaUrl, never both.

Notes

  • Provide exactly one media source: mediaUrl or mediaBase64. Sending both (or neither) returns 400.
  • The server uses ffmpeg to convert the audio to the codec required by WhatsApp voice calls; common formats (mp3, ogg, wav, m4a) are accepted.

Errors

HTTPMessage
400Instance name is required
400Invalid request body: <detail>
400Number is required
400Provide exactly one of mediaUrl or mediaBase64
404instance not found
500<failure reason>
Error envelope:
{
  "success": false,
  "error": { "message": "Provide exactly one of mediaUrl or mediaBase64" }
}