# Relay a WhatsApp call event

`POST https://api.morevoice.ai/v1/whatsapp/events`

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.

No authentication.

Operation ID: `whatsapp_events_relay`.

## Parameters

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |

## Request body

Optional, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `entry` | `object[]` | no | Direct: the webhook's `entry` array, verbatim (each `changes[]` item with field `calls` is taken). |
| `field` | `string` | no | Relay: the webhook field relayed; only `calls` is taken. |
| `hints` | `Record<string, string>` | no | Relay: display labels (workspace, chat, contact) echoed back on the call's events as metadata. Never used to route a call. |
| `object` | `string` | no | Relay: `whatsapp_call_event` (optional). Direct: `whatsapp_business_account`. |
| `relayed_at` | `string` | no | Relay: when the relay sent it (informational). |
| `value` | `object` | no | Relay: the `calls` change's `value`, verbatim (`metadata.phone_number_id` names the number; `calls[]` and `statuses[]` are the events). |
| `waba_id` | `string \| null` | no | Relay: the WhatsApp Business Account (informational). |

Example:

```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"
}
```

## Responses

### 202 Accepted

Accepted: the call events found and what happened to each. Returns `WhatsAppEventReceipt`.

| Field | Type | Description |
| --- | --- | --- |
| `object` | `"whatsapp_event_receipt"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `source` | `"relay" \| "direct"` | `relay`: signed with the relay signature. `direct`: the WhatsApp webhook's own signature. |
| `received` | `string` | An ISO-8601 timestamp in UTC. |
| `events` | `object[]` | The call events found, in order. |

Example:

```json
{
  "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"
}
```

### 400 Bad Request

The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown. Returns `ErrorEnvelope`.

### 401 Unauthorized

No valid API key was sent. Returns `ErrorEnvelope`.

### 404 Not Found

No object with this ID (in the path or the body) exists in this organisation and mode. Returns `ErrorEnvelope`.

### 409 Conflict

The request conflicts with the object's state, or the Idempotency-Key was reused with other parameters. Returns `ErrorEnvelope`.

### 413 Payload Too Large

The request body is larger than the endpoint accepts, or has more parts or files than it takes. Returns `ErrorEnvelope`.

### 415 Unsupported Media Type

The request body's Content-Type is not one the endpoint takes. Returns `ErrorEnvelope`.

### 500 Internal Server Error

Something went wrong on MoreVoice's side. Retry with the same Idempotency-Key. Returns `ErrorEnvelope`.

## Code samples

**Python**

```python
import os
import 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**

```sh
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"
}'
```
