Register External Number
curl --request POST \
--url https://api.trillet.ai/v1/api/twilio/register-external-number \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"phoneNumber": "<string>",
"provider": "<string>",
"credentials": {
"accountSid": "<string>",
"authToken": "<string>"
}
}
'import requests
url = "https://api.trillet.ai/v1/api/twilio/register-external-number"
payload = {
"phoneNumber": "<string>",
"provider": "<string>",
"credentials": {
"accountSid": "<string>",
"authToken": "<string>"
}
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phoneNumber: '<string>',
provider: '<string>',
credentials: {accountSid: '<string>', authToken: '<string>'}
})
};
fetch('https://api.trillet.ai/v1/api/twilio/register-external-number', 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.trillet.ai/v1/api/twilio/register-external-number",
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>',
'provider' => '<string>',
'credentials' => [
'accountSid' => '<string>',
'authToken' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.trillet.ai/v1/api/twilio/register-external-number"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"provider\": \"<string>\",\n \"credentials\": {\n \"accountSid\": \"<string>\",\n \"authToken\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-api-key", "<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.trillet.ai/v1/api/twilio/register-external-number")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"provider\": \"<string>\",\n \"credentials\": {\n \"accountSid\": \"<string>\",\n \"authToken\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/twilio/register-external-number")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"provider\": \"<string>\",\n \"credentials\": {\n \"accountSid\": \"<string>\",\n \"authToken\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Phone number registered successfully"
}
Telephony
Bring Your Own Number
Register your own external phone number with Twilio to use within your workspace.
POST
/
v1
/
api
/
twilio
/
register-external-number
Register External Number
curl --request POST \
--url https://api.trillet.ai/v1/api/twilio/register-external-number \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-workspace-id: <x-workspace-id>' \
--data '
{
"phoneNumber": "<string>",
"provider": "<string>",
"credentials": {
"accountSid": "<string>",
"authToken": "<string>"
}
}
'import requests
url = "https://api.trillet.ai/v1/api/twilio/register-external-number"
payload = {
"phoneNumber": "<string>",
"provider": "<string>",
"credentials": {
"accountSid": "<string>",
"authToken": "<string>"
}
}
headers = {
"x-workspace-id": "<x-workspace-id>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-workspace-id': '<x-workspace-id>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phoneNumber: '<string>',
provider: '<string>',
credentials: {accountSid: '<string>', authToken: '<string>'}
})
};
fetch('https://api.trillet.ai/v1/api/twilio/register-external-number', 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.trillet.ai/v1/api/twilio/register-external-number",
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>',
'provider' => '<string>',
'credentials' => [
'accountSid' => '<string>',
'authToken' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-workspace-id: <x-workspace-id>"
],
]);
$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.trillet.ai/v1/api/twilio/register-external-number"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"provider\": \"<string>\",\n \"credentials\": {\n \"accountSid\": \"<string>\",\n \"authToken\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-workspace-id", "<x-workspace-id>")
req.Header.Add("x-api-key", "<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.trillet.ai/v1/api/twilio/register-external-number")
.header("x-workspace-id", "<x-workspace-id>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"provider\": \"<string>\",\n \"credentials\": {\n \"accountSid\": \"<string>\",\n \"authToken\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trillet.ai/v1/api/twilio/register-external-number")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-workspace-id"] = '<x-workspace-id>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"provider\": \"<string>\",\n \"credentials\": {\n \"accountSid\": \"<string>\",\n \"authToken\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Phone number registered successfully"
}
Headers
string
required
Workspace identifier for the API.
Request Body
string
required
The external phone number to register, in E.164 format (e.g.,
+11234567890).string
required
The provider for the phone number. Currently, only
"twilio" is supported.object
required
Response Fields
string
The status of the request, indicating success or failure.
string
A message providing feedback about the registration process.
Example Response
{
"status": "success",
"message": "Phone number registered successfully"
}
⌘I
