<Intro>

<EndpointHeader />

<Description>

Returns a paginated list of the phone numbers currently allocated to your workspace, newest first. Each entry is either a dedicated number you bought or a shared number managed for you, as its `kind` field indicates. Pass `number` to look one up, or narrow the list with `country_code`, `number_type`, `prefix`, and `capabilities`. An allocated number is not always enough to send from it: some countries also require an approved registration for the sender.

</Description>

</Intro>

<Parameters in="query">

<Parameter name="number" type="string">

<Description>

Return only the number matching these digits. Give a full number with its country code, however your own records spell it: `+12025550188`, `12025550188`, `0012025550188`, and `+1 202 555 0188` all resolve to the same number. Spacing and punctuation are fine once a leading `+` or `00` marks the country code, or when `country_code` names the country; a grouped spelling without either is refused rather than guessed at, and a national spelling (bare digits without the country code) matches only when `country_code` names the country. A short code is matched on its bare digits instead, and since the same short code can be allocated in more than one country, pass `country_code` alongside it to name which one. This filter narrows the list like the others rather than replacing them, so a country or capability filter still applies. To match a range of numbers rather than one, use `prefix`.

</Description>

</Parameter>

<Parameter name="country_code" type="string">

<Description>

Filter by the country a number belongs to, as an ISO 3166-1 alpha-2 code.

</Description>

</Parameter>

<Parameter name="number_type" type="string">

<Description>

Return only allocated numbers of this physical type after applying the country and prefix filters.

</Description>

<Description>

Possible values (may grow over time): `mobile`, `local`, `national`, `short_code`, `short_code_fteu`, `toll_free`

</Description>

</Parameter>

<Parameter name="prefix" type="string">

<Description>

Return only numbers that start with these digits, matched right after the country dial code: with `country_code=US`, `prefix=212` returns the +1 212 area-code numbers allocated to you. Digits only, and `country_code` is required alongside it, since the digits are national ones. Leave out the country dial code and any national dialing prefix such as a leading 0. Short codes never match a prefix search.

</Description>

</Parameter>

<Parameter name="capabilities" type="array">

<Description>

Filter by channel capability. Repeat the parameter to require several at once: `capabilities=sms&capabilities=voice` returns only numbers that support both.

</Description>

</Parameter>

<Parameter name="limit" type="integer">

<Description>

Maximum number of items to return per page.

</Description>

</Parameter>

<Parameter name="starting_after" type="string">

<Description>

Cursor from the `next_cursor` field of a previous list response. Returns items immediately after the cursor position in the current sort order.

</Description>

</Parameter>

<Parameter name="ending_before" type="string">

<Description>

Cursor from the `prev_cursor` field of a previous list response. Returns items immediately before the cursor position in the current sort order.

</Description>

</Parameter>

</Parameters>

<Payload kind="response">

<Field name="data" type="array of object" required>

<FieldChildren kind="response">

<Field name="id" type="string" prefix="data." required>

<Description>

Identifier of this allocated number. Pass it as `number_id` to read this number, or to release it when kind is dedicated.

</Description>

</Field>

<Field name="kind" type="string" prefix="data." required>

<Description>

How this number is allocated. `dedicated` is allocated to this workspace alone and billed as a subscription. `shared` is a shortcode allocated to several workspaces at once and managed by us.

</Description>

<Description>

Possible values: `dedicated`, `shared`

</Description>

</Field>

<Field name="number" type="string" prefix="data." required>

<Description>

Phone number in E.164 format.

</Description>

</Field>

<Field name="country_code" type="string" prefix="data." required />

<Field name="number_type" type="string" prefix="data." required>

<Description>

Physical type of this phone number.

</Description>

</Field>

<Field name="capabilities" type="array of string" prefix="data." required>

<Description>

Channel capabilities supported by this number.

</Description>

</Field>

<Field name="status" type="string" prefix="data." required>

<Description>

Whether this number can carry traffic.

- `active` means this number is allocated to your workspace and usable.
- `pending_compliance` means this number is allocated to your workspace and billed,
  but it cannot carry traffic until the ownership paperwork its country requires is
  accepted. Read `ownership.next` for what advances it, and re-read later if
  `ownership` is momentarily `null`.
- `released` means this number is no longer allocated to your workspace.

An allocated number is not always enough to send from it: some destination
countries also require an approved registration for the sender.

</Description>

<Description>

Possible values: `active`, `pending_compliance`, `released`

</Description>

</Field>

<Field name="allocated_at" type="string" prefix="data." required>

<Description>

When this number was allocated to your workspace.

</Description>

</Field>

<Field name="released_at" type="nullable string" prefix="data.">

<Description>

When this number was released. `null` while it is still allocated to your workspace.

</Description>

</Field>

<Field name="ownership" type="nullable object" prefix="data.">

<Description>

Where this number stands with the ownership paperwork its country requires. `null` when the country requires none, which is the usual case: a number with no `ownership` object is usable as soon as it is allocated. Also `null` when that standing cannot be established right now; `status` still reads `pending_compliance` while the number is blocked, so re-read this field rather than caching its absence. We manage the paperwork for shared short codes, so this field is always `null` for them.

</Description>

<FieldChildren kind="response">

<Field name="satisfied" type="boolean" prefix="data.ownership." required>

<Description>

Whether the paperwork is accepted. Read `next` for what advances it while this is false. Whether sending is currently refused is reported by `blocked_at` instead: a number bought before its country asked for anything is unsatisfied and still usable until a review says otherwise.

</Description>

</Field>

<Field name="blocked_at" type="nullable string" prefix="data.ownership.">

<Description>

When the number stopped being able to carry traffic, and null while it can. Always null when `satisfied` is true, but null does not imply it: a number whose country began asking after you bought it is usable with its paperwork still outstanding. A number can also arrive blocked, and one that was usable can be blocked again if its approval is withdrawn.

</Description>

</Field>

<Field name="next" type="array of object" prefix="data.ownership." required>

<Description>

What you do about it, in the order to do it. Empty only when `satisfied` is true, so while anything is outstanding there is always at least one step. When what you already sent is being reviewed and nothing is needed from you, that step has kind `wait` and says so. Re-read it after each call rather than caching the first list you saw.

</Description>

<FieldChildren kind="response">

<Field name="kind" type="string" prefix="data.ownership.next." required>

<Description>

What you do about this step.

- `operation`: call the operation named in `operation`, then
  read again.
- `external`: act somewhere this API does not reach, then read
  again.
- `wait`: nothing is asked of you, so read again later.
- `terminal`: nothing you do resolves this, so stop retrying.

Tolerate a value you do not recognize: show the `description` and
offer no action.

</Description>

<Description>

Possible values (may grow over time): `operation`, `external`, `wait`, `terminal`

</Description>

</Field>

<Field name="description" type="string" prefix="data.ownership.next." required>

<Description>

A short, human-readable label for the step, suitable for display.

</Description>

</Field>

<Field name="operation" type="string" prefix="data.ownership.next.">

<Description>

The operationId to call. Present only when `kind` is `operation`. The operation's own schema says how to call it; this says only which one, and what to address it with.

</Description>

</Field>

<Field name="params" type="object" prefix="data.ownership.next.">

<Description>

The parameters that address the operation, by name: `{"sender_id": "…"}` for an operation on `/v1/sms/senders/{sender_id}/requirements`. A parameter the operation takes in its query string is given the same way, so an operation addressed as `?subject_id=` carries `{"subject_id": "…"}`. Every parameter the call needs is here, whether its value came from the thing you were acting on or is fixed for this step, so you can make the call from this object alone. Present only when `kind` is `operation` and the operation names a subject. A request body, when the operation takes one, is described by the operation's own schema and never appears here.

</Description>

</Field>

<Field name="url" type="string" prefix="data.ownership.next.">

<Description>

A URL to open. Present only when `kind` is `external`, and only when the step has one. An external step whose `description` says to go and do something with no URL to open is normal.

</Description>

</Field>

</FieldChildren>

</Field>

</FieldChildren>

</Field>

</FieldChildren>

</Field>

<Field name="next_cursor" type="nullable string" required>

<Description>

Cursor for the next page. Pass back as `starting_after` to advance forward. `null` when no next page exists.

</Description>

</Field>

<Field name="prev_cursor" type="nullable string" required>

<Description>

Cursor for the previous page. Pass back as `ending_before` to step backward. `null` when no previous page exists.

</Description>

</Field>

<Field name="refresh_cursor" type="nullable string" required>

<Description>

Refresh anchor. Pass back as `ending_before` later to fetch items that have appeared since this response. Non-`null` whenever `data` is non-empty; `null` only on an empty page. Distinct from `prev_cursor`.

</Description>

</Field>

</Payload>