Relay a WhatsApp call event
import osimport uuid
import requests
response = requests.post( "https://api.morevoice.ai/v1/whatsapp/events", headers={"Idempotency-Key": str(uuid.uuid4())}, json={ "field": "calls", "hints": { "chat_id": "chat_88", "workspace_id": "ws_12", }, "object": "whatsapp_call_event", "relayed_at": "2026-11-08T09:14:22.000Z", "value": { "calls": [ { "direction": "USER_INITIATED", "event": "connect", "from": "972501234567", "id": "wacid.example-call-0001", "session": { "sdp": "v=0\r\n…", "sdp_type": "offer", }, "timestamp": "1762593262", "to": "97235550100", }, ], "contacts": [ { "profile": { "name": "Dana", }, "wa_id": "972501234567", }, ], "messaging_product": "whatsapp", "metadata": { "display_phone_number": "97235550100", "phone_number_id": "106540352242922", }, }, "waba_id": "102290129340398", },)response.raise_for_status()print(response.json())curl -X POST https://api.morevoice.ai/v1/whatsapp/events \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "field": "calls", "hints": { "chat_id": "chat_88", "workspace_id": "ws_12" }, "object": "whatsapp_call_event", "relayed_at": "2026-11-08T09:14:22.000Z", "value": { "calls": [ { "direction": "USER_INITIATED", "event": "connect", "from": "972501234567", "id": "wacid.example-call-0001", "session": { "sdp": "v=0\r\n…", "sdp_type": "offer" }, "timestamp": "1762593262", "to": "97235550100" } ], "contacts": [ { "profile": { "name": "Dana" }, "wa_id": "972501234567" } ], "messaging_product": "whatsapp", "metadata": { "display_phone_number": "97235550100", "phone_number_id": "106540352242922" } }, "waba_id": "102290129340398"}'Server to server: the WhatsApp calls webhook, relayed by the messaging platform that receives it, or (direct use) the webhook itself. No API key: the request is signed. A relay carries mv-relay-signature: t=<unix>,n=<32 hex>,v2=<hex>, where v2 is the HMAC-SHA256 of <direction>.<t>.<n>.<raw body> (the inbound direction label agreed with the relay) with the relay secret (valid 300 s, each nonce once; a retry gets a new nonce and keeps its mv-relay-id). A direct delivery carries WhatsApp’s x-hub-signature-256: sha256=<hex> over the raw body with the app secret. Any refused signature answers 401 signature_invalid, the same whatever the reason.
Each call event (calls[]: <wacid>:<event>; statuses[]: <wacid>:status:<STATUS>) is taken once: a repeat answers duplicate and changes nothing. The answer (202; 200 for a direct delivery) comes before the events are handled. A relay for a number no organization takes calls on answers 404 resource_missing; a direct delivery lists such events as ignored. hints are display labels echoed on the call’s events, never a routing input.
Try it in the API playground with a test-mode key.
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Accepted and not needed: this endpoint takes each event once by the event’s own key, so a retry never acts twice.
Example
5f0c1e8a-7b2d-4c3e-9f1a-2b6d8e4c0a17Request Body
Section titled “Request Body”A relayed calls change (field + value + hints), or, for direct use, the WhatsApp webhook delivery itself (object + entry). Other fields are ignored.
object
Direct: the webhook’s entry array, verbatim (each changes[] item with field calls is taken).
object
Relay: the webhook field relayed; only calls is taken.
Relay: display labels (workspace, chat, contact) echoed back on the call’s events as metadata. Never used to route a call.
object
Relay: whatsapp_call_event (optional). Direct: whatsapp_business_account.
Relay: when the relay sent it (informational).
Relay: the calls change’s value, verbatim (metadata.phone_number_id names the number; calls[] and statuses[] are the events).
object
Example
{ "field": "calls", "hints": { "chat_id": "chat_88", "workspace_id": "ws_12" }, "object": "whatsapp_call_event", "relayed_at": "2026-11-08T09:14:22.000Z", "value": { "calls": [ { "direction": "USER_INITIATED", "event": "connect", "from": "972501234567", "id": "wacid.example-call-0001", "session": { "sdp": "v=0\r\n…", "sdp_type": "offer" }, "timestamp": "1762593262", "to": "97235550100" } ], "contacts": [ { "profile": { "name": "Dana" }, "wa_id": "972501234567" } ], "messaging_product": "whatsapp", "metadata": { "display_phone_number": "97235550100", "phone_number_id": "106540352242922" } }, "waba_id": "102290129340398"}Responses
Section titled “Responses”Accepted: the call events found and what happened to each.
What the intake did with each call event.
object
The call events found, in order.
object
connect, terminate, …, or status:RINGING / status:ACCEPTED / status:REJECTED …
<wacid>:<event>: the event’s idempotency key (<wacid>:status:<STATUS> for a call status).
accepted: taken, handled right after this answer. duplicate: this key was taken before (a retry): nothing happens again. ignored: no organization takes calls on this number.
WhatsApp’s call ID.
true in live mode, false in test mode.
An ISO-8601 timestamp in UTC.
relay: signed with the relay signature. direct: the WhatsApp webhook’s own signature.
Example
{ "events": [ { "event": "connect", "key": "wacid.example-call-0001:connect", "status": "accepted", "wacid": "wacid.example-call-0001", "whatsapp_number_id": "wan_4Gk2LmN9pQ4rS6tV8wX0yZ" } ], "livemode": true, "object": "whatsapp_event_receipt", "received": "2026-11-08T09:14:22.031Z", "source": "relay"}The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "parameter_missing", "doc_url": "https://docs.morevoice.ai/api/errors#parameter-missing", "message": "Missing required parameter: to.", "param": "to", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No valid API key was sent.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "invalid_api_key", "doc_url": "https://docs.morevoice.ai/api/errors#invalid-api-key", "message": "Invalid API key.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "authentication_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No object with this ID (in the path or the body) exists in this organisation and mode.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "resource_missing", "doc_url": "https://docs.morevoice.ai/api/errors#resource-missing", "message": "No such object: 'call_4Gk2'.", "param": "id", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "not_found" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request conflicts with the object’s state, or the Idempotency-Key was reused with other parameters.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "idempotency_mismatch", "doc_url": "https://docs.morevoice.ai/api/errors#idempotency-mismatch", "message": "This Idempotency-Key was already used with different parameters.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "idempotency_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request body is larger than the endpoint accepts, or has more parts or files than it takes.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "body_too_large", "doc_url": "https://docs.morevoice.ai/api/errors#body-too-large", "message": "The request body is larger than the endpoint accepts.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request body’s Content-Type is not one the endpoint takes.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "unsupported_media_type", "doc_url": "https://docs.morevoice.ai/api/errors#unsupported-media-type", "message": "This endpoint takes application/json.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
Something went wrong on MoreVoice’s side. Retry with the same Idempotency-Key.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "internal_error", "doc_url": "https://docs.morevoice.ai/api/errors#internal-error", "message": "Something went wrong on MoreVoice's side.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "api_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.