Update calling routing for a phone number
Set or clear the connection that inbound WhatsApp calls to a BYON (Bring Your Own Number) phone number are delivered to.
The update is processed asynchronously. A 202 response means the request was accepted, not that the routing changed. Check the result with GET /whatsapp/phone_numbers/{id}/calling_routing, which can return the previous value immediately after an update. An update for a number that is not a WhatsApp Calling number in the account returns 404.
The connection must belong to the same account and must not be a WhatsApp connection. Send connection_id: null to clear the routing; omitting connection_id is rejected. Numbers active on Telnyx are rejected, because they route through their own connection assignment.
Sub-users need update permission on connections, and read permission to check the result with GET.
curl --request PATCH \
--url https://api.telnyx.com/v2/whatsapp/phone_numbers/{id}/calling_routing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "1234567890"
}
'{
"data": {
"record_type": "whatsapp_calling_routing",
"phone_number": "+13125550100",
"connection_id": "1234567890"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The BYON phone number in E.164 format. The leading + is optional.
Body
ID of the connection to deliver inbound WhatsApp calls to: a positive integer up to 9223372036854775807, sent as a decimal string or an integer. Send a string to keep large IDs exact. Non-null values are returned as strings. null clears the routing.
"1234567890"
Response
Update accepted for processing. The body echoes the requested routing; it does not confirm that the routing was applied.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PATCH \
--url https://api.telnyx.com/v2/whatsapp/phone_numbers/{id}/calling_routing \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connection_id": "1234567890"
}
'{
"data": {
"record_type": "whatsapp_calling_routing",
"phone_number": "+13125550100",
"connection_id": "1234567890"
}
}