Update phone number
curl --request PATCH \
--url https://api.callrounded.com/v1/phone-numbers/{phone_number_id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirect": false,
"redirect_phone_number": "<string>"
}
'import requests
url = "https://api.callrounded.com/v1/phone-numbers/{phone_number_id}"
payload = {
"name": "<string>",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirect": False,
"redirect_phone_number": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
inbound_agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
redirect: false,
redirect_phone_number: '<string>'
})
};
fetch('https://api.callrounded.com/v1/phone-numbers/{phone_number_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.callrounded.com/v1/phone-numbers/{phone_number_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'inbound_agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'redirect' => false,
'redirect_phone_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <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://api.callrounded.com/v1/phone-numbers/{phone_number_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"inbound_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirect\": false,\n \"redirect_phone_number\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.callrounded.com/v1/phone-numbers/{phone_number_id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"inbound_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirect\": false,\n \"redirect_phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.callrounded.com/v1/phone-numbers/{phone_number_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"inbound_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirect\": false,\n \"redirect_phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"type": "pstn",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirect": false,
"redirect_phone_number": "<string>"
},
"error": {
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
},
"status": 200
}phone-numbers
Update phone number
Update a phone number properties, this can be used to change the name, assign an inbound agent or enable/disable redirect. The response includes the updated phone number details and headers about rate limiting.
PATCH
/
v1
/
phone-numbers
/
{phone_number_id}
Update phone number
curl --request PATCH \
--url https://api.callrounded.com/v1/phone-numbers/{phone_number_id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"name": "<string>",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirect": false,
"redirect_phone_number": "<string>"
}
'import requests
url = "https://api.callrounded.com/v1/phone-numbers/{phone_number_id}"
payload = {
"name": "<string>",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirect": False,
"redirect_phone_number": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
inbound_agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
redirect: false,
redirect_phone_number: '<string>'
})
};
fetch('https://api.callrounded.com/v1/phone-numbers/{phone_number_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.callrounded.com/v1/phone-numbers/{phone_number_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'inbound_agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'redirect' => false,
'redirect_phone_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <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://api.callrounded.com/v1/phone-numbers/{phone_number_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"inbound_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirect\": false,\n \"redirect_phone_number\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://api.callrounded.com/v1/phone-numbers/{phone_number_id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"inbound_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirect\": false,\n \"redirect_phone_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.callrounded.com/v1/phone-numbers/{phone_number_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"inbound_agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"redirect\": false,\n \"redirect_phone_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"type": "pstn",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"redirect": false,
"redirect_phone_number": "<string>"
},
"error": {
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
},
"status": 200
}Authorizations
The API Key created in Rounded Studio.
- You can create it by going to the "API Keys" settings of your profile.
- Need help? You can email us at team@callrounded.com or join our Discord community.
Path Parameters
The ID of the phone number to update.
Body
application/json
The phone number data to update.
Response
Successfully updated phone number
- PSTN Phone Number
- SIP Phone Number
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
{
"details": [
{
"field": "email",
"message": "Invalid email format"
}
],
"message": "An error occurred while processing your request",
"status": 400,
"type": "generic_error"
}
HTTP status code of the response.
⌘I