curl --request PATCH \
--url "https://api.nixflex.com/v1/phone-numbers/$NXF_PHONE_NUMBER" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"sms_reply_enabled":false}'
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.phoneNumbers.update(process.env.NXF_PHONE_NUMBER, {sms_reply_enabled:false});
// Handle result privately; do not log secrets or call content.
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
result = client.phone_numbers.update(os.environ["NXF_PHONE_NUMBER"], sms_reply_enabled=False)
# AsyncNixflex supports the same calls with await (and async with).
nixflex numbers update "$NXF_PHONE_NUMBER" --set sms_reply_enabled=false --base-url https://api.nixflex.com --json
{
"phone_number": {
"phone_number": "+12025550100",
"agent_id": "agent_0123456789abcdef",
"custom_prompt": "Example number instructions."
}
}
Phone numbers
Update a phone number
Update an owned Nixflex number’s settings or move it to another active agent on the account. Review routing and uncertain outcomes before retrying.
PATCH
/
phone-numbers
/
{phoneNumber}
curl --request PATCH \
--url "https://api.nixflex.com/v1/phone-numbers/$NXF_PHONE_NUMBER" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"sms_reply_enabled":false}'
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.phoneNumbers.update(process.env.NXF_PHONE_NUMBER, {sms_reply_enabled:false});
// Handle result privately; do not log secrets or call content.
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
result = client.phone_numbers.update(os.environ["NXF_PHONE_NUMBER"], sms_reply_enabled=False)
# AsyncNixflex supports the same calls with await (and async with).
nixflex numbers update "$NXF_PHONE_NUMBER" --set sms_reply_enabled=false --base-url https://api.nixflex.com --json
{
"phone_number": {
"phone_number": "+12025550100",
"agent_id": "agent_0123456789abcdef",
"custom_prompt": "Example number instructions."
}
}
FIXED · account A number belongs to an account and agent. On a shared agent always pass that customer’s eligible from_number.
NOT OFFERED → do this instead · number Fixed welcome_message, language, general timezone and pickup delay belong to the agent. Use Dynamic greeting and the number’s custom_prompt for its opening. Split agents for different fixed settings.
YOU CAN CHANGE · number PATCH fields below. Clearing depends on the field. Null record_call or require_booking_confirmation inherits. Use the number’s voicemail controls.
Send a JSON object.
For a move request, the body is instead exactly one field:
Omitted settings remain unchanged. The six strict switches below accept only JSON booleans; sms_reply_enabled and older override fields retain their documented legacy coercion. Use canonical snake_case names. A saved web_calls_enabled value does not confirm that all effective web-call prerequisites are satisfied.
calcom_timezone_override, custom_prompt, voice_id, sms_reply_enabled, sms_prompt, web_prompt, speaking_rate, dtmf_enabled, require_booking_confirmation, record_call, recording_source, voicemail_leave_enabled, voicemail_message.
SCOPE · number Import an owned carrier number, assign an agent, edit its channels or remove its Nixflex connection.
For a different greeting per business, keep Dynamic greeting on (the default) and put the opening line in that number’s custom_prompt. For example, “Start every call with: Thank you for calling Oak and Stone”.
Read the compact AI rules
Change per-number settings, or move the number to another active agent on the same account. A move and a settings update are separate requests.
Method: PATCH ·
Success: 200 ·
Scope: Owning account
The important part
The stored website voice switch is -
Voice selection. To override the agent for this number, send the four voice pair fields together. To return to a saved agent pair, send
{"voice_pair_inherit":true}without a competing pair. - Change only the fields you intend; omission preserves saved values.
- Read back the number and check its effective agent assignment.
phone_numbers.web_calls_enabled. These three requests write that same value: PATCH /v1/phone-numbers/{phoneNumber} with web_calls_enabled, PATCH /v1/agent-web/{number} with settings.web_calls_enabled, and PUT /v1/integrations/web-calls/number/{phoneNumber} with enabled. The number’s web agent must also allow website access.
Saving monitor_enabled controls permission. Live listening and takeover are dashboard operations. A public live-monitor control API is not offered.
Authentication
SendAuthorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential. Send Content-Type: application/json.
Request fields
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
phoneNumber (path) | string | Yes | None | Business number. Use E.164 and URL-encode the leading + as %2B. |
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
inbound_enabled | boolean | No | Unchanged | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
outbound_enabled | boolean | No | Unchanged | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
monitor_enabled | boolean | No | Unchanged | Saved monitor permission; not a live listener control. Must be a JSON boolean. |
web_calls_enabled | boolean | No | Unchanged | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
web_agent_enabled | boolean | No | Unchanged | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
web_functions_enabled | boolean | No | Unchanged | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
custom_prompt | string or null | No | Unchanged | Number prompt override. Null or empty clears to null. Maximum 8000 characters. |
voice_id | string or null | No | Unchanged | Existing voice alias override. Trimmed; null or empty clears to null. No route-level length cap is declared. |
sms_reply_enabled | boolean | No | Unchanged | SMS auto-reply switch. The string true is also accepted; use JSON booleans. |
sms_prompt | string or null | No | Unchanged | SMS prompt override. Null or empty stores an empty string. Maximum 20000 characters. |
web_prompt | string or null | No | Unchanged | Web prompt override. Null or empty stores an empty string. Maximum 16,000 UTF-16 code units. |
speaking_rate | number or null or string | No | Unchanged | Number values are clamped to 0.5–1.5. Null or an empty string clears to inheritance; use 1 for normal speed. |
dtmf_enabled | boolean or null | No | Unchanged | Keypad override. Null or empty clears to inheritance; the string true is also accepted. |
require_booking_confirmation | boolean or null | No | Unchanged | Saved confirmation override; null inherits the agent. New voice bookings always need one combined approval, even when false. |
record_call | boolean or null | No | Unchanged | Recording override; null inherits the agent. |
recording_source | string or null | No | Unchanged | provider or nixflex; null or empty inherits the agent. Case and surrounding whitespace are normalised. Allowed: "provider", "nixflex", null, "". |
voicemail_leave_enabled | boolean or null | No | Unchanged | Number-specific voicemail setting; null is unset. When enabled, the merged message must be nonblank. |
voicemail_message | string or null | No | Unchanged | Number-specific message. Null or empty clears to null. Maximum 2000 characters. |
| Field | Type | Required | Default | Limits and meaning |
|---|---|---|---|---|
agent_id | string | Yes for a move | None | Trimmed, nonblank target agent ID; at most 200 characters. Do not combine it with settings. |
Number controls
The seven switches cover inbound, outbound, SMS reply, web agent, web calls, web functions and saved monitor permission. Off switches can prevent new work without ending an existing call. Read the number to confirm saved and effective state.Move to another agent
Send only{ "agent_id": "agent_TARGET" }. The move preserves number-specific settings and history and does not change carrier routing. New work uses the target agent. A busy number is refused. Repeating the same settled assignment returns changed: false. The move response contains agent_name and changed, while a settings response contains saved settings.
Read web_calls_effective from the number detail endpoint to check effective website access. Saved permission does not start a monitor session. Never delete and re-import a number just to move it between agents.
Response fields
200 OK returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.
| Field | Type | Meaning |
|---|---|---|
phone_number | one of the shapes below | Saved value. |
phone_number.phone_number | string | Updated number. |
phone_number.agent_id | string | Current agent ID. |
phone_number.inbound_enabled | boolean or null | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
phone_number.outbound_enabled | boolean or null | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
phone_number.monitor_enabled | boolean or null | Saved monitor permission; not a live listener control. Must be a JSON boolean. |
phone_number.web_calls_enabled | boolean or null | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
phone_number.web_agent_enabled | boolean or null | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
phone_number.web_functions_enabled | boolean or null | Saved channel switch. Must be a JSON boolean. Omitted stays unchanged. |
phone_number.custom_prompt | string or null | Number prompt override. Null or empty clears to null. Maximum 8000 characters. |
phone_number.voice_id | string or null | Existing voice alias override. Trimmed; null or empty clears to null. No route-level length cap is declared. |
phone_number.sms_reply_enabled | boolean or null | SMS auto-reply switch. The string true is also accepted; use JSON booleans. |
phone_number.sms_prompt | string or null | SMS prompt override. Null or empty stores an empty string. Maximum 20000 characters. |
phone_number.web_prompt | string or null | Web prompt override. Null or empty stores an empty string. Maximum 16,000 UTF-16 code units. |
phone_number.speaking_rate | number or null or string | Number values are clamped to 0.5–1.5. Null or an empty string clears to inheritance; use 1 for normal speed. |
phone_number.dtmf_enabled | boolean or null | Keypad override. Null or empty clears to inheritance; the string true is also accepted. |
phone_number.require_booking_confirmation | boolean or null | Saved confirmation override; null inherits the agent. New voice bookings always need one combined approval, even when false. |
phone_number.record_call | boolean or null | Recording override; null inherits the agent. |
phone_number.recording_source | string or null | provider or nixflex; null or empty inherits the agent. Case and surrounding whitespace are normalised. Allowed: "provider", "nixflex", null, "". |
phone_number.voicemail_leave_enabled | boolean or null | Number-specific voicemail setting; null is unset. When enabled, the merged message must be nonblank. |
phone_number.voicemail_message | string or null | Number-specific message. Null or empty clears to null. Maximum 2000 characters. |
phone_number.phone_number | string | Moved number. |
phone_number.agent_id | string | Target agent ID. |
phone_number.agent_name | string or null | Target agent name. |
phone_number.changed | boolean | False if already assigned to this agent; true if the assignment changed. |
Example request
Raw HTTP base URL:https://api.nixflex.com/v1. Node and Python SDK base URL: https://api.nixflex.com. The SDK adds /v1. Keep NIXFLEX_API_KEY in your private process environment. The shell examples use Bash syntax. SDK and CLI examples require Node/CLI 0.11.0 or later and Python 0.4.0 or later. Set NXF_PHONE_NUMBER to the intended account-owned identifiers or approved recipient before running.
curl --request PATCH \
--url "https://api.nixflex.com/v1/phone-numbers/$NXF_PHONE_NUMBER" \
--header "Authorization: Bearer $NIXFLEX_API_KEY" \
--header "Content-Type: application/json" \
--data '{"sms_reply_enabled":false}'
import Nixflex from 'nixflex';
const baseUrl = 'https://api.nixflex.com';
const client = new Nixflex({apiKey:process.env.NIXFLEX_API_KEY,baseUrl,maxRetries:0});
const result = await client.phoneNumbers.update(process.env.NXF_PHONE_NUMBER, {sms_reply_enabled:false});
// Handle result privately; do not log secrets or call content.
import os, json
from pathlib import Path
from nixflex import Nixflex
base_url = "https://api.nixflex.com"
with Nixflex(os.environ["NIXFLEX_API_KEY"], base_url=base_url,max_retries=0) as client:
result = client.phone_numbers.update(os.environ["NXF_PHONE_NUMBER"], sms_reply_enabled=False)
# AsyncNixflex supports the same calls with await (and async with).
nixflex numbers update "$NXF_PHONE_NUMBER" --set sms_reply_enabled=false --base-url https://api.nixflex.com --json
Example response
Illustrative200 response. Identifiers and values are examples; some optional or compatibility fields are omitted.
{
"phone_number": {
"phone_number": "+12025550100",
"agent_id": "agent_0123456789abcdef",
"custom_prompt": "Example number instructions."
}
}
Errors
Failures return anerror object with code, message, doc_url and optional details. Each code links to the shared error catalog. Read the message and details before deciding whether to resend.
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 400 | missing_field | No recognised setting was supplied. | Send a documented setting, or agent_id alone for a move. |
| 400 | invalid_number_control | A strict switch is not a JSON boolean or aliases conflict. | Send true or false once for that switch. |
| 400 | invalid_agent_move | A move contains other settings or an invalid agent ID. | Send only agent_id; update settings separately. |
| 400 | invalid_number | A move URL does not contain a complete E.164 number. | Correct and URL-encode the number. |
| 400 | custom_prompt_too_long | The number prompt exceeds 8,000 characters. | Shorten it. |
| 400 | sms_prompt_too_long | The SMS prompt exceeds 20,000 characters. | Shorten it. |
| 400 | web_prompt_too_long | The web prompt exceeds 16,000 UTF-16 code units. | Shorten it. |
| 400 | voicemail_message_too_long | The voicemail message exceeds 2,000 characters. | Shorten it. |
| 400 | voicemail_message_required | The merged settings enable voicemail without a message. | Supply the message or disable voicemail. |
| 400 | invalid_recording_source | The recording source value is unsupported. | Use provider, nixflex or null. |
| 404 | number_not_found | The number is not owned by this account. | Use the exact number returned by an account list. |
| 404 | agent_not_found | The move target is not an owned agent. | Use an owned agent ID. |
| 409 | agent_unavailable | The target agent is not active. | Choose an active agent. |
| 409 | number_busy | A call, reply, campaign or number operation is active. | Wait for that work to finish before deciding on a move. |
| 503 | number_move_disabled | Number moves are not enabled. | Use the existing assignment until moves are enabled. |
| 503 | number_move_unconfirmed | The move result could not be confirmed. | Read the number before another write. |
| 500 | db_update_failed | Settings storage failed. | Read the number and reconcile the intended values. |
| 500 | server_error | The update result could not be confirmed. | Read current settings before another attempt. |
| 401 | unauthorized | The credential is missing or invalid. | Check the full account credential. |
| 429 | rate_limit_exceeded | The account request limit was reached. | Wait for Retry-After. Reconcile uncertain writes before resending. |
Retry and idempotency
Never automatically retry PATCH. Read the number after an uncertain settings write or move. Do not change routing to compensate for an unconfirmed move.Related endpoints
Authorizations
Path Parameters
Body
application/json
- Option 1
- Option 2
Partial settings update; at least one recognised setting is required. Unknown-only input is refused.