curl --request PUT \
--url https://server.sellagent.ai/api/phone/update/{id} \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"nickName": "Updated Production Number"
}
'import requests
url = "https://server.sellagent.ai/api/phone/update/{id}"
payload = { "nickName": "Updated Production Number" }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({nickName: 'Updated Production Number'})
};
fetch('https://server.sellagent.ai/api/phone/update/{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://server.sellagent.ai/api/phone/update/{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([
'nickName' => 'Updated Production Number'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>"
],
]);
$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://server.sellagent.ai/api/phone/update/{id}"
payload := strings.NewReader("{\n \"nickName\": \"Updated Production Number\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://server.sellagent.ai/api/phone/update/{id}")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"nickName\": \"Updated Production Number\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.sellagent.ai/api/phone/update/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"nickName\": \"Updated Production Number\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "685bb187dc7279fb63ed11d",
"phoneNumber": "+17245868135",
"userId": "6855d390cadc9740fe720a",
"workspaceId": "685846b162e555e53cd3ae",
"terminationUri": "sell-agent.pstn.twilio.com",
"nickName": "production",
"outboundTrunk": "ST_B7t6CbWDG6G",
"inboundTrunk": "ST_2FKEA6i8392",
"createdAt": "2025-06-25T08:21:27.806Z",
"updatedAt": "2025-06-25T08:34:28.172Z",
"__v": 0,
"inboundAgentId": {
"_id": "6855717a08af648abd4a69",
"name": "SellAgent Cold Calling Agent",
"type": "Single Prompt"
},
"outboundAgentId": {
"_id": "6855717a08af648abd4a6964",
"name": "SellAgent Cold Calling Agent",
"type": "Single Prompt"
}
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "Phone not found"
}{
"status": "error",
"message": "An unexpected server error occurred."
}Update Phone
Update agent bound to a purchased phone number
curl --request PUT \
--url https://server.sellagent.ai/api/phone/update/{id} \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"nickName": "Updated Production Number"
}
'import requests
url = "https://server.sellagent.ai/api/phone/update/{id}"
payload = { "nickName": "Updated Production Number" }
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({nickName: 'Updated Production Number'})
};
fetch('https://server.sellagent.ai/api/phone/update/{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://server.sellagent.ai/api/phone/update/{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([
'nickName' => 'Updated Production Number'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>"
],
]);
$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://server.sellagent.ai/api/phone/update/{id}"
payload := strings.NewReader("{\n \"nickName\": \"Updated Production Number\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://server.sellagent.ai/api/phone/update/{id}")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"nickName\": \"Updated Production Number\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.sellagent.ai/api/phone/update/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"nickName\": \"Updated Production Number\"\n}"
response = http.request(request)
puts response.read_body{
"_id": "685bb187dc7279fb63ed11d",
"phoneNumber": "+17245868135",
"userId": "6855d390cadc9740fe720a",
"workspaceId": "685846b162e555e53cd3ae",
"terminationUri": "sell-agent.pstn.twilio.com",
"nickName": "production",
"outboundTrunk": "ST_B7t6CbWDG6G",
"inboundTrunk": "ST_2FKEA6i8392",
"createdAt": "2025-06-25T08:21:27.806Z",
"updatedAt": "2025-06-25T08:34:28.172Z",
"__v": 0,
"inboundAgentId": {
"_id": "6855717a08af648abd4a69",
"name": "SellAgent Cold Calling Agent",
"type": "Single Prompt"
},
"outboundAgentId": {
"_id": "6855717a08af648abd4a6964",
"name": "SellAgent Cold Calling Agent",
"type": "Single Prompt"
}
}{
"status": "error",
"message": "Invalid request format, please check API reference."
}{
"status": "error",
"message": "API key is missing or invalid."
}{
"status": "error",
"message": "Phone not found"
}{
"status": "error",
"message": "An unexpected server error occurred."
}Headers
Your API key for authentication
Must be application/json
application/json Optional workspace ID (defaults to user's current workspace)
Path Parameters
The ID of the phone to update
"+17245868135"
Body
New nickname for the phone number
Response
Phone nickname successfully updated
Unique ID of the phone record
"685bb187dc7279fb63ed11d"
The actual phone number
"+17245868135"
ID of the user who owns the phone
"6855d390cadc9740fe720a"
Workspace associated with this phone number
"685846b162e555e53cd3ae"
SIP termination URI
"sell-agent.pstn.twilio.com"
Nickname for the phone number
"production"
Outbound trunk identifier
"ST_B7t6CbWDG6G"
Inbound trunk identifier
"ST_2FKEA6i8392"
Date and time when the phone record was created
"2025-06-25T08:21:27.806Z"
Date and time when the phone record was last updated
"2025-06-25T08:34:28.172Z"
Document version key
0
Inbound agent details
Show child attributes
Show child attributes
Outbound agent details
Show child attributes
Show child attributes
