---
title: "Search Available Phone Numbers"
method: POST
path: "/phone-numbers/search"
tags: ["Phone Numbers"]
---

# Search Available Phone Numbers

`POST /phone-numbers/search`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/phone-numbers/search`
- Auth: HTTP bearer

Numbers a carrier has available to buy. Buy one with `POST /phone-numbers/purchase`.

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- PhoneNumberSearchRequest
  - `provider` string, required: The carrier to search - the same values `POST /phone-numbers/purchase` takes.
  - `country` string: ISO country code.
  - `area_code` string, nullable
  - `number_type` string: `local` or `toll_free`.
  - `pattern` string, nullable: Digits or a phrase the number must contain.
  - `match` string: Where `pattern` must appear: `first`, `anywhere` or `last`.
  - `locality` string, nullable: City. Use this or `pattern`, not both.

## Response `200`

Successful Response

- ApiResponsePhoneNumberSearchPayload
  - `data` PhoneNumberSearchPayload, required: Numbers available to buy, under `items`.
    - `items` unknown[]
      - unknown
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
