Sub-Accounts
Assign DID to Sub-Account
Assign a parent-pool DID to one of your sub-accounts so it can place and receive calls on that number.
POST
/
api
/
v1
/
account
/
{auth_id}
/
numbers
/
{e164}
/
assign-subaccount
Assign DID to a sub-account
curl --request POST \
--url https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{e164}/assign-subaccount \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"sub_account_id": "SA_XXXXXX"
}
'import requests
url = "https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{e164}/assign-subaccount"
payload = { "sub_account_id": "SA_XXXXXX" }
headers = {
"X-Auth-ID": "<api-key>",
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sub_account_id: 'SA_XXXXXX'})
};
fetch('https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{e164}/assign-subaccount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"api_id": "<string>",
"error": "<string>",
"message": "<string>"
}Assigns a DID from the parent account’s number pool to a sub-account. Once assigned, the sub-account can place and receive calls on the number.
Authenticate with
X-Auth-ID / X-Auth-Token (the parent account’s credentials).Path casing: this endpoint uses lowercase
/account/ and the singular assign-subaccount segment - unlike the capital-A /Account/ used by inventory, purchase, list, trunk-assign, and release. Copy the path verbatim or you will get a 404.URL-encode the number. Replace the
+ in the E.164 path segment with %2B (e.g. %2B919876543210).Path parameters
auth_id- the parent (MA_) account’s Auth ID.e164- the DID in E.164 format, URL-encoded (%2Bfor+). The number must be owned by the parent account’s pool.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
sub_account_id | string | Yes | The sub-account (SA_...) to receive the DID. |
cURL Request
curl -X POST \
"https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/%2B919876543210/assign-subaccount" \
-H "X-Auth-ID: {auth_id}" \
-H "X-Auth-Token: {auth_token}" \
-H "Content-Type: application/json" \
-d '{ "sub_account_id": "SA_XXXXXX" }'
Response
A successful assignment returns200 or 204 with no body.
Error Response (404 Not Found): the number is not in the parent pool, or the sub-account does not exist:
Error Response - 404 Not Found
{
"error": "not_found",
"message": "number or sub-account not found"
}
Moving the number back to the parent pool is subject to a 15-day cool-off - see Unassign DID.
Authorizations
Your Vobiz account Auth ID
Your Vobiz account Auth Token
Path Parameters
Your account Auth ID
Example:
"MA_XXXXXX"
The number in E.164, URL-encoded (use %2B instead of +).
Example:
"%2B919876543210"
Body
application/json
Example:
"SA_XXXXXX"
Response
DID assigned to the sub-account
Was this page helpful?
⌘I
Assign DID to a sub-account
curl --request POST \
--url https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{e164}/assign-subaccount \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"sub_account_id": "SA_XXXXXX"
}
'import requests
url = "https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{e164}/assign-subaccount"
payload = { "sub_account_id": "SA_XXXXXX" }
headers = {
"X-Auth-ID": "<api-key>",
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({sub_account_id: 'SA_XXXXXX'})
};
fetch('https://api.vobiz.ai/api/v1/account/{auth_id}/numbers/{e164}/assign-subaccount', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"api_id": "<string>",
"error": "<string>",
"message": "<string>"
}