Skip to main content
POST
/
api
/
v1
/
organizations
/
telephony-configs
/
{config_id}
/
phone-numbers
Create Phone Number
curl --request POST \
  --url https://app.asisso.com/api/v1/organizations/telephony-configs/{config_id}/phone-numbers \
  --header 'Content-Type: application/json' \
  --data '
{
  "address": "<string>",
  "country_code": "<string>",
  "label": "<string>",
  "inbound_workflow_id": 123,
  "is_active": true,
  "is_default_caller_id": false,
  "extra_metadata": {}
}
'
import requests

url = "https://app.asisso.com/api/v1/organizations/telephony-configs/{config_id}/phone-numbers"

payload = {
"address": "<string>",
"country_code": "<string>",
"label": "<string>",
"inbound_workflow_id": 123,
"is_active": True,
"is_default_caller_id": False,
"extra_metadata": {}
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
address: '<string>',
country_code: '<string>',
label: '<string>',
inbound_workflow_id: 123,
is_active: true,
is_default_caller_id: false,
extra_metadata: {}
})
};

fetch('https://app.asisso.com/api/v1/organizations/telephony-configs/{config_id}/phone-numbers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://app.asisso.com/api/v1/organizations/telephony-configs/{config_id}/phone-numbers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'address' => '<string>',
'country_code' => '<string>',
'label' => '<string>',
'inbound_workflow_id' => 123,
'is_active' => true,
'is_default_caller_id' => false,
'extra_metadata' => [

]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://app.asisso.com/api/v1/organizations/telephony-configs/{config_id}/phone-numbers"

payload := strings.NewReader("{\n \"address\": \"<string>\",\n \"country_code\": \"<string>\",\n \"label\": \"<string>\",\n \"inbound_workflow_id\": 123,\n \"is_active\": true,\n \"is_default_caller_id\": false,\n \"extra_metadata\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://app.asisso.com/api/v1/organizations/telephony-configs/{config_id}/phone-numbers")
.header("Content-Type", "application/json")
.body("{\n \"address\": \"<string>\",\n \"country_code\": \"<string>\",\n \"label\": \"<string>\",\n \"inbound_workflow_id\": 123,\n \"is_active\": true,\n \"is_default_caller_id\": false,\n \"extra_metadata\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://app.asisso.com/api/v1/organizations/telephony-configs/{config_id}/phone-numbers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"<string>\",\n \"country_code\": \"<string>\",\n \"label\": \"<string>\",\n \"inbound_workflow_id\": 123,\n \"is_active\": true,\n \"is_default_caller_id\": false,\n \"extra_metadata\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "telephony_configuration_id": 123,
  "address": "<string>",
  "address_normalized": "<string>",
  "address_type": "<string>",
  "is_active": true,
  "is_default_caller_id": true,
  "extra_metadata": {},
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "country_code": "<string>",
  "label": "<string>",
  "inbound_workflow_id": 123,
  "inbound_workflow_name": "<string>",
  "provider_sync": {
    "ok": true,
    "message": "<string>"
  }
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}
Set inbound_workflow_id to bind incoming calls on this number to a specific agent — Asisso will register the inbound webhook with the provider and the response will include a provider_sync block reporting the result. Omit it to add the number for outbound use only. The (provider, account_id, address) tuple must be globally unique across all Asisso organizations, since inbound dispatch keys on it. Attempting to add a number that another organization already owns returns 409.

Headers

authorization
string | null
X-API-Key
string | null

Path Parameters

config_id
integer
required

Body

application/json

Create a new phone number under a telephony configuration.

address_normalized and address_type are computed server-side from address (and country_code if PSTN). address itself is stored verbatim for display.

address
string
required
Required string length: 1 - 255
country_code
string | null
Required string length: 2
label
string | null
Maximum string length: 64
inbound_workflow_id
integer | null
is_active
boolean
default:true
is_default_caller_id
boolean
default:false
extra_metadata
Extra Metadata · object

Response

Successful Response

id
integer
required
telephony_configuration_id
integer
required
address
string
required
address_normalized
string
required
address_type
string
required
is_active
boolean
required
is_default_caller_id
boolean
required
extra_metadata
Extra Metadata · object
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
country_code
string | null
label
string | null
inbound_workflow_id
integer | null
inbound_workflow_name
string | null
provider_sync
ProviderSyncStatus · object | null

Result of pushing a phone-number change to the upstream provider.

Returned alongside create/update responses when the route attempted to sync inbound webhook configuration. ok=False is a warning, not a fatal error — the DB write succeeded.