Skip to main content
POST
/
{phone_number_id}
/
calls
curl --request POST \
--url https://api.kapso.ai/meta/whatsapp/{phone_number_id}/calls \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"messaging_product": "whatsapp",
"to": "15551234567",
"action": "connect",
"session": {
"sdp_type": "offer",
"sdp": "v=0\r\no=- 6314352886888624490 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS ccd3f422-8d7d-49c9-936c-a152979ee4fa\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 110 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:/PSS\r\na=ice-pwd:buBIz+JlbmakiCT7JdJIq/j0\r\na=ice-options:trickle\r\na=fingerprint:sha-256 43:08:34:16:67:E3:D9:A2:F5:AA:6A:AE:03:97:C8:D5:B8:F2:4B:40:79:C8:1A:44:53:69:4B:9C:89:88:D7:22\r\na=setup:active\r\na=mid:0\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\n"
},
"biz_opaque_callback_data": "call_session_abc123"
}'
{
"messaging_product": "whatsapp",
"calls": [
{
"id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh"
}
]
}

Authorizations

X-API-Key
string
header
required

Project API key for authentication. This is the recommended authentication method.

Get your API key from the Kapso dashboard under Project Settings > API Keys.

Path Parameters

phone_number_id
string
required

WhatsApp Business Phone Number ID

Body

application/json
messaging_product
enum<string>
required
Available options:
whatsapp
Example:

"whatsapp"

action
enum<string>
required

The action to perform

Available options:
connect,
pre_accept,
accept,
reject,
terminate
Example:

"accept"

to
string

Recipient WhatsApp ID (required for connect action)

Example:

"15551234567"

call_id
string

Call ID (required for pre_accept, accept, reject, terminate)

Example:

"wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh"

session
object

WebRTC session description (required for connect, pre_accept, accept)

biz_opaque_callback_data
string

Arbitrary tracking string (max 512 chars, optional for connect/accept)

Maximum length: 512
Example:

"tracking_id_12345"

Response

Action performed successfully

messaging_product
enum<string>
Available options:
whatsapp
Example:

"whatsapp"

success
boolean
Example:

true

calls
object[]

Returned for connect action