
SDP Offer:{
"object": "whatsapp_business_account",
"entry": [
{
"id": "366634483210360", // WhatsApp Business Account ID associated with the business phone number
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": { // ID and display number for the business phone number placing the call (caller)
"phone_number_id": "436666719526789",
"display_phone_number": "13175551399",
},
"calls": [
{
"id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh", // The WhatsApp call ID
"to": "16315553601", // The WhatsApp user's phone number (callee)
"from": "13175551399",
"event": "connect",
"timestamp": "1671644824",
"session": {
"sdp_type": "offer",
"sdp": "<<RFC 8866 SDP>>"
}
}
]
},
"field": "calls"
}
]
}
]
}
POST <PHONE_NUMBER_ID>/calls endpoint with the call_id from the previous webhook, an action of pre-accept, and an SDP Answer:POST <PHONE_NUMBER_ID>/calls
{
"messaging_product": "whatsapp",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"action": "pre_accept",
"session": {
"sdp_type": "answer"
"sdp": "<<RFC 8866 SDP>>"
}
}
{
"success" : true
}
200 OK back from the endpoint. Media will begin flowing immediately since the connection was established prior to call connect.POST <PHONE_NUMBER_ID>/calls endpoint with the following request body to accept the call:POST <PHONE_NUMBER_ID>/calls
{
"messaging_product": "whatsapp",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"action": "accept",
"session" : {
"sdp_type" : "answer",
"sdp" : "<<RFC 8866 SDP>>"
},
}
POST <PHONE_NUMBER_ID>/calls endpoint with the following request body to terminate the call:POST <PHONE_NUMBER_ID>/calls
{
"messaging_product": "whatsapp",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"action" : "terminate"
}
{
"success" : true
}
{
"object": "whatsapp_business_account",
"entry": [
{
"id": "366634483210360", // WhatsApp Business Account ID associated with the business phone number
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": { // ID and display number for the business phone number placing the call (caller)
"phone_number_id": "436666719526789"
"display_phone_number": "13175551399",
},
"calls": [
{
"id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"to": "16315553601", // The WhatsApp user's phone number (callee)
"from": "13175551399", // The business phone number placing the call (caller)
"event": "terminate",
"direction": "USER_INITIATED",
"timestamp": "1749197480",
"status": ["Failed", "Completed"],
"start_time": "1671644824", // Call start UNIX timestamp
"end_time": "1671644944", // Call end UNIX timestamp
"duration": 480 // Call duration in seconds
}
]
},
"field": "calls"
}
]
}
]
}
POST <PHONE_NUMBER_ID/calls
| Placeholder | Description | Sample Value |
|---|---|---|
<PHONE_NUMBER_ID>Integer | Required The business phone number which you are using Calling API features from. | +12784358810 |
{
"messaging_product": "whatsapp",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"action": "pre_accept",
"session" : {
"sdp_type" : "answer",
"sdp" : "<<RFC 8866 SDP>>"
}
}
| Parameter | Description | Sample Value |
|---|---|---|
call_idString | Required The ID of the phone call. For inbound calls, you receive a call ID from the Call Connect webhook when a WhatsApp user initiates the call. | “wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh” |
actionString | Optional The action being taken on the given call ID. Values can be connect | pre_accept | accept | reject | terminate | “pre_accept” |
sessionJSON object | Optional Contains the session description protocol (SDP) type and description language. Requires two values: sdp_type — (String) Required“offer”, to indicate SDP offer sdp — (String) RequiredThe SDP info of the device on the other end of the call. The SDP must be compliant with RFC 8866. | |
{
"messaging_product": "whatsapp",
"success" : true
}
call-idphone-number-idPOST <PHONE_NUMBER_ID/calls
| Placeholder | Description | Sample Value |
|---|---|---|
<PHONE_NUMBER_ID>Integer | Required The business phone number which you are using Calling API features from. | +12784358810 |
{
"messaging_product": "whatsapp",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"action": "accept",
"session" : {
"sdp_type" : "answer",
"sdp" : "<<RFC 8866 SDP>>"
},
"biz_opaque_callback_data": "random_string"
}
| Parameter | Description | Sample Value |
|---|---|---|
call_idString | Required The ID of the phone call. For inbound calls, you receive a call ID from the Call Connect webhook when a WhatsApp user initiates the call. | “wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh” |
actionString | Optional The action being taken on the given call ID. Values can be connect | pre_accept | accept | reject | terminate | “accept” |
sessionJSON object | Optional Contains the session description protocol (SDP) type and description language. Requires two values: sdp_type — (String) Required“offer”, to indicate SDP offer sdp — (String) RequiredThe SDP info of the device on the other end of the call. The SDP must be compliant with RFC 8866. | |
biz_opaque_callback_dataString | Optional An arbitrary string you can pass in that is useful for tracking and logging purposes. Any app subscribed to the “calls” webhook field on your WhatsApp Business Account can receive this string, as it is included in the calls object within the subsequent Terminate webhook payload.Cloud API does not process this field, it just returns it as part of the Terminate webhook. Maximum 512 characters | “8huas8d80nn” |
{
"messaging_product": "whatsapp",
"success" : true
}
call-idphone-number-idcall-idPOST <PHONE_NUMBER_ID/calls
| Placeholder | Description | Sample Value |
|---|---|---|
<PHONE_NUMBER_ID>Integer | Required The business phone number which you are using Calling API features from. | +12784358810 |
{
"messaging_product": "whatsapp",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"action": "reject"
}
| Parameter | Description | Sample Value |
|---|---|---|
call_idString | Required The ID of the phone call. For inbound calls, you receive a call ID from the Call Connect webhook when a WhatsApp user initiates the call. | “wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh” |
actionString | Optional The action being taken on the given call ID. Values can be connect | pre_accept | accept | reject | terminate | “reject” |
{
"messaging_product": "whatsapp",
"success" : true
}
call-idphone-number-idRTCP BYE packet in the media path. Ending the call this way also ensures pricing is more accurate.POST <PHONE_NUMBER_ID/calls
| Placeholder | Description | Sample Value |
|---|---|---|
<PHONE_NUMBER_ID>Integer | Required The business phone number which you are using Calling API features from. | +12784358810 |
{
"messaging_product": "whatsapp",
"call_id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"action": "terminate"
}
| Parameter | Description | Sample Value |
|---|---|---|
call_idString | Required The ID of the phone call. For inbound calls, you receive a call ID from the Call Connect webhook when a WhatsApp user initiates the call. | “wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh” |
actionString | Optional The action being taken on the given call ID. Values can be connect | pre_accept | accept | reject | terminate | “terminate” |
{
"messaging_product": "whatsapp",
"success" : true
}
call-idphone-number-id”calls” object inside the ”value” object of the webhook response. The ”calls” object contains metadata about the call that is used to action on each call received by your business.SDP Answer).SDP Answer received in the webhook to your WebRTC stack in order to initiate the media connection.{
"object": "whatsapp_business_account",
"entry": [
{
"id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "16315553601",
"phone_number_id": "<PHONE_NUMBER_ID>"
},
"contacts": [
{
"profile": {
"name": "<CALLEE_NAME>"
},
"wa_id": "16315553602"
}
],
"calls": [
{
"id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"to": "16315553601",
"from": "16315553602",
"event": "connect",
"timestamp": "1671644824",
"direction": "USER_INITIATED",
"deeplink_payload": "deeplink_payload",
"cta_payload": "cta_payload",
"session": {
"sdp_type": "offer",
"sdp": "<<RFC 8866 SDP>>"
}
}
]
},
"field": "calls"
}
]
}
]
}
"calls"| Placeholder | Description |
|---|---|
idString | A unique ID for the call |
toInteger | The number being called (callee) |
fromInteger | The number of the caller |
eventInteger | The calling event that this webhook is notifying the subscriber of |
timestampInteger | The UNIX timestamp of the webhook event |
directionString | The direction of the call being made. Can contain either: BUSINESS_INITIATED, for calls initiated by your business.USER_INITIATED, for calls initiated by a WhatsApp user. |
deeplink_payloadString | Arbitrary string specified in biz_payload query param on a call deeplink. Will only be returned if call was initiated from a deeplink with such param.See Call Button Messages and Deep Links
for more details. |
cta_payloadString | Arbitrary string specified in payload field on a call button. Will only be returned if call was initiated from a call button with payload.See Call Button Messages and Deep Links
for more details. |
sessionJSON object | Optional Contains the session description protocol (SDP) type and description language. Requires two values: sdp_type — (String) Required“offer”, to indicate SDP offer sdp — (String) RequiredThe SDP info of the device on the other end of the call. The SDP must be compliant with RFC 8866. |
contactsJSON object | Profile information of the callee. Contains two values: name — The WhatsApp profile name of the callee.wa_id — The WhatsApp ID of the callee. |
POST /<PHONE_NUMBER_ID>/calls endpoint with an action of terminate or reject.{
"object": "whatsapp_business_account",
"entry": [
{
"id": "<WHATSAPP_BUSINESS_ACCOUNT_ID>",
"changes": [
{
"value": {
"messaging_product": "whatsapp",
"metadata": {
"display_phone_number": "16505553602",
"phone_number_id": "<PHONE_NUMBER_ID>",
},
"calls": [
{
"id": "wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh",
"to": "16315553601",
"from": "16315553602",
"event": "terminate"
"direction": "USER_INITIATED",
"deeplink_payload": "deeplink_payload",
"cta_payload": "cta_payload",
"biz_opaque_callback_data": "random_string",
"timestamp": "1671644824",
"status" : [FAILED | COMPLETED],
"start_time" : "1671644824",
"end_time" : "1671644944",
"duration" : 120
}
],
"errors": [
{
"code": INT_CODE,
"message": "ERROR_TITLE",
"href": "ERROR_HREF",
"error_data": {
"details": "ERROR_DETAILS"
}
}
]
},
"field": "calls"
}
]
}
]
}
"calls"| Placeholder | Description |
|---|---|
idString | A unique ID for the call |
toInteger | The number being called (callee) |
fromInteger | The number of the caller |
eventInteger | The calling event that this webhook is notifying the subscriber of |
timestampInteger | The UNIX timestamp of the webhook event |
directionString | The direction of the call being made. Can contain either: BUSINESS_INITIATED, for calls initiated by your business.USER_INITIATED, for calls initiated by a WhatsApp user. |
deeplink_payloadString | Arbitrary string specified in biz_payload query param on a call deeplink. Will only be returned if call was initiated from a deeplink with such param.See Call Button Messages and Deep Links
for more details. |
cta_payloadString | Arbitrary string specified in payload field on a call button. Will only be returned if call was initiated from a call button with payload.See Call Button Messages and Deep Links
for more details. |
start_timeInteger | The UNIX timestamp of when the call started. Only present when the call was picked up by the other party. |
end_timeInteger | The UNIX timestamp of when the call ended. Only present when the call was picked up by the other party. |
durationInteger | Duration of the call in seconds. Only present when the call was picked up by the other party. |
biz_opaque_callback_dateString | Arbitrary string your business passes into the call for tracking and logging purposes. Will only be returned if provided through an Initiate Call request or Accept Call request |
errors.codeInteger | The errors object is present only for failed calls when there is error information available. Code is one of the calling error codes |
