Skip to main content
POST
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. 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 Update carrier credentials for an imported Nixflex phone number in place. Preserve settings and handle uncertain routing or credential saves safely.
Method: POST ·
Success: 200 ·
Scope: Owning account
The important part
  • Use exactly one supported credential pair; do not mix carrier fields.
  • This replaces connection credentials. Keep both request and response out of logs.

Authentication

Use Authorization: Bearer KEY_ID:KEY_SECRET for the owning account. An organisation API key has Owner authority. Personal sessions use the role rules documented in Authentication; do not treat a Member session as an API key.

Request fields

Choose exactly one carrier pair (option 1). Choose exactly one carrier pair (option 2). Send exactly the credential pair for the number’s existing carrier. Twilio uses twilio_sid and twilio_token; Telnyx uses telnyx_api_key and telnyx_connection_id for your existing TeXML app. Mixed pairs, extra fields, a provider switch, agent fields and settings fields are refused. Outer whitespace is trimmed; blank values are refused. Telnyx values cannot contain CR, LF or NUL. Secrets are write-only and are never returned. Verification checks that the new carrier account owns this exact number before changing routing. Twilio voice, SMS and status URLs are repointed to Nixflex and application/trunk overrides are cleared. Telnyx attaches the submitted TeXML app without changing shared app webhooks. The number ID, assigned agent, prompts, switches, pickup delay, integrations and history remain. A changed Telnyx credential identity clears verification evidence, keeps the public key and needs the existing fresh test-call and approval flow. Identical current credentials retain existing verification when the resource also matches. Do not delete and re-import a number to recover from an uncertain credential update.

Response fields

200 returns the following shape. The response confirms the owned number and carrier. No credential or resource snapshot is returned.

Example request

Production HTTP examples. Replace the placeholder identifiers with resources owned by the account. Set NIXFLEX_API_KEY privately; never print it.

Example response

Illustrative response with placeholder identifiers.

Errors

Branch on error.code, not the wording of error.message. The envelope includes type, code, message, doc_url and details. invalid_credentials is HTTP 400, not an API-authentication 401. carrier_outcome_unknown: stop automatic retries and contact support with details.operation_id if present. credential_save_pending: the carrier change is confirmed; deliberately resubmit identical details to finish the local save without a second carrier change. A pending number/release operation must be resolved first. Never use delete/re-import as recovery.

Retry and idempotency

Disable automatic write retries. A lost response leaves the result uncertain; read the affected resource before another deliberate action. No general Idempotency-Key replay guarantee applies. See retry rules.

Authorizations

Authorization
string
header
required

KEY_ID:KEY_SECRET from the owning account. Keep it server-side. A verified personal dashboard Bearer session may be used where the operation documents role-based access.

Path Parameters

phoneNumber
string
required

Owned E.164 number. URL-encode the leading +.

Pattern: ^\+[1-9][0-9]{1,14}$

Body

application/json
twilio_sid
string
required
write-only
Pattern: ^AC[a-fA-F0-9]{32}$
twilio_token
string
required
write-only

Private submitted credential. Outer whitespace is trimmed; blank values and CR/LF/NUL are refused.

Required string length: 1 - 4096
Pattern: ^(?=[^\r\n\u0000]*\S)[^\r\n\u0000]+$

Response

Success. Cache-Control: no-store.

phone_number
string
required
Pattern: ^\+[1-9][0-9]{1,14}$
provider
enum<string>
required
Available options:
twilio,
telnyx
updated
boolean
required