Buy a phone number
Authentication
Request
The agent that answers on the number. Must belong to this workspace (404) and be provisioned with the voice provider (409 while it is not).
ISO-3166 alpha-2 code, case-insensitive; defaults to US. Must be a serviceable market (400 We can't provision numbers in <code> yet. Available: ...), and must be US or CA for this endpoint (402).
3-digit area code (NPA) to prefer when searching. Only used for US and CA. Ignored when phoneNumber is given.
Exact E.164 number to buy, picked from GET /api/phone-numbers/available. Without it the first available number of the requested type is bought.
Preferred inventory type. Without it local is tried, then mobile. local = geographic number; mobile = mobile range; tollfree = toll-free number.
Display name for the number. Defaults to Jelliu <phoneNumber>.
Response
One number the workspace holds. channels says what it answers on; provider says where it lives. Field names are camelCase. Returned by every /api/phone-numbers endpoint.

