# Update a WhatsApp number

`PATCH https://api.morevoice.ai/v1/whatsapp_numbers/{id}`

Changes the label, where calls go, the recording mode, the spoken notice (`disclosure_text`), the callback permission setting, the metadata (keys merge; an empty string removes a key) or the status (`disabled` refuses the number's calls and keeps its settings), or sets a new access token (rotation: the old one is not kept, and the token status goes back to `unverified`). Fields you leave out stay as they are.

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

Operation ID: `whatsapp_numbers_update`.

## Parameters

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | A whatsapp number ID (`wan_…`). |

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

## Request body

Optional, `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `access_token` | `string` | no | A new access token (rotation): replaces the stored one, which is not kept. Write-only. |
| `assistant_id` | `string \| null` | no | `asst_…` ID. |
| `callback_permission` | `"disabled" \| "enabled"` | no | WhatsApp's callback permission setting of the number (`callback_permission_status`): `enabled` when a user who calls the number grants your business a call permission (WhatsApp: 7 days), so a missed call can be called back without a permission request. Set it as the number is set at WhatsApp: the platform doesn't change WhatsApp's settings. Business-initiated calls refused for a missing permission say it in `details.permission.callback_permission`. |
| `disclosure_text` | `string \| null` | no | The notice the AI speaks first on this number's calls (that the caller talks to an AI, and that the call is recorded when it is), in place of the default notice. At most 500 characters, spoken as written: include the recording sentence when the calls are recorded. Empty or null: the default notice. Send null or an empty string to go back to the default. |
| `flow_id` | `string \| null` | no | `flow_…` ID. |
| `inbound_route_id` | `string \| null` | no | `rte_…` ID. |
| `label` | `string` | no | A name for the number. |
| `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. |
| `recording` | `"inherit" \| "on" \| "off"` | no | — |
| `status` | `"active" \| "disabled"` | no | `disabled` refuses the number's calls (its settings stay); `active` takes them again. |

Example:

```json
{
  "flow_id": "flow_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "recording": "on"
}
```

## Responses

### 200 OK

OK Returns `WhatsAppNumber`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string` | The WhatsApp number's ID. |
| `object` | `"whatsapp_number"` | — |
| `livemode` | `boolean` | `true` in live mode, `false` in test mode. |
| `whatsapp_phone_number_id` | `string` | WhatsApp's ID of the business phone number (digits): calls to it come here. One organization per number. |
| `waba_id` | `string` | The WhatsApp Business Account that holds the number (digits). |
| `e164` | `string` | The number in E.164. |
| `label` | `string` | Your name for the number (may be empty). |
| `status` | `"active" \| "disabled"` | `active`: calls to the number are taken. `disabled`: they are refused; the number keeps its settings. |
| `assistant_id` | `string \| null` | `asst_…` ID. |
| `flow_id` | `string \| null` | `flow_…` ID. |
| `inbound_route_id` | `string \| null` | `rte_…` ID. |
| `recording` | `"inherit" \| "on" \| "off"` | `inherit`: the target's own recording setting. `on` / `off`: this number decides. |
| `token` | `object` | The access token, as far as it shows: never the token itself. |
| `token.last4` | `string` | The access token's last 4 characters. |
| `token.fingerprint` | `string` | The first 16 hex digits of the token's SHA-256: compare it with your own copy's. |
| `token.status` | `"unverified" \| "ok" \| "invalid"` | `unverified`: not used yet since it was set. `ok`: WhatsApp accepted it. `invalid`: WhatsApp refused it (set a new one with PATCH). |
| `token.rotated_at` | `string \| null` | When the token was last set. |
| `token.checked_at` | `string \| null` | When WhatsApp last accepted or refused it. |
| `calling` | `object` | The number's calling settings at WhatsApp. |
| `calling.status` | `"unknown" \| "enabled" \| "disabled"` | Calling on the number at WhatsApp, as last read: `unknown` until then. |
| `calling.settings` | `object \| null` | The number's calling settings as last read from WhatsApp (hours, icon visibility, callback permission), or null. |
| `calling.synced_at` | `string \| null` | When they were read. |
| `disclosure_text` | `string \| null` | The notice the AI speaks first on this number's calls (that the caller talks to an AI, and that the call is recorded when it is), in place of the default notice. At most 500 characters, spoken as written: include the recording sentence when the calls are recorded. Empty or null: the default notice. Null: the default notice. |
| `callback_permission` | `"disabled" \| "enabled"` | WhatsApp's callback permission setting of the number (`callback_permission_status`): `enabled` when a user who calls the number grants your business a call permission (WhatsApp: 7 days), so a missed call can be called back without a permission request. Set it as the number is set at WhatsApp: the platform doesn't change WhatsApp's settings. Business-initiated calls refused for a missing permission say it in `details.permission.callback_permission`. |
| `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. |
| `disabled_at` | `string \| null` | When the number was disabled, or null. |
| `created` | `string` | An ISO-8601 timestamp in UTC. |
| `updated` | `string` | An ISO-8601 timestamp in UTC. |

Example:

```json
{
  "assistant_id": "asst_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "callback_permission": "enabled",
  "calling": {
    "settings": {
      "call_icon_visibility": "DEFAULT"
    },
    "status": "enabled",
    "synced_at": "2026-11-08T09:20:01.000Z"
  },
  "created": "2026-11-08T09:14:22.000Z",
  "disabled_at": null,
  "disclosure_text": "שלום, כאן נציג AI של המרפאה, והשיחה מוקלטת.",
  "e164": "+97235550100",
  "flow_id": null,
  "id": "wan_4Gk2LmN9pQ4rS6tV8wX0yZ",
  "inbound_route_id": null,
  "label": "Support line",
  "livemode": true,
  "metadata": {
    "workspace_id": "ws_12"
  },
  "object": "whatsapp_number",
  "recording": "inherit",
  "status": "active",
  "token": {
    "checked_at": "2026-11-08T09:20:01.000Z",
    "fingerprint": "3f2a9c41d07b8e65",
    "last4": "oken",
    "rotated_at": "2026-11-08T09:14:22.000Z",
    "status": "ok"
  },
  "updated": "2026-11-08T09:14:22.000Z",
  "waba_id": "102290129340398",
  "whatsapp_phone_number_id": "106540352242922"
}
```

### 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 whatsAppNumber = await mv.whatsappNumbers.update("wan_7Hk2Lm9Qp", {
	flow_id: "flow_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
	recording: "on",
});
console.log(whatsAppNumber);
```

**Python**

```python
from morevoice import MoreVoice

client = MoreVoice()  # MOREVOICE_API_KEY from the environment

whats_app_number = client.whatsapp_numbers.update("wan_7Hk2Lm9Qp", {
    "flow_id": "flow_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
    "recording": "on",
})
print(whats_app_number)
```

**cURL**

```sh
curl -X PATCH https://api.morevoice.ai/v1/whatsapp_numbers/wan_7Hk2Lm9Qp \
  -H "Authorization: Bearer $MOREVOICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "flow_id": "flow_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8",
  "recording": "on"
}'
```
