Assign a phone number to a specific SIP trunk. Once assigned, all
inbound calls to that phone number will be routed through the
designated trunk. The phone number must be URL-encoded; use %2B
instead of + (e.g., %2B912271264217).
curl --request POST \
--url https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{phone_number}/assign \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"trunk_group_id": "e3e55a78-1234-5678-90ab-cdef12345678"
}
'{
"api_id": "<string>",
"error": "<string>",
"message": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt
Use this file to discover all available pages before exploring further.
POST https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{phone_number}/assign
X-Auth-ID - Your account Auth IDX-Auth-Token - Your account Auth TokenContent-Type: application/json%2B instead of the + symbol. For example: %2B912271264217 (not +912271264217). Failure to encode properly may result in a 404 error.| Field | Type | Required | Description |
|---|---|---|---|
auth_id | string | Yes | Your unique Vobiz account identifier (e.g., MA_BN2MZ1VV). Must match your X-Auth-ID header. |
PHONE_NUMBER | string | Yes | Phone number to assign, URL-encoded. Use %2B instead of + (e.g., %2B912271264217). |
| Field | Type | Required | Description |
|---|---|---|---|
trunk_group_id | string (UUID) | Yes | UUID of the trunk to assign this phone number to (e.g., e3e55a78-1234-5678-90ab-cdef12345678). |
{
"trunk_group_id": "aabbccdd-1234-5678-90ab-cdef12345678"
}
curl -X POST "https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/%2B1234567890/assign" \
-H "X-Auth-ID: {auth_id}" \
-H "X-Auth-Token: {auth_token}" \
-H "Content-Type: application/json" \
-d '{
"trunk_group_id": "{trunk_id}"
}'
200 OK status with a confirmation payload containing the assigned number and trunk identifier.
{
"message": "Number assigned to trunk",
"number": "+919876543210",
"trunk_id": "aabbccdd-1234-5678-90ab-cdef12345678"
}
{
"error": "Number not found",
"message": "The phone number could not be found. Ensure it is URL-encoded correctly."
}
{
"error": "invalid request",
"message": "This number is already assigned to a trunk."
}
200 OK response with the assigned number and trunk_id%2B instead of + in the phone numberYour Vobiz account Auth ID
Your Vobiz account Auth Token
Your account Auth ID
"MA_XXXXXX"
The phone number to assign, URL-encoded (use %2B instead of +).
"%2B912271264217"
The UUID of the trunk to assign this number to.
"e3e55a78-1234-5678-90ab-cdef12345678"
Number assigned to trunk
Was this page helpful?
curl --request POST \
--url https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{phone_number}/assign \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"trunk_group_id": "e3e55a78-1234-5678-90ab-cdef12345678"
}
'{
"api_id": "<string>",
"error": "<string>",
"message": "<string>"
}