curl --request POST \
--url https://{host}/api/v1/dids \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"e164": "+61300009999",
"destination_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_value": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
e164: '+61300009999',
destination_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
destination_value: '<string>',
organisation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{host}/api/v1/dids', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/api/v1/dids"
payload = {
"e164": "+61300009999",
"destination_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_value": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"destination_type": "extension",
"e164": "+61300000001",
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_value": "<string>",
"monthly_rental": "12.5000",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trunk_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Assign a number
Assigns a phone number to an organisation and the destination it rings to (an extension, queue, IVR flow, process, or an external number). The number is normalised to E.164 in the organisation’s default region or refused; a destination_id is checked against the organisation so a number cannot be pointed at another tenant’s resource. Requires routing:write. 409 if the number already belongs to an organisation.
curl --request POST \
--url https://{host}/api/v1/dids \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"e164": "+61300009999",
"destination_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_value": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
e164: '+61300009999',
destination_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
destination_value: '<string>',
organisation_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{host}/api/v1/dids', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/api/v1/dids"
payload = {
"e164": "+61300009999",
"destination_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_value": "<string>",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"destination_type": "extension",
"e164": "+61300000001",
"enabled": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"organisation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destination_value": "<string>",
"monthly_rental": "12.5000",
"team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"trunk_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Authorizations
Every request sends Authorization: Bearer <token>. The token is either a panel session (a JWT from /auth/login, 12 hours) or an API key ft_<id>_<secret>. An API key is accepted only from an address on its IP allowlist (403 ip_not_allowed otherwise; 403 ip_allowlist_required for an old key that has none), is limited to its rate per minute (429 rate_limited with Retry-After; X-RateLimit-Limit/Remaining/Reset on every response), and at most 60 call placements a minute.
Body
Where the number's calls go: extension (a phone), queue, flow (an IVR), process, conference (a room), external (forwarded to another number), client_trunk (a client's own PBX; only where that module is on) or recorder.
extension, queue, external, flow, process, recorder, conference, client_trunk International with a leading + (or 00), or national in the organisation's default_region. Stored and returned in E.164; anything that is not a possible international number, or a valid national one, is refused with 400.
"+61300009999"
The id of the extension, queue, IVR flow, process, room or client trunk the number goes to. Must belong to the number's organisation. Not used for external.
For external: the number to forward to, normalised to E.164. For extension: the extension number, as an alternative to destination_id.
The organisation the number belongs to. May be left out by a caller with exactly one organisation.
The team the number belongs to, if any; a team supervisor sees only their teams' numbers.
Response
Created
Where the number's calls go: extension (a phone), queue, flow (an IVR), process, conference (a room), external (forwarded to another number), client_trunk (a client's own PBX; only where that module is on) or recorder.
extension, queue, external, flow, process, recorder, conference, client_trunk The number, in E.164 form with the plus.
"+61300000001"
Whether the number is in service. A disabled number's calls are refused.
The number's id.
The organisation the number belongs to. May be left out by a caller with exactly one organisation.
The id of the extension, queue, IVR flow, process, room or client trunk the number goes to. Must belong to the number's organisation. Not used for external.
For external: the number to forward to, normalised to E.164. For extension: the extension number, as an alternative to destination_id.
Exact decimal amount as a string. Never a JSON number: rates are fractions of a cent and binary floating point cannot represent them exactly.
"12.5000"
The team the number belongs to, if any; a team supervisor sees only their teams' numbers.
The trunk this number arrives on, when it is pinned to one.