Skip to content

call.* (Call Events)

Mahadata sends seven webhook events for the WhatsApp Business voice call lifecycle (call.ringing, call.answered, call.ended, call.missed, call.declined, call.failed, and call.permission.updated). Register the event names explicitly in your webhook endpoint configuration in Developer → Webhooks.

EventWhen It Is Sent
call.ringingA new inbound call (inbound) arrives from a customer, or an outbound call (outbound) starts ringing on the destination device.
call.answeredAn agent answers an inbound call, or a customer picks up an outbound call. (In B2BUA/queue mode, hold music does not trigger call.answered until the agent is actually connected).
call.endedA call that has been answered by the agent/customer ends normally (outcome = "answered").
call.missedCall ended without ever connecting to an agent (outcome = "missed"), including queue timeout (queue_timeout) or disconnect before the agent picked up.
call.declinedCall explicitly rejected by the agent or recipient (outcome = "declined", for example rejected, USER_DECLINED, or busy).
call.failedCall failed due to network/platform constraints or Meta policy rejection (outcome = "failed").
call.permission.updatedThe status of the outbound call permission to the customer changed (request sent, approved/rejected by the customer, automatically revoked after the consecutive unanswered call limit, or the customer sent a stop/start keyword).
  • Signature Header: Every HTTP POST request includes the header X-Mahadata-Signature-256 containing sha256=<hex_hmac> computed over the raw body using the webhook endpoint’s secret.
  • At-Least-Once Delivery: If your server returns a non-2xx status or times out, the system will retry delivery with exponential backoff.
  • Idempotency (event_id): Each event has a deterministic event_id (UUID v5 of call.id and the event name). Store processed event_id values so that resending becomes a no-op on your system side.
  • Payload Security: Public payloads never contain WebRTC SDP, access tokens, or internal storage object keys. To download a recording when recording_available: true, call the endpoint GET /v1/calls/{id}/recording.
FieldTypeDescription
idUUIDUnique ID of the call log on the platform
wa_call_idstringCall session ID from WhatsApp
directionstring"inbound" (customer calls the business) or "outbound" (business calls the customer)
business_phonestringBusiness WhatsApp number (E.164/digits)
business_phone_idUUIDID of the business WhatsApp number on the platform
customer_phonestringCustomer WhatsApp number
statusstringLatest internal status (ringing, answered, ended, missed, failed)
outcomestringFinal call outcome (in_progress, answered, missed, declined, failed)
end_reasonstring | nullEnd reason (hangup, rejected, queue_timeout, ivr_hangup, stale_timeout, etc.)
duration_secondsintegerTalk duration in seconds
started_atstring (RFC3339) | nullTime the call was connected
answered_atstring (RFC3339) | nullExplicit answer time if available
ended_atstring (RFC3339) | nullTime the call ended
created_atstring (RFC3339)Time the call log was created
queue_idUUID | nullCall queue ID (if routed to a queue)
agentobject | null{ "id": "<uuid>", "name": "<agent name>" } if agent connected
conversation_idUUID | nullRelated omnichannel conversation ID
contact_idUUID | nullCustomer contact ID
contact_namestring | nullCustomer contact name
dispositionstring | nullPost-call disposition code label
recording_availablebooleantrue if recording is available via GET /v1/calls/{id}/recording
entryobject | null{ "kind": "call_button" | "deeplink", "payload": "<optional>" } if the inbound call started from an interactive call button/template or a WhatsApp call link
POST {your_webhook_url}
{
"event": "call.ringing",
"event_id": "2c8b02d3-4b88-58f6-9e77-8a14d001b101",
"occurred_at": "2026-10-24T10:15:00+00:00",
"call": {
"id": "0192be10-4400-7000-8000-000000000001",
"wa_call_id": "wacid.HBgNNjI4MTIzNDU2Nzg5MBUCABIYFDNB",
"direction": "inbound",
"business_phone": "622150991000",
"business_phone_id": "11111111-2222-4333-8444-555555555555",
"customer_phone": "6281234567890",
"status": "ringing",
"outcome": "in_progress",
"end_reason": null,
"duration_seconds": 0,
"started_at": null,
"answered_at": null,
"ended_at": null,
"created_at": "2026-10-24T10:15:00Z",
"queue_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee",
"agent": null,
"conversation_id": "99999999-8888-4777-8666-555555555555",
"contact_id": "77777777-6666-4555-8444-333333333333",
"contact_name": "Budi Santoso",
"disposition": null,
"recording_available": false
}
}
POST {your_webhook_url}
{
"event": "call.answered",
"event_id": "4e12f9c0-7a11-5c92-8b30-9f22d001b102",
"occurred_at": "2026-10-24T10:15:06+00:00",
"call": {
"id": "0192be10-4400-7000-8000-000000000001",
"wa_call_id": "wacid.HBgNNjI4MTIzNDU2Nzg5MBUCABIYFDNB",
"direction": "inbound",
"business_phone": "622150991000",
"business_phone_id": "11111111-2222-4333-8444-555555555555",
"customer_phone": "6281234567890",
"status": "answered",
"outcome": "in_progress",
"end_reason": null,
"duration_seconds": 0,
"started_at": "2026-10-24T10:15:06Z",
"answered_at": null,
"ended_at": null,
"created_at": "2026-10-24T10:15:00Z",
"queue_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee",
"agent": {
"id": "22222222-3333-4444-8555-666666666666",
"name": "Siti Aminah"
},
"conversation_id": "99999999-8888-4777-8666-555555555555",
"contact_id": "77777777-6666-4555-8444-333333333333",
"contact_name": "Budi Santoso",
"disposition": null,
"recording_available": false
}
}
POST {your_webhook_url}
{
"event": "call.ended",
"event_id": "8a44e110-12c4-5d01-a122-3c44d001b103",
"occurred_at": "2026-10-24T10:17:10+00:00",
"call": {
"id": "0192be10-4400-7000-8000-000000000001",
"wa_call_id": "wacid.HBgNNjI4MTIzNDU2Nzg5MBUCABIYFDNB",
"direction": "inbound",
"business_phone": "622150991000",
"business_phone_id": "11111111-2222-4333-8444-555555555555",
"customer_phone": "6281234567890",
"status": "ended",
"outcome": "answered",
"end_reason": "hangup",
"duration_seconds": 124,
"started_at": "2026-10-24T10:15:06Z",
"answered_at": null,
"ended_at": "2026-10-24T10:17:10Z",
"created_at": "2026-10-24T10:15:00Z",
"queue_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee",
"agent": {
"id": "22222222-3333-4444-8555-666666666666",
"name": "Siti Aminah"
},
"conversation_id": "99999999-8888-4777-8666-555555555555",
"contact_id": "77777777-6666-4555-8444-333333333333",
"contact_name": "Budi Santoso",
"disposition": "Solved",
"recording_available": true
}
}
POST {your_webhook_url}
{
"event": "call.missed",
"event_id": "1f90c321-65b1-5a88-9012-7e55d001b104",
"occurred_at": "2026-10-24T10:20:00+00:00",
"call": {
"id": "0192be10-4400-7000-8000-000000000002",
"wa_call_id": "wacid.HBgNNjI4MTIzNDU2Nzg5MBUCABIYFDNC",
"direction": "inbound",
"business_phone": "622150991000",
"business_phone_id": "11111111-2222-4333-8444-555555555555",
"customer_phone": "6281234567890",
"status": "missed",
"outcome": "missed",
"end_reason": "queue_timeout",
"duration_seconds": 0,
"started_at": null,
"answered_at": null,
"ended_at": "2026-10-24T10:20:00Z",
"created_at": "2026-10-24T10:15:00Z",
"queue_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee",
"agent": null,
"conversation_id": "99999999-8888-4777-8666-555555555555",
"contact_id": "77777777-6666-4555-8444-333333333333",
"contact_name": "Budi Santoso",
"disposition": null,
"recording_available": false
}
}
POST {your_webhook_url}
{
"event": "call.declined",
"event_id": "5b77a810-33d2-5f10-8111-4d66d001b105",
"occurred_at": "2026-10-24T10:22:12+00:00",
"call": {
"id": "0192be10-4400-7000-8000-000000000003",
"wa_call_id": "wacid.HBgNNjI4MTIzNDU2Nzg5MBUCABIYFDND",
"direction": "inbound",
"business_phone": "622150991000",
"business_phone_id": "11111111-2222-4333-8444-555555555555",
"customer_phone": "6281234567890",
"status": "ended",
"outcome": "declined",
"end_reason": "rejected",
"duration_seconds": 0,
"started_at": null,
"answered_at": null,
"ended_at": "2026-10-24T10:22:12Z",
"created_at": "2026-10-24T10:22:00Z",
"queue_id": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee",
"agent": null,
"conversation_id": "99999999-8888-4777-8666-555555555555",
"contact_id": "77777777-6666-4555-8444-333333333333",
"contact_name": "Budi Santoso",
"disposition": null,
"recording_available": false
}
}
POST {your_webhook_url}
{
"event": "call.failed",
"event_id": "9d31b402-88e9-5c44-b220-1a77d001b106",
"occurred_at": "2026-10-24T10:25:03+00:00",
"call": {
"id": "0192be10-4400-7000-8000-000000000004",
"wa_call_id": "wacid.HBgNNjI4MTIzNDU2Nzg5MBUCABIYFDNE",
"direction": "outbound",
"business_phone": "622150991000",
"business_phone_id": "11111111-2222-4333-8444-555555555555",
"customer_phone": "6281234567890",
"status": "failed",
"outcome": "failed",
"end_reason": "error",
"duration_seconds": 0,
"started_at": null,
"answered_at": null,
"ended_at": "2026-10-24T10:25:03Z",
"created_at": "2026-10-24T10:25:00Z",
"queue_id": null,
"agent": {
"id": "22222222-3333-4444-8555-666666666666",
"name": "Siti Aminah"
},
"conversation_id": "99999999-8888-4777-8666-555555555555",
"contact_id": "77777777-6666-4555-8444-333333333333",
"contact_name": "Budi Santoso",
"disposition": null,
"recording_available": false
}
}

Sent whenever the outbound call permission status between the business number and the customer changes. Unlike the six call status events above which contain the object call, this event contains the object permission.

POST {your_webhook_url}
{
"event": "call.permission.updated",
"event_id": "0192d100-5500-7000-8000-000000000007",
"occurred_at": "2026-10-28T06:00:00+00:00",
"permission": {
"business_phone_id": "11111111-2222-4333-8444-555555555555",
"business_phone": "622150991000",
"customer_phone": "6281234567890",
"status": "temporary",
"reason": "customer_reply",
"expires_at": "2026-11-04T06:00:00+00:00"
}
}
FieldTypeDescription
business_phone_idUUIDThe business WhatsApp number ID in Mahadata
business_phonestringBusiness WhatsApp number (E.164/digits)
customer_phonestringCustomer WhatsApp number (digits)
statusstringLatest permission status: "requested", "temporary", "permanent", "rejected", "revoked", "opted_out", or "opted_in"
reasonstring | nullChange trigger: "agent" (permission request from agent, API, or automation), "customer_reply", "unanswered_streak", or "keyword"
expires_atstring (RFC3339) | nullCall permission expiration time (usually 7 days since approved by the customer)

To display the screen-pop customer card in an external CRM when the phone rings:

  1. Subscribe to the event call.ringing, call.answered, call.ended, and call.missed.
  2. When call.ringing is received:
    • Verify X-Mahadata-Signature-256 and check event_id to avoid processing duplicates.
    • Fetch call.contact_id or call.customer_phone to look up the customer profile in your CRM.
    • Display an incoming-call pop-up with a link to the conversation (call.conversation_id).
  3. When call.answered is received, route the screen-pop to the agent session call.agent.id.
  4. When call.ended is received and call.recording_available == true, call GET /v1/calls/{call.id}/recording to retrieve a time-limited (15-minute) recording download URL.