curl --request POST \
--url https://api.telli.com/v1/phone-numbers/import \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "<string>",
"terminationUri": "<string>",
"authUsername": "<string>",
"authPassword": "<string>",
"transport": "TCP",
"inOutboundPool": true
}
'import requests
url = "https://api.telli.com/v1/phone-numbers/import"
payload = {
"phoneNumber": "<string>",
"terminationUri": "<string>",
"authUsername": "<string>",
"authPassword": "<string>",
"transport": "TCP",
"inOutboundPool": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '<string>',
terminationUri: '<string>',
authUsername: '<string>',
authPassword: '<string>',
transport: 'TCP',
inOutboundPool: true
})
};
fetch('https://api.telli.com/v1/phone-numbers/import', 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://api.telli.com/v1/phone-numbers/import",
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([
'phoneNumber' => '<string>',
'terminationUri' => '<string>',
'authUsername' => '<string>',
'authPassword' => '<string>',
'transport' => 'TCP',
'inOutboundPool' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.telli.com/v1/phone-numbers/import"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"terminationUri\": \"<string>\",\n \"authUsername\": \"<string>\",\n \"authPassword\": \"<string>\",\n \"transport\": \"TCP\",\n \"inOutboundPool\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.telli.com/v1/phone-numbers/import")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"terminationUri\": \"<string>\",\n \"authUsername\": \"<string>\",\n \"authPassword\": \"<string>\",\n \"transport\": \"TCP\",\n \"inOutboundPool\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telli.com/v1/phone-numbers/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"terminationUri\": \"<string>\",\n \"authUsername\": \"<string>\",\n \"authPassword\": \"<string>\",\n \"transport\": \"TCP\",\n \"inOutboundPool\": true\n}"
response = http.request(request)
puts response.read_body{
"type": "PhoneNumber",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phoneNumber": "<string>",
"inOutboundPool": true,
"phoneNumberType": "local",
"createdAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>"
}Import Phone Number
Imports a phone number from your own SIP trunk provider. This allows you to use existing phone numbers with telli by configuring custom SIP termination settings.
curl --request POST \
--url https://api.telli.com/v1/phone-numbers/import \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "<string>",
"terminationUri": "<string>",
"authUsername": "<string>",
"authPassword": "<string>",
"transport": "TCP",
"inOutboundPool": true
}
'import requests
url = "https://api.telli.com/v1/phone-numbers/import"
payload = {
"phoneNumber": "<string>",
"terminationUri": "<string>",
"authUsername": "<string>",
"authPassword": "<string>",
"transport": "TCP",
"inOutboundPool": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '<string>',
terminationUri: '<string>',
authUsername: '<string>',
authPassword: '<string>',
transport: 'TCP',
inOutboundPool: true
})
};
fetch('https://api.telli.com/v1/phone-numbers/import', 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://api.telli.com/v1/phone-numbers/import",
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([
'phoneNumber' => '<string>',
'terminationUri' => '<string>',
'authUsername' => '<string>',
'authPassword' => '<string>',
'transport' => 'TCP',
'inOutboundPool' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://api.telli.com/v1/phone-numbers/import"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"terminationUri\": \"<string>\",\n \"authUsername\": \"<string>\",\n \"authPassword\": \"<string>\",\n \"transport\": \"TCP\",\n \"inOutboundPool\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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://api.telli.com/v1/phone-numbers/import")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"terminationUri\": \"<string>\",\n \"authUsername\": \"<string>\",\n \"authPassword\": \"<string>\",\n \"transport\": \"TCP\",\n \"inOutboundPool\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.telli.com/v1/phone-numbers/import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"terminationUri\": \"<string>\",\n \"authUsername\": \"<string>\",\n \"authPassword\": \"<string>\",\n \"transport\": \"TCP\",\n \"inOutboundPool\": true\n}"
response = http.request(request)
puts response.read_body{
"type": "PhoneNumber",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phoneNumber": "<string>",
"inOutboundPool": true,
"phoneNumberType": "local",
"createdAt": "2023-11-07T05:31:56Z"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
API key must be provided as: Bearer <api_key>
Body
Phone number in E.164 format (e.g. +4917642048466)
SIP termination URI for routing calls
Username for SIP authentication
Password for SIP authentication
SIP transport protocol for the imported number. Defaults to TCP.
TCP, UDP, TLS Whether to include this phone number in the outbound call pool. Defaults to true.
Response
Phone number imported successfully
Resource type identifier
PhoneNumber Unique identifier for the phone number
Phone number in E.164 format (e.g. +4917642048466)
Whether this phone number is available for outbound calls
Type of phone number (local or mobile)
local, mobile, null When the phone number was added to the account
Was this page helpful?