Skip to content

Calls API

Initiate and manage WhatsApp voice calls programmatically using WebRTC-based signaling.

Note: WhatsApp calling requires the recipient's device to support WhatsApp voice calls and be connected to the internet. Calls go through WhatsApp's peer-to-peer infrastructure, not the PSTN.

Overview

MethodEndpointDescription
POSThttps://api.vobiz.ai/v1/messaging/calls/whatsappInitiate a WhatsApp call
POSThttps://api.vobiz.ai/v1/messaging/calls/whatsapp/actionManage call (accept/reject/terminate)
GEThttps://api.vobiz.ai/v1/messaging/calls/whatsapp/logsList call history

Initiate WhatsApp Call

POSThttps://api.vobiz.ai/v1/messaging/calls/whatsapp

Initiates a WhatsApp voice call. Provide a WebRTC SDP offer — Vobiz returns the SDP answer from the recipient's device once they accept.

FieldRequiredDescription
channel_idRequiredChannel to call from
toRequiredRecipient phone number (E.164)
sdp_offerRequiredWebRTC SDP offer string

Authentication Required:

  • X-Auth-ID: Your Account Auth ID
  • X-Auth-Token: Your Account Auth Token
  • Accept: application/json
cURL
curl -X POST \
  "https://api.vobiz.ai/v1/messaging/calls/whatsapp" \
  -H "X-Auth-ID: {auth_id}" \
  -H "X-Auth-Token: {auth_token}" \
  -H "Content-Type: application/json" \
  -d '{"channel_id":"{channel_id}","to":"{to}","sdp_offer":"v=0\r\no=- 0 0 IN IP4 0.0.0.0\r\n..."}'
Response — 200 OK
{"call_id":"call_abc123","status":"initiated","sdp_answer":"v=0\r\n...","created_at":"2026-03-25T14:00:00Z"}

Manage Call (Actions)

POSThttps://api.vobiz.ai/v1/messaging/calls/whatsapp/action

Control an active or incoming call. Pass the call_id and one of the four actions: pre_accept, accept, reject, terminate.

Authentication Required:

  • X-Auth-ID: Your Account Auth ID
  • X-Auth-Token: Your Account Auth Token
  • Accept: application/json
pre_accept
Signal call preview before full accept
accept
Accept an incoming call
reject
Reject an incoming call
terminate
End an active connected call
cURL — Terminate a call
curl -X POST \
  "https://api.vobiz.ai/v1/messaging/calls/whatsapp/action" \
  -H "X-Auth-ID: {auth_id}" \
  -H "X-Auth-Token: {auth_token}" \
  -H "Content-Type: application/json" \
  -d '{"call_id":"{call_id}","action":"terminate"}'
cURL — Accept an incoming call
curl -X POST \
  "https://api.vobiz.ai/v1/messaging/calls/whatsapp/action" \
  -H "X-Auth-ID: {auth_id}" \
  -H "X-Auth-Token: {auth_token}" \
  -H "Content-Type: application/json" \
  -d '{"call_id":"{call_id}","action":"accept"}'

List Call Logs

GEThttps://api.vobiz.ai/v1/messaging/calls/whatsapp/logs

Returns a paginated history of all WhatsApp calls — inbound and outbound — with duration, outcome, and participant details.

Authentication Required:

  • X-Auth-ID: Your Account Auth ID
  • X-Auth-Token: Your Account Auth Token
  • Accept: application/json
cURL
curl -X GET \
  "https://api.vobiz.ai/v1/messaging/calls/whatsapp/logs?page=1&limit=25" \
  -H "X-Auth-ID: {auth_id}" \
  -H "X-Auth-Token: {auth_token}"
Response — 200 OK
{
  "data": [{"call_id":"call_abc123","direction":"outbound","to":"+919876543210","status":"completed","duration_seconds":185,"started_at":"2026-03-25T14:00:00Z","ended_at":"2026-03-25T14:03:05Z"}],
  "meta": {"total":12,"page":1}
}
Last updated: April 2026Edit this page