Numbers

Configure a Number

Assign a voice application or SIP trunk to a phone number.

Control how inbound calls to your number are handled by assigning it to a voice application or a SIP trunk.

Configuration Options

Assign to Application Route inbound calls to a voice application — TryVox fetches VoxML from its answer_url.

Assign to Trunk Route inbound calls to a SIP trunk, so they ring whatever is registered against that trunk.

When a number has both, the application is used. AI agent bindings, configured under AI Agents, take priority over both.

{e164} in the paths below is the number in E.164 format, e.g. +918045671234.

Assign to Application

Endpoint

POST /v1/account/{auth_id}/numbers/{e164}/application

Request Body

FieldTypeRequiredDescription
application_idstringYesID of the voice application

Request Example

curl --request POST \
  --url https://api.tryvox.io/v1/account/$TRYVOX_AUTH_ID/numbers/+918045671234/application \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  --header 'Content-Type: application/json' \
  --data '{
    "application_id": "8f7a4b2e-91c2-4f3d-9a1e-2c4b6d8f0a1c"
  }'

Response

200 OK with the updated number object, now carrying application_id.

A number that already has an application returns 409 ALREADY_ASSIGNED. Unassign it first to switch applications.

Unassign from Application

DELETE /v1/account/{auth_id}/numbers/{e164}/application

200 OK with the updated number object. Returns 409 NOT_ASSIGNED if the number has no application.

Assign to Trunk

Endpoint

POST /v1/account/{auth_id}/numbers/{e164}/assign

Request Body

FieldTypeRequiredDescription
trunk_group_idstringYesID (UUID) of the SIP trunk

Request Example

curl --request POST \
  --url https://api.tryvox.io/v1/account/$TRYVOX_AUTH_ID/numbers/+918045671234/assign \
  -u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
  --header 'Content-Type: application/json' \
  --data '{
    "trunk_group_id": "0b5e7c3a-2f41-4d8e-9a6b-1c2d3e4f5a6b"
  }'

Response

200 OK with the updated number object, now carrying trunk_group_id. Assigning a different trunk replaces the current one; assigning the same trunk again changes nothing.

Unassign from Trunk

DELETE /v1/account/{auth_id}/numbers/{e164}/assign

200 OK with the updated number object. Returns 409 NOT_ASSIGNED if the number has no trunk.

Configuration Notes

  • Assigning a trunk does not remove an application, and assigning an application does not remove a trunk.
  • Changes take effect for the next inbound call.
  • A number with no application, trunk, or AI binding cannot answer inbound calls.
  • Changing a number's configuration requires approved KYC.

Errors

StatusCodeDescription
400VALIDATION_FAILEDMissing application_id, or trunk_group_id is not a UUID
403KYC_REQUIREDThe account's KYC is not approved
403ACCOUNT_MISMATCHThe number belongs to another account
404NOT_FOUNDNumber not found, or the application doesn't exist or belongs to another account
503SERVICE_UNAVAILABLEThe application couldn't be checked; retry
409ALREADY_ASSIGNED / NOT_ASSIGNEDSee each operation above
409NUMBER_NOT_ACTIVEThe number is not active (e.g., a release is pending)
409NUMBER_BLOCKEDThe number is blocked

Next Steps

On this page