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 Connect a number you already own to an active agent on the same account. Import can replace existing number routing, so another application using that routing can stop receiving calls or texts.
Method: POST ·
Success: 201 ·
Scope: Owning account
The important part
  • Server-side import is supported. Send POST /v1/phone-numbers with exactly one carrier credential set. Import can replace the number’s existing routing. Confirm the customer owns the number and authorises that change.
  • This connects an existing supported number to the account.
  • A pending import is not permission to send; wait for a usable state.
Import requires an owned number and carrier credentials authorised to manage it. Send international E.164 format with 7–15 digits. Passing the format check does not establish country, voice or SMS coverage. Check the number’s capabilities with the carrier. Twilio trial accounts can restrict outbound calls to verified destinations (carrier error 21219). Send the Account SID (starts with AC) and Auth Token of the carrier account or subaccount that holds the number; API key SIDs (SK…) are rejected with a 400 error.

Authentication

Send Authorization: Bearer KEY_ID:KEY_SECRET using the owning account’s server-side credential. Send Content-Type: application/json.

Request fields

Send the owned phone number, its active agent and one carrier credential set from your server. The number and agent are the public identifiers. Those neutral fields alone are not a successful import. Add credentials for the carrier account that holds the number. Use the real values only in your private server request. For example, a Twilio import needs four fields: phone_number, agent_id, twilio_sid and twilio_token. For Telnyx, replace the last two with telnyx_api_key and telnyx_connection_id. Unknown import fields are refused. Use only one connection credential set; do not mix it with another. custom_prompt does not configure the remaining per-number switches. If custom_prompt is omitted, it is saved as null; import does not copy the agent instructions. A later prompt update is a separate request that must be checked independently.

Response fields

201 Created returns the shape below. Nullable fields can be unknown or unset; do not turn null into zero or false.

Example request

Prepare the request body as a private import.json file using the table above. The examples send it from your server using NIXFLEX_API_KEY. Keep the file out of logs and source control. SDK and CLI examples require Node/CLI 0.11.0 or later and Python 0.4.0 or later.

Example response

Illustrative 201 response. Identifiers and values are examples; some optional or compatibility fields are omitted.

Errors

Failures return an error 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.

Retry and idempotency

Never automatically retry an import. Save any returned operation_id from safe error details. A pending completion may allow an exact, deliberate reconciliation request after state is checked; an uncertain routing outcome needs support. Do not re-import to work around number_cleanup_uncertain.

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.

Body

application/json

Send the number and its active owned agent with exactly one complete carrier credential set. Keep credentials on your server.

Send the number and its active owned agent with exactly one complete carrier credential set. Keep credentials on your server.

phone_number
string
required

Business number. Up to 64 input characters; spaces, hyphens, parentheses and dots are removed before E.164 validation.

Maximum string length: 64
agent_id
string
required

Owned active agent identifier; trimmed, nonblank, at most 200 characters.

Maximum string length: 200
twilio_sid
string
required

Carrier account SID. Use AC followed by 32 hexadecimal characters.

Pattern: ^[Aa][Cc][A-Fa-f0-9]{32}$
twilio_token
string
required
write-only

Private auth token for the account holding the number.

Required string length: 1 - 4096
custom_prompt
string | null

Optional number-specific prompt, at most 8,000 characters.

Maximum string length: 8000
telnyx_api_key
string
write-only

Private carrier API key.

Required string length: 1 - 4096
telnyx_connection_id
string

Voice application connection ID.

Required string length: 1 - 200
telnyx_public_key
string

Optional public verification key, canonical base64 encoding exactly 32 bytes.

Required string length: 44

Response

Created

phone_number
object
required

Neutral fields from the imported number. Legacy identifier fields may also be present.