नेविगेशन पर जाएँ

Assign Phone Number

Give a receptionist a phone number. A number the workspace already holds but has not attached is used first. Otherwise, in the US and Canada, a number with one of the requested area_codes is taken from the pool or bought, falling back to any number in the business’s country. In countries that require paperwork, the number is issued right away but takes public calls only once the workspace’s own registration is approved (see accepts_public_calls). Counts toward the plan’s phone number limit, and free plans can take only a few new numbers a day. Returns 404 when no number is available and 403 telephony_managed_by_reseller when the reseller supplies the workspace’s numbers from its own Twilio account or SIP trunk and none is free.

हेडर

xi-api-keystringवैकल्पिक
xi-workspace-idstring or nullवैकल्पिक
The customer workspace a reseller's API key acts on.

अनुरोध

This endpoint expects an object.
customer_facing_agent_idstringआवश्यक
The receptionist that answers calls to the number.
area_codeslist of strings or nullवैकल्पिक

Preferred US or Canadian area codes, e.g. ["415", "628"]. Codes outside the business’s country are ignored, and any number is given when none of these is available.

number_typeenum or nullवैकल्पिक
Local or mobile, in a country that requires paperwork before a number takes calls. Leave unset to try mobile first. Ignored in the US and Canada.
अनुमत मान:
idempotency_keystring or nullवैकल्पिक<=255 characters

Client-generated key that makes a retry safe. The same key and body within 24 hours returns the first result without running again. While that first request is still running, a retry gets 409 idempotency_key_in_progress; a different body with the same key gets 400 idempotency_key_reused. A request that fails is not saved, so it can be retried with the same key.

रिस्पॉन्स

सफल रिस्पॉन्स

_idstring
is_activebooleanकेवल-पढ़ने योग्य
accepts_public_callsbooleanकेवल-पढ़ने योग्य
Whether inbound calls from the public may reach the receptionist.
phone_numberstring or nullवैकल्पिक
Phone number in E.164 format.
is_byobooleanवैकल्पिकडिफ़ॉल्ट: false

True when the phone is bring-your-own: registered by the workspace using their own telephony provider (Twilio credentials or SIP trunk). BYO phones are never part of the shared pool, do not count against the plan’s phone number limit, and are deleted (rather than returned to the pool) on release.

providerenumवैकल्पिकडिफ़ॉल्ट: twilio
Telephony provider for this phone number.
अनुमत मान:
nanp_area_codeintegerवैकल्पिकडिफ़ॉल्ट: 0

US/Canada NANP area code (NPA) as an integer.

customer_facing_agent_idstring or nullवैकल्पिक
The receptionist that answers this number. Null when the workspace holds the number but no receptionist answers it yet.
deactivated_at_unixinteger or nullवैकल्पिक

Unix timestamp when this number was deactivated; it is released 14 days later. Null when active.

deactivation_reasonenum or nullवैकल्पिक
Why this number was deactivated. Null when active.
अनुमत मान:
regulatory_statusenum or nullवैकल्पिक

Null for numbers that need no paperwork. held while the workspace’s own application is under review, approved once it passed and the number is fully usable.

अनुमत मान:
regulatory_number_typeenum or nullवैकल्पिक
The regulated number type this number was issued as. Null for numbers that need no paperwork.
अनुमत मान:
regulatory_countrystring or nullवैकल्पिक
ISO country the regulated number was issued in. Null for numbers that need no paperwork.
created_at_unixintegerवैकल्पिक

Unix timestamp (seconds since epoch)

updated_at_unixintegerवैकल्पिक

Unix timestamp (seconds since epoch)

त्रुटियाँ

422
Unprocessable Entity Error