curl --request DELETE \
--url "https://api.nixflex.com/v1/phone-numbers/$NXF_PHONE_NUMBER" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.delete(process.env.NXF_PHONE_NUMBER);
// 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.delete(os.environ["NXF_PHONE_NUMBER"])
# AsyncNixflex supports the same calls with await (and async with).
nixflex numbers delete "$NXF_PHONE_NUMBER" --confirm --base-url https://api.nixflex.com --json
{
"phone_number": {
"phone_number": "+12025550100",
"deleted": true
}
}
Phone numbers
Remove a phone number
Disconnect an owned number from Nixflex and clear routing managed by its import. This does not release the number from your carrier account.
DELETE
/
phone-numbers
/
{phoneNumber}
curl --request DELETE \
--url "https://api.nixflex.com/v1/phone-numbers/$NXF_PHONE_NUMBER" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.delete(process.env.NXF_PHONE_NUMBER);
// 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.delete(os.environ["NXF_PHONE_NUMBER"])
# AsyncNixflex supports the same calls with await (and async with).
nixflex numbers delete "$NXF_PHONE_NUMBER" --confirm --base-url https://api.nixflex.com --json
{
"phone_number": {
"phone_number": "+12025550100",
"deleted": true
}
}
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.
Do not send a request body.
No request body is required. Use the exact owned business number and URL-encode the leading +. Removal can affect new calls and messages using this number. Do not use it as a request to erase all call history, account data, or copies in external storage. After an unclear removal write, the engine can make one exact-resource read. Only explicit proof that all routing and application/trunk overrides are empty can finish that same removal. A missing resource (404), changed identity, missing routing fields, remaining routing or read failure is not conclusive. No second carrier write is sent by this recovery check.
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
Disconnect an owned number from Nixflex and clear the routing managed by this import. This does not release the number from its carrier account or end that account’s charges.
Method: DELETE ·
Success: 200 ·
Scope: Owning account
The important part
- Removal changes the number connection; check the exact target first.
- Tracked cleanup may remain pending after the request is accepted.
Authentication
SendAuthorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential.
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. |
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 | object | Saved value. |
phone_number.phone_number | string | Removed business number. |
phone_number.deleted | boolean | The number removal completed. |
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 DELETE \
--url "https://api.nixflex.com/v1/phone-numbers/$NXF_PHONE_NUMBER" \
--header "Authorization: Bearer $NIXFLEX_API_KEY"
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.delete(process.env.NXF_PHONE_NUMBER);
// 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.delete(os.environ["NXF_PHONE_NUMBER"])
# AsyncNixflex supports the same calls with await (and async with).
nixflex numbers delete "$NXF_PHONE_NUMBER" --confirm --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",
"deleted": true
}
}
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 | invalid_phone_format | The number format is invalid. | Use a complete E.164 number. |
| 403 | account_unavailable | The account is not active. | Resolve account access before attempting another number operation. |
| 404 | number_not_found | The number is not on this account. | Check the owning account and exact number. |
| 409 | number_operation_pending | Another import or removal is pending. | Read the current number and wait; do not change its routing. |
| 409 | number_cleanup_uncertain | A previous routing change is unconfirmed. | Contact support to reconcile it before importing or removing again. |
| 503 | number_cleanup_uncertain | The routing outcome from this attempt is unconfirmed. | Do not resend or change routing; reconcile through support. |
| 503 | number_save_pending | Routing changed but local completion could not be confirmed. | Read current state and contact support; never replay automatically. |
| 503 | number_operation_unavailable | The operation could not be confirmed. | Reconcile the number before another write. |
| 409 | number_cleanup_credentials_missing | The existing connection lacks the credentials needed to clear routing. | Restore the existing connection through the supported account workflow before removal. |
| 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. |