# Call a WhatsApp user

`POST https://api.morevoice.ai/v1/whatsapp_calls`

Calls a WhatsApp user from one of your WhatsApp numbers, with an assistant (`mode: ai`) or with an agent in the browser (`mode: agent`: the agent's browser rings first, then the user). The user must have allowed your business to call them (409 `permission_required` otherwise) and WhatsApp's call limits per user apply (429 `limit_reached`, with the limits in `details` and when they reset in `details.resets_at`); `biz_opaque_callback_data` goes to WhatsApp with the call as written; the do-not-call list applies as for any call. Needs a live key and WhatsApp calling enabled for the organization. The Idempotency-Key header is required, so a retried request never calls anyone twice. The call is a normal call: follow it with GET /v1/calls/{id} and the call.* webhooks.

Authenticate with a secret API key: `Authorization: Bearer $MOREVOICE_API_KEY`.

Operation ID: `whatsapp_calls_create`.

## Parameters

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `MoreVoice-Version` | `string` | no | The API version to use for this request. Defaults to the version the API key is pinned to. |
| `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

Required, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `mode` | `"ai" \| "agent"` | yes | `ai`: the assistant talks to the user. `agent`: the agent's browser rings first; the user is called once they answer. |
| `agent_id` | `string` | no | mode `agent`: the member who talks, in the browser. Required with mode `agent`. |
| `assistant_id` | `string` | no | mode `ai`: the assistant that talks (default: the number's assistant). |
| `biz_opaque_callback_data` | `string` | no | Your data for this call at WhatsApp (`biz_opaque_callback_data`, at most 512 characters): WhatsApp returns it in the call's own webhooks (status and terminate), so a relay can match them to its records. Sent as written; returned on the call object. |
| `metadata` | `MetadataInput` | no | Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent. |
| `recipient` | `string` | no | The WhatsApp user to call by the business-scoped ID WhatsApp gave you, when they don't share their number. Instead of `to`. |
| `to` | `string` | no | The WhatsApp user to call: their WhatsApp number (country code first, + optional). |
| `whatsapp_number_id` | `string` | no | The business number that calls (one of yours). |
| `whatsapp_phone_number_id` | `string` | no | WhatsApp's ID of the business number that calls (digits), instead of `whatsapp_number_id`. |

Example:

```json
{
  "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "biz_opaque_callback_data": "chat_88:req_4f2a",
  "metadata": {
    "crm_contact_id": "0031x00000AbCdE"
  },
  "mode": "ai",
  "to": "972501234567",
  "whatsapp_number_id": "wan_4Gk2LmN9pQ4rS6tV8wX0yZ"
}
```

## Responses

### 201 Created

Created Returns `WhatsAppCall`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | The call's ID (GET /v1/calls/{id}). |
| `object` | `"whatsapp_call"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `mode` | `"ai" \| "agent"` | — |
| `status` | `"queued" \| "ringing"` | `ringing`: the user's phone rings. `queued`: ringing the agent first (mode `agent`), or WhatsApp has not confirmed the call yet. Follow the call with GET /v1/calls/{id} or the call.* webhooks. |
| `wacid` | `string \| null` | WhatsApp's ID of the call; null until WhatsApp named it. |
| `whatsapp_number_id` | `string` | The business number that calls. |
| `to` | `string \| null` | The user's WhatsApp number in E.164 (null when called by `recipient`). |
| `recipient` | `string \| null` | The user's business-scoped WhatsApp ID (null when called by `to`). |
| `assistant_id` | `string \| null` | `asst_…` ID. |
| `agent_id` | `string \| null` | `usr_…` ID. |
| `metadata` | `Metadata` | Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent. |
| `biz_opaque_callback_data` | `string \| null` | Your data for this call at WhatsApp (`biz_opaque_callback_data`, at most 512 characters): WhatsApp returns it in the call's own webhooks (status and terminate), so a relay can match them to its records. Null when none was sent. |
| `created` | `string` | An ISO-8601 timestamp in UTC. |

Example:

```json
{
  "agent_id": null,
  "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "biz_opaque_callback_data": "chat_88:req_4f2a",
  "created": "2026-11-08T09:14:22.000Z",
  "id": "call_4Gk2LmN9pQ4r",
  "livemode": true,
  "metadata": {
    "crm_contact_id": "0031x00000AbCdE"
  },
  "mode": "ai",
  "object": "whatsapp_call",
  "recipient": null,
  "status": "ringing",
  "to": "+972501234567",
  "wacid": "wacid.HBgLMTIzNDU2Nzg5MDEVAgARGBI",
  "whatsapp_number_id": "wan_4Gk2LmN9pQ4rS6tV8wX0yZ"
}
```

### 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`.

### 403 Forbidden

The key may not do this (a missing scope, a plan limit, or a compliance block). 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`.

### 429 Too Many Requests

Too many requests, or no call capacity right now. Retry after the Retry-After delay. Returns `ErrorEnvelope`.

### 500 Internal Server Error

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

## Code samples

**TypeScript**

```ts
import MoreVoice from "@morevoice/sdk";

const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment

const whatsAppCall = await mv.whatsappCalls.create({
	assistant_id: "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
	biz_opaque_callback_data: "chat_88:req_4f2a",
	metadata: {
		crm_contact_id: "0031x00000AbCdE",
	},
	mode: "ai",
	to: "972501234567",
	whatsapp_number_id: "wan_4Gk2LmN9pQ4rS6tV8wX0yZ",
});
console.log(whatsAppCall);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

whats_app_call = client.whatsapp_calls.create({
    "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
    "biz_opaque_callback_data": "chat_88:req_4f2a",
    "metadata": {
        "crm_contact_id": "0031x00000AbCdE",
    },
    "mode": "ai",
    "to": "972501234567",
    "whatsapp_number_id": "wan_4Gk2LmN9pQ4rS6tV8wX0yZ",
})
print(whats_app_call)
```

**cURL**

```sh
curl -X POST https://api.morevoice.ai/v1/whatsapp_calls \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "biz_opaque_callback_data": "chat_88:req_4f2a",
  "metadata": {
    "crm_contact_id": "0031x00000AbCdE"
  },
  "mode": "ai",
  "to": "972501234567",
  "whatsapp_number_id": "wan_4Gk2LmN9pQ4rS6tV8wX0yZ"
}'
```
