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}/applicationRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| application_id | string | Yes | ID 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}/application200 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}/assignRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| trunk_group_id | string | Yes | ID (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}/assign200 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
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_FAILED | Missing application_id, or trunk_group_id is not a UUID |
| 403 | KYC_REQUIRED | The account's KYC is not approved |
| 403 | ACCOUNT_MISMATCH | The number belongs to another account |
| 404 | NOT_FOUND | Number not found, or the application doesn't exist or belongs to another account |
| 503 | SERVICE_UNAVAILABLE | The application couldn't be checked; retry |
| 409 | ALREADY_ASSIGNED / NOT_ASSIGNED | See each operation above |
| 409 | NUMBER_NOT_ACTIVE | The number is not active (e.g., a release is pending) |
| 409 | NUMBER_BLOCKED | The number is blocked |
Next Steps
- Sub-account assignment to associate a parent-owned number with a child record
- SIP Trunking to route calls to your own infrastructure
- Voice Applications for programmable call control
- List Your Numbers to view all configured numbers