Update Phone Number
curl --request PUT \
--url https://api.rapidcall.ai/api/phone-numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"inboundAgentId": "<string>",
"outboundAgentId": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>",
"allowedInboundCountries": [
"<string>"
],
"allowedOutboundCountries": [
"<string>"
]
}
'import requests
url = "https://api.rapidcall.ai/api/phone-numbers/{id}"
payload = {
"label": "<string>",
"inboundAgentId": "<string>",
"outboundAgentId": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>",
"allowedInboundCountries": ["<string>"],
"allowedOutboundCountries": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
inboundAgentId: '<string>',
outboundAgentId: '<string>',
sipTerminationUri: '<string>',
sipUsername: '<string>',
sipPassword: '<string>',
sipOutboundTransport: '<string>',
allowedInboundCountries: ['<string>'],
allowedOutboundCountries: ['<string>']
})
};
fetch('https://api.rapidcall.ai/api/phone-numbers/{id}', 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.rapidcall.ai/api/phone-numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'inboundAgentId' => '<string>',
'outboundAgentId' => '<string>',
'sipTerminationUri' => '<string>',
'sipUsername' => '<string>',
'sipPassword' => '<string>',
'sipOutboundTransport' => '<string>',
'allowedInboundCountries' => [
'<string>'
],
'allowedOutboundCountries' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.rapidcall.ai/api/phone-numbers/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"inboundAgentId\": \"<string>\",\n \"outboundAgentId\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\",\n \"allowedInboundCountries\": [\n \"<string>\"\n ],\n \"allowedOutboundCountries\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.rapidcall.ai/api/phone-numbers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"inboundAgentId\": \"<string>\",\n \"outboundAgentId\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\",\n \"allowedInboundCountries\": [\n \"<string>\"\n ],\n \"allowedOutboundCountries\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rapidcall.ai/api/phone-numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"inboundAgentId\": \"<string>\",\n \"outboundAgentId\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\",\n \"allowedInboundCountries\": [\n \"<string>\"\n ],\n \"allowedOutboundCountries\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyPhone Numbers
Update Phone Number
Update a phone number’s agent assignment and settings
PUT
/
api
/
phone-numbers
/
{id}
Update Phone Number
curl --request PUT \
--url https://api.rapidcall.ai/api/phone-numbers/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"inboundAgentId": "<string>",
"outboundAgentId": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>",
"allowedInboundCountries": [
"<string>"
],
"allowedOutboundCountries": [
"<string>"
]
}
'import requests
url = "https://api.rapidcall.ai/api/phone-numbers/{id}"
payload = {
"label": "<string>",
"inboundAgentId": "<string>",
"outboundAgentId": "<string>",
"sipTerminationUri": "<string>",
"sipUsername": "<string>",
"sipPassword": "<string>",
"sipOutboundTransport": "<string>",
"allowedInboundCountries": ["<string>"],
"allowedOutboundCountries": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
inboundAgentId: '<string>',
outboundAgentId: '<string>',
sipTerminationUri: '<string>',
sipUsername: '<string>',
sipPassword: '<string>',
sipOutboundTransport: '<string>',
allowedInboundCountries: ['<string>'],
allowedOutboundCountries: ['<string>']
})
};
fetch('https://api.rapidcall.ai/api/phone-numbers/{id}', 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.rapidcall.ai/api/phone-numbers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'label' => '<string>',
'inboundAgentId' => '<string>',
'outboundAgentId' => '<string>',
'sipTerminationUri' => '<string>',
'sipUsername' => '<string>',
'sipPassword' => '<string>',
'sipOutboundTransport' => '<string>',
'allowedInboundCountries' => [
'<string>'
],
'allowedOutboundCountries' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.rapidcall.ai/api/phone-numbers/{id}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"inboundAgentId\": \"<string>\",\n \"outboundAgentId\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\",\n \"allowedInboundCountries\": [\n \"<string>\"\n ],\n \"allowedOutboundCountries\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://api.rapidcall.ai/api/phone-numbers/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"inboundAgentId\": \"<string>\",\n \"outboundAgentId\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\",\n \"allowedInboundCountries\": [\n \"<string>\"\n ],\n \"allowedOutboundCountries\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rapidcall.ai/api/phone-numbers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"inboundAgentId\": \"<string>\",\n \"outboundAgentId\": \"<string>\",\n \"sipTerminationUri\": \"<string>\",\n \"sipUsername\": \"<string>\",\n \"sipPassword\": \"<string>\",\n \"sipOutboundTransport\": \"<string>\",\n \"allowedInboundCountries\": [\n \"<string>\"\n ],\n \"allowedOutboundCountries\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodystring
required
The phone number ID. Example:
pn_abc123string
Display name for the phone number.
string
Agent ID to handle inbound calls. Set to
null to unassign.string
Agent ID to handle outbound calls. Set to
null to unassign.string
SIP trunk termination URI.
string
SIP authentication username.
string
SIP authentication password.
string
SIP transport protocol:
"tcp", "udp", or "tls".string[]
Countries allowed for inbound calls.
string[]
Countries allowed for outbound calls.
Request
curl -X PUT https://api.rapidcall.ai/api/phone-numbers/pn_abc123 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"inboundAgentId": "agent_xyz",
"label": "Sales Line"
}'
Response
{
"phoneNumber": {
"id": "pn_abc123",
"workspaceId": "ws_xyz",
"e164": "+15551234567",
"label": "Sales Line",
"provider": "twilio",
"status": "active",
"inboundAgentId": "agent_xyz",
"outboundAgentId": null,
"source": "purchased",
"createdAt": "2025-01-10T09:00:00Z",
"updatedAt": "2025-01-15T15:00:00Z"
}
}
