Update phone number
curl --request PATCH \
--url https://api.nixflex.com/v1/phone-numbers/{phone_number}import requests
url = "https://api.nixflex.com/v1/phone-numbers/{phone_number}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.nixflex.com/v1/phone-numbers/{phone_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.nixflex.com/v1/phone-numbers/{phone_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nixflex.com/v1/phone-numbers/{phone_number}"
req, _ := http.NewRequest("PATCH", url, nil)
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.nixflex.com/v1/phone-numbers/{phone_number}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/phone-numbers/{phone_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyPhone numbers
Update phone number
PATCH /v1/phone-numbers/:phoneNumber
PATCH
/
v1
/
phone-numbers
/
{phone_number}
Update phone number
curl --request PATCH \
--url https://api.nixflex.com/v1/phone-numbers/{phone_number}import requests
url = "https://api.nixflex.com/v1/phone-numbers/{phone_number}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.nixflex.com/v1/phone-numbers/{phone_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.nixflex.com/v1/phone-numbers/{phone_number}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.nixflex.com/v1/phone-numbers/{phone_number}"
req, _ := http.NewRequest("PATCH", url, nil)
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.nixflex.com/v1/phone-numbers/{phone_number}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nixflex.com/v1/phone-numbers/{phone_number}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyUpdate the per-number settings on a number you have already imported: the call business profile, the voice, and the SMS and web agent instructions. Every field is optional - send only what you want to change. Any field left out is untouched.
Each channel is independent:
URL-encode the
Send at least one field. An empty body is rejected.
Takes effect on the very next call or text - no deploy, no re-import.
The changes take effect on the next call or text. This is how a 200-location rollout stays one agent + one PATCH per location - across calls, SMS, and web.
custom_promptshapes phone calls (layered on top of the agent prompt).sms_promptis the SMS agent (SMS agent) - it does not affect calls.web_promptis the web agent (Web agent) - it does not affect calls or SMS.sms_reply_enabledturns SMS auto-reply on or off for the number.speaking_ratesets how fast this number talks, overriding the agent’s speed.dtmf_enabledlets callers type digits on their keypad instead of saying them.record_callcontrols whether calls on this number are recorded.recording_sourcechooses who records on this number - your carrier or the Nixflex voice engine.
Request
curl -X PATCH https://api.nixflex.com/v1/phone-numbers/+447446466847 \
-H "Authorization: Bearer KEY_ID:KEY_SECRET" \
-H "Content-Type: application/json" \
-d '{
"sms_reply_enabled": true,
"sms_prompt": "You are the text assistant for Smile Dental. Open Mon-Fri 9am-5pm. A check-up is 45 pounds. You can book, reschedule and cancel. Keep replies short."
}'
+ if your HTTP client doesn’t do it automatically: %2B447446466847.
Body parameters
| Field | Type | Required | Notes |
|---|---|---|---|
custom_prompt | string or null | No | The business profile layered on top of the agent prompt on phone calls. Maximum 8000 characters. Send null or an empty string to clear it - the number then falls back to the agent prompt alone. Does not affect SMS or web chat. |
voice_id | string or null | No | The voice this number speaks with on calls, overriding the agent’s voice (e.g. Craig, Eleanor, Ashley). Send null or empty to fall back to the agent’s voice. Must be an exact, valid voice ID. |
sms_reply_enabled | boolean | No | Turns the SMS agent (auto-reply) on or off for this number. false by default - a number only replies to texts when you turn this on. Accepts true/false. |
sms_prompt | string or null | No | Instructions for the SMS agent on this number. Independent of custom_prompt. Maximum 20000 characters. Send null or an empty string to clear it. |
web_prompt | string or null | No | Instructions for the Web agent on this number. Independent of custom_prompt and sms_prompt. Maximum 20000 characters. Send null or an empty string to clear it. |
speaking_rate | number or null | No | How fast this number speaks on calls, overriding the agent’s speed. 1.0 is normal, 0.5 is half speed, 1.5 is half again as fast. A value outside that range is clamped to the nearest limit rather than rejected. null means not set - the number inherits the agent’s speed, so a null number under a 1.5 agent still speaks at 1.5. To make one number normal while the agent stays fast, send 1, not null. See Voices. |
dtmf_enabled | boolean or null | No | Whether callers on this number can type digits on their phone keypad instead of speaking them. null means not set, so the number inherits the agent’s setting - a null number under an agent with keypad input on still accepts keypad entry. Send false to switch one number off while the agent stays on. See Keypad input. |
require_booking_confirmation | boolean or null | No | Whether the engine reads an appointment back and waits for a clear yes before writing it to the calendar on this number. null means not set - inherit the agent. Send false to switch it off for one number while the agent stays on. See Booking confirmation. |
record_call | boolean or null | No | Whether calls on this number are recorded. Recording is on unless switched off. null means not set, so the number inherits the agent’s setting. Send false to stop recording one number while the agent keeps recording. The transcript is unaffected either way, and recording_url on the call record becomes null. See Call recording. |
recording_source | string or null | No | Who records on this number when recording is on. "provider" = your carrier records; "nixflex" = the voice engine records the conversation itself, with no carrier recording charges. null means not set - the number inherits the agent’s choice. Ignored while record_call is off. Any other value is rejected with invalid_recording_source. See Call recording. |
Response
200 OK returns the updated number:
{
"phone_number": {
"phone_number": "+447446466847",
"agent_id": "agent_125207e452f8714a",
"custom_prompt": "Business: Smile Dental Croydon...",
"voice_id": "Craig",
"sms_reply_enabled": true,
"sms_prompt": "You are the text assistant for Smile Dental...",
"web_prompt": null,
"speaking_rate": 0.9,
"dtmf_enabled": null,
"require_booking_confirmation": null,
"record_call": false,
"recording_source": null
}
}
Errors
| Code | HTTP | Cause |
|---|---|---|
missing_field | 400 | Empty body - no updatable field present (send null to clear a field, not an empty body) |
custom_prompt_too_long | 400 | custom_prompt over 8000 characters |
sms_prompt_too_long | 400 | sms_prompt over 20000 characters |
web_prompt_too_long | 400 | web_prompt over 20000 characters |
number_not_found | 404 | Number doesn’t exist OR belongs to a different account |
Use case: reseller end-customer onboarding
One agent template, many end-customers - each number carries its own call profile, SMS agent, and web agent:// Customer edits their business details in YOUR app -> you sync to Nixflex
await fetch(
`https://api.nixflex.com/v1/phone-numbers/${clinicNumber}`,
{
method: 'PATCH',
headers: {
'Authorization': `Bearer ${NIXFLEX_KEY_ID}:${NIXFLEX_KEY_SECRET}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
custom_prompt: `Business: ${clinic.name}. Address: ${clinic.address}. Open ${clinic.hours}. ${clinic.services}`,
voice_id: clinic.voice_id,
sms_reply_enabled: true,
sms_prompt: `You are the text assistant for ${clinic.name}. ${clinic.details}. You can book, reschedule and cancel. Keep replies short.`,
web_prompt: `You are the online assistant for ${clinic.name}. ${clinic.details}. If someone wants to book, tell them to call.`,
speaking_rate: clinic.speaking_rate
})
}
);
Related
- SMS agent - the
sms_prompt+sms_reply_enabledfeature - Web agent - the
web_promptfeature - Import phone number
- Voices - the
voice_idandspeaking_ratesettings - Keypad input - the
dtmf_enabledsetting - Booking confirmation - the
require_booking_confirmationsetting - Call recording - the
record_callsetting - Call recording - the
recording_sourcesetting