WhatsApp

Register a WhatsApp Business number

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.

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

Request body

waba_idstring required
phone_number_idstring required
display_phone_numberstring required

The number in E.164.

access_tokenstring required

Meta system-user token with whatsapp_business_messaging. Stored encrypted, never returned.

app_idstring nullable

Meta app that owns the webhook subscription.

agent_idstring nullable

Optional agent to route inbound calls to.

Example request

{
  "display_phone_number": "+14155550123"
}

Response

Registered

objectstring
idstring
waba_idstring

WhatsApp Business Account id.

phone_number_idstring

Meta's id for the business number (what the webhook carries).

phone_numberstring

E.164.

app_idstring nullable
agent_idstring nullable

Agent that answers inbound WhatsApp calls.

calling_enabledboolean
calling_settingsobject

Last calling settings pushed to Meta.

status'active' | 'released'
created_atinteger

Unix ms.

updated_atinteger

Unix ms.

released_atinteger nullable

Unix ms.

Example response

{
  "object": "whatsapp.number",
  "id": "wan_...",
  "phone_number": "+14155550123"
}

Changes

No recorded changes to this operation across all 1 revision of this API.