---
title: "Register a WhatsApp Business number"
method: POST
path: "/v1/whatsapp/numbers"
tags: ["WhatsApp"]
---

# Register a WhatsApp Business number

`POST /v1/whatsapp/numbers`

## Request

- Base URL: `https://api.pyai.com`
- URL: `https://api.pyai.com/v1/whatsapp/numbers`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Attach a WhatsApp Business number you already own on Meta's Cloud API to your org so an Omni agent can answer its calls. You bring the WhatsApp Business Account id, the number's `phone_number_id`, and a system-user access token with `whatsapp_business_messaging`; PyAI stores the token encrypted and never returns it. Point your Meta app's `calls` and `messages` webhooks at `https://api.pyai.com/public/whatsapp/webhook`. Calling stays off until you enable it with `POST /v1/whatsapp/numbers/{id}/calling`. Requires the `telephony:manage` scope.

## Request body

- WhatsAppRegisterNumberRequest
  - `waba_id` string, required
  - `phone_number_id` string, required
  - `display_phone_number` string, required: The number in E.164.
  - `access_token` string, required: Meta system-user token with `whatsapp_business_messaging`. Stored encrypted, never returned.
  - `app_id` string, nullable: Meta app that owns the webhook subscription.
  - `agent_id` string, nullable: Optional agent to route inbound calls to.

## Response `201`

Registered

- WhatsAppNumber
  - `object` string
  - `id` string
  - `waba_id` string: WhatsApp Business Account id.
  - `phone_number_id` string: Meta's id for the business number (what the webhook carries).
  - `phone_number` string: E.164.
  - `app_id` string, nullable
  - `agent_id` string, nullable: Agent that answers inbound WhatsApp calls.
  - `calling_enabled` boolean
  - `calling_settings` object: Last calling settings pushed to Meta.
  - `status` 'active' | 'released'
  - `created_at` integer: Unix ms.
  - `updated_at` integer: Unix ms.
  - `released_at` integer, nullable: Unix ms.

## Other responses

- `400`: Invalid request (bad field, unsupported value)
- `401`: Missing or invalid API key (`code: unauthorized`)
- `409`: That phone_number_id is already registered (`code: number_in_use`).
- `503`: WhatsApp calling is not enabled on this deployment (`code: whatsapp_disabled`).

---

[API](https://skmtc.dev/pyai/apis/pyai-api.md) · [All operations](https://skmtc.dev/pyai/apis/pyai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/pyai/apis/pyai-api/revisions/819d8e7c4d09?raw)
