Skip to main content
POST
/
api
/
v1
/
phone-numbers
/
{number}
/
subscribe
/
cURL
curl --request POST \
  --url https://alpha-plagiocephalic-darrell.ngrok-free.dev/api/v1/phone-numbers/{number}/subscribe/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "number": "<string>",
  "whatsappPhoneNumberId": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "number": "<string>",
  "whatsappPhoneNumberId": "<string>",
  "whatsappBusinessAccount": "<string>",
  "activeAgent": "<string>",
  "defaultRouting": "<string>",
  "defaultWebhook": "<string>",
  "isSandbox": true
}
Sets the number’s default routing to webhook and assigns defaultWebhook to the given webhook. Any agent previously connected to the number is dropped — call POST /phone-numbers/{number}/connect-agent/ to put one back. When applyToExisting is true, every existing conversation on this number is updated so the new routing takes effect for in-flight chats: activeAgent is cleared and any open session is dropped. Phone-number routing changes do not fire subscription.activated / subscription.revoked webhook events — those are reserved for the per-conversation subscribe / unsubscribe endpoints.
Webhooks themselves must be created in the dashboard. There is no API for webhook creation.
Sandbox numbers (shared system numbers with no WhatsApp Business Account) scope the change to the requesting user’s own conversation; the shared defaults are not touched and applyToExisting is ignored.

Authorizations

X-API-Key
string
header
required

API key authentication. Pass your API key in the X-API-Key header.

Path Parameters

number
string
required

Body

application/json

Serializer for WhatsappNumber model.

number
string
required
Maximum string length: 15
whatsappPhoneNumberId
string
required

Response

200 - application/json

Serializer for WhatsappNumber model.

id
string<uuid>
required
read-only
number
string
required
Maximum string length: 15
whatsappPhoneNumberId
string
required
whatsappBusinessAccount
string
required
read-only
activeAgent
string
required
read-only
defaultRouting
string
required
read-only
defaultWebhook
string
required
read-only
isSandbox
boolean
required
read-only