Outbound Calls

This section covers APIs used to initiate and manage outgoing WhatsApp voice calls to customers.


Create Outgoing Call

Initiates an outgoing WhatsApp voice call to a customer.

Endpoint

POST /whatsapp/call/create

Permission Required

INITIATE_CALL (validated against from number)


Request Body

FieldTypeRequiredDescription
fromstringYesWABA number to call from
tostringYesCustomer phone number (E.164 format)
sdpstringYesWebRTC SDP offer from the client
sdpTypestringYesSDP type (e.g. offer)
deviceIdstringNoClient device identifier

Response (200)

{
  "success": true,
  "message": "Call initiated",
  "data": {
    "callId": "<provider-call-id>"
  },
  "customer": {
    "name": "<customer-name-or-number>",
    "phoneNumber": "<customer-number>"
  },
  "answer": { ... }
}

Notes

  • answer contains the SDP answer required to complete the WebRTC connection.
  • callId uniquely identifies the call session.

Errors

  • 422 Unprocessable Entity if:

    • Integration is invalid
    • Customer has not granted call permission
    • Wallet balance is insufficient
    • Another call is already in progress

Reconnect Outgoing Call

Reconnects an active outgoing call, typically after a network drop or device change.

Endpoint

POST /whatsapp/call/reconnect

Permission Required

RECEIVE_CALL (validated against callId)


Request Body

FieldTypeRequiredDescription
callIdstringYesCall ID to reconnect
callOriginTypestringYesOUTGOING
sdpstringNoNew WebRTC SDP
deviceIdstringNoClient device identifier
switchCallbooleanNoIndicates device switch

Response (200)

{
  "success": true,
  "message": "Call updated",
  "data": { ... },
  "callStartedAt": "<ISO8601>",
  "customer": {
    "name": "<customer-name-or-number>",
    "phoneNumber": "<customer-number>"
  }
}