> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbit.devotel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Search available numbers to buy

> Search live carrier inventory for purchasable phone numbers, filtered by country, line type, capabilities, area code, locality, US rate center, US LATA, Twilio-style geo proximity (`near_lat_lng` / `near_postal_code` + `distance`), and price. Returns paginated candidates — each with its E.164 number, capabilities, monthly + one-time setup price, two-way-SMS flag, and (when resolved) rate center / state / LATA / distance-in-miles — plus a per-country compliance preflight (`required` / `eligible`) so a buyer knows up front whether documents are needed. When every carrier is unavailable or unconfigured the response carries `setup_required` / `inventory_limited` hints instead of a hard error. Pass a chosen number to `POST /numbers/purchase`. Read-only discovery; scoped on the `numbers` resource (`numbers:read` or `numbers:write`).



## OpenAPI

````yaml /openapi.yaml get /api/v1/numbers/available
openapi: 3.1.0
info:
  title: Devotel CPaaS API
  description: Orbit by Devotel — Communications Platform as a Service API
  version: 1.0.0
  contact:
    name: Devotel
    url: https://devotel.io
    email: support@devotel.io
  license:
    name: Proprietary
servers:
  - url: https://api.orbit.devotel.io
    description: Production
security:
  - Bearer: []
  - ApiKey: []
tags:
  - name: Messages
    description: >-
      Send and manage messages across all channels (SMS, WhatsApp, RCS, Email,
      Viber, etc.)
  - name: Agents
    description: AI agent creation, configuration, and execution
  - name: Voice
    description: Voice calls, IVR, conferencing, and SIP trunking
  - name: Webhooks
    description: Webhook endpoint management and delivery logs
  - name: Numbers
    description: Phone number search, provisioning, and configuration
  - name: Contacts
    description: Contact management, segmentation, and lifecycle tracking
  - name: Campaigns
    description: Marketing campaign orchestration and analytics
  - name: Flows
    description: Automation flow builder and execution engine
  - name: Templates
    description: Message template management and approval workflows
  - name: Settings
    description: Organization, channel, and user preference settings
  - name: Verify
    description: OTP generation and verification across channels
  - name: Push
    description: Push notification delivery via FCM and APNs
  - name: Telegram
    description: >-
      Telegram bring-your-own-bot channel: connect a bot, verify a chat against
      the shared sandbox bot, and read unified channel state. Production sends
      go through the Messaging API.
  - name: USSD
    description: >-
      Menu-driven USSD for feature phones: define a menu tree, simulate session
      steps, and host the tenant-scoped aggregator callback.
  - name: Integrations
    description: Third-party service connections and OAuth management
  - name: Files
    description: >-
      Server-to-server media upload, listing, retrieval, and deletion
      (signed-URL backed)
  - name: Messaging Services
    description: >-
      Twilio MessagingService-parity containers bundling sender pool, opt-out
      list, inbound webhook, and sticky-sender/geomatch flags
  - name: Sender Pools
    description: >-
      Group sending numbers into pools with a selection strategy (sticky /
      round-robin / random) for outbound sends
  - name: Opt-Out Lists
    description: >-
      Per-list STOP / HELP / START keyword sets and auto-response copy (Twilio
      Advanced Opt-Out parity)
  - name: SMPP
    description: Tenant BYO-SMPP bind credentials and upstream termination carriers
  - name: Commerce
    description: >-
      Unified omnichannel conversational-commerce: cart/checkout state machine,
      cross-channel payment reconciliation, hosted pay-by-link, native WhatsApp
      checkout, and agentic-checkout payment mandates
  - name: Orby
    description: >-
      In-dashboard Orby operator assistant: streamed assistant turns,
      conversation threads, product knowledge-base search, and the tool-action
      approval gate. Available to signed-in operators only (dashboard session
      auth — API-key requests are rejected).
paths:
  /api/v1/numbers/available:
    get:
      tags:
        - Numbers
      summary: Search available numbers to buy
      description: >-
        Search live carrier inventory for purchasable phone numbers, filtered by
        country, line type, capabilities, area code, locality, US rate center,
        US LATA, Twilio-style geo proximity (`near_lat_lng` / `near_postal_code`
        + `distance`), and price. Returns paginated candidates — each with its
        E.164 number, capabilities, monthly + one-time setup price, two-way-SMS
        flag, and (when resolved) rate center / state / LATA / distance-in-miles
        — plus a per-country compliance preflight (`required` / `eligible`) so a
        buyer knows up front whether documents are needed. When every carrier is
        unavailable or unconfigured the response carries `setup_required` /
        `inventory_limited` hints instead of a hard error. Pass a chosen number
        to `POST /numbers/purchase`. Read-only discovery; scoped on the
        `numbers` resource (`numbers:read` or `numbers:write`).
      parameters:
        - schema:
            type: string
          in: query
          name: country
          required: false
          description: ISO 3166-1 alpha-2 country code to search (defaults to `US`).
        - schema:
            type: string
          in: query
          name: type
          required: false
          description: Line type — one of `local` | `mobile` | `toll_free`.
        - schema:
            type: string
          in: query
          name: capabilities
          required: false
          description: >-
            Comma-separated required capabilities — any of `sms` | `mms` |
            `voice` | `fax` (e.g. `sms,voice`).
        - schema:
            type: string
          in: query
          name: contains
          required: false
          description: >-
            Digit/vanity pattern the number must contain (matched per
            `pattern_type`).
        - schema:
            type: string
          in: query
          name: pattern_type
          required: false
          description: >-
            How `contains` matches — `contains` (default) | `starts_with` |
            `ends_with`.
        - schema:
            type: string
          in: query
          name: area_code
          required: false
          description: NPA / national destination code to restrict to (2–5 digits).
        - schema:
            type: string
          in: query
          name: locality
          required: false
          description: City / locality name to restrict to (free text).
        - schema:
            type: string
          in: query
          name: rate_center
          required: false
          description: >-
            US rate center (exchange/wire-center) name to restrict to, e.g. `SAN
            FRANCISCO` (Bandwidth/Telnyx local-number-selection parity). US/CA
            only.
        - schema:
            type: string
          in: query
          name: lata
          required: false
          description: >-
            US LATA code (Local Access and Transport Area), 3-5 digits, e.g.
            `132` for New York Metro. Resolved from each candidate's NANP area
            code. US only.
        - schema:
            type: string
          in: query
          name: near_lat_lng
          required: false
          description: >-
            Twilio-parity geo proximity — restrict to numbers whose NPA centroid
            is within `distance` miles of this point. Format `<lat>,<lng>`, e.g.
            `37.7749,-122.4194`. US/CA only.
        - schema:
            type: string
          in: query
          name: near_postal_code
          required: false
          description: >-
            Twilio-parity geo proximity via US ZIP code — resolved to its
            3-digit prefix centroid. When both `near_lat_lng` and
            `near_postal_code` are supplied, `near_lat_lng` wins.
        - schema:
            type: string
          in: query
          name: distance
          required: false
          description: >-
            Search radius in miles for `near_lat_lng` / `near_postal_code`
            (default 25, clamped to 1-500).
        - schema:
            type: string
          in: query
          name: sms_two_way
          required: false
          description: '`true` to return only numbers that can both send AND receive SMS.'
        - schema:
            type: string
          in: query
          name: page
          required: false
          description: 1-based page number (default 1).
        - schema:
            type: string
          in: query
          name: limit
          required: false
          description: Results per page (default 20).
        - name: X-Test-Mode
          in: header
          required: false
          description: >-
            Sandbox opt-in for Clerk-session-authenticated requests. Set to
            `true` to route the call through the test-mode pipeline: no real
            provider delivery, no credits deducted, response `meta.test_mode:
            true`. **Ignored for live API keys (`dv_live_sk_*`)** —
            server-to-server clients must use a test-prefixed key
            (`dv_test_sk_*`) to exercise sandbox. Test-prefixed keys
            unconditionally enable sandbox regardless of this header.
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
      responses:
        '200':
          description: Paginated available-number candidates with compliance preflight.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                description: >-
                  Paginated available-number candidates with compliance
                  preflight.
                properties:
                  data:
                    type: object
                    additionalProperties: true
                    properties:
                      numbers:
                        type: array
                        description: Matching purchasable numbers.
                        items:
                          type: object
                          additionalProperties: true
                          properties:
                            phoneNumber:
                              type: string
                              description: E.164 number available to buy.
                            country:
                              type: string
                            type:
                              type: string
                              description: Line type (`local` | `mobile` | `toll_free`).
                            capabilities:
                              type: array
                              items:
                                type: string
                            monthlyRate:
                              type: number
                              description: Recurring monthly price in dollars.
                            setupRate:
                              type: number
                              description: >-
                                One-time setup/activation fee in dollars, when
                                the carrier charges one.
                            sms_two_way:
                              type: boolean
                              description: >-
                                True when the number both sends AND receives
                                SMS.
                            rate_center:
                              type: string
                              description: >-
                                US rate center (exchange/wire-center) name, when
                                the carrier publishes one.
                            state:
                              type: string
                              description: >-
                                US state / CA province, when the carrier
                                publishes one.
                            lata:
                              type: string
                              description: >-
                                US LATA code resolved from the number's NANP
                                area code, when mapped.
                            lata_name:
                              type: string
                              description: >-
                                Canonical LATA / metro name for `lata`, e.g.
                                `NEW YORK METRO`.
                            distance_miles:
                              type: number
                              description: >-
                                Distance in miles from the `near_lat_lng` /
                                `near_postal_code` target, when a geo-proximity
                                search was supplied.
                      compliance:
                        type: object
                        additionalProperties: true
                        description: >-
                          Per-country purchase-compliance preflight for the
                          searched country.
                        properties:
                          country:
                            type: string
                          required:
                            type: boolean
                            description: >-
                              True when buying in this country requires a
                              compliance profile.
                          eligible:
                            type: boolean
                            description: >-
                              True when the caller's organization can purchase
                              in this country.
                      pagination:
                        type: object
                        additionalProperties: true
                        properties:
                          page:
                            type: integer
                          limit:
                            type: integer
                          total:
                            type: integer
                          total_pages:
                            type: integer
                          has_more:
                            type: boolean
                      setup_required:
                        type: boolean
                        description: >-
                          Present + true when every carrier is unconfigured —
                          render the 'contact support' CTA.
                      inventory_limited:
                        type: boolean
                        description: >-
                          Present + true when inventory is limited for this
                          country/type — suggest a different one.
                  meta:
                    type: object
                    properties:
                      request_id:
                        type: string
                        description: >-
                          Unique request identifier (also returned in
                          X-Request-Id header)
                      timestamp:
                        type: string
                        format: date-time
                        description: ISO 8601 UTC timestamp of the response
                example:
                  data:
                    numbers:
                      - phoneNumber: '+14155550100'
                        country: US
                        type: local
                        capabilities:
                          - sms
                          - voice
                        monthlyRate: 1
                        setupRate: 0
                        sms_two_way: true
                    compliance:
                      country: US
                      required: false
                      eligible: true
                    pagination:
                      page: 1
                      limit: 20
                      total: 1
                      total_pages: 1
                      has_more: false
                  meta:
                    request_id: req_01J9Z8ABCDEF
                    timestamp: '2026-08-11T12:00:00.000Z'
        '400':
          $ref: '#/components/responses/StandardError'
        '401':
          $ref: '#/components/responses/StandardError'
        '403':
          $ref: '#/components/responses/StandardError'
        '404':
          $ref: '#/components/responses/StandardError'
        '422':
          $ref: '#/components/responses/StandardError'
        '429':
          $ref: '#/components/responses/RateLimitedResponse'
        '500':
          $ref: '#/components/responses/StandardError'
components:
  responses:
    StandardError:
      description: >-
        Standard error envelope. `error.code` is machine-readable; see the
        [error reference](https://docs.orbit.devotel.io/reference/error-codes)
        for the catalogue.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                required:
                  - code
                  - message
                  - status
                properties:
                  code:
                    type: string
                    description: Machine-readable error code (e.g. INVALID_PHONE_NUMBER)
                  message:
                    type: string
                    description: Human-readable error description
                  status:
                    type: integer
                    description: HTTP status code
                  details:
                    type: object
                    additionalProperties: true
                    description: Additional context about the error
              meta:
                type: object
                properties:
                  request_id:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  docs_url:
                    type: string
                    format: uri
                    description: Link to relevant error documentation
    RateLimitedResponse:
      description: >-
        Rate limit exceeded. Wait `error.retry_after` seconds (or read the
        `Retry-After` header) before retrying. Returned when the request would
        exceed the bucket identified by `X-RateLimit-Bucket`.
      headers:
        X-RateLimit-Limit:
          description: Total request quota for the current window.
          schema:
            type: integer
            minimum: 0
        X-RateLimit-Remaining:
          description: Requests remaining in the current window.
          schema:
            type: integer
            minimum: 0
        X-RateLimit-Reset:
          description: >-
            Absolute unix-epoch-seconds timestamp at which the current window
            resets.
          schema:
            type: integer
            minimum: 0
        X-RateLimit-Bucket:
          description: >-
            Name of the rate-limit bucket the request was bound by (e.g.
            `auth-write`, `money`, `agent-invoke`, or `custom:<max>/<window>`).
            Stripe-style — lets clients see which named cap they hit.
          schema:
            type: string
        RateLimit-Limit:
          description: >-
            draft-ietf-httpapi-ratelimit-headers no-prefix mirror of
            `X-RateLimit-Limit`. Some SDKs read only this form.
          schema:
            type: integer
            minimum: 0
        RateLimit-Remaining:
          description: >-
            draft-ietf-httpapi-ratelimit-headers no-prefix mirror of
            `X-RateLimit-Remaining`.
          schema:
            type: integer
            minimum: 0
        RateLimit-Reset:
          description: >-
            draft-ietf-httpapi-ratelimit-headers no-prefix mirror — delta
            seconds from now until the window resets (NOT epoch).
          schema:
            type: integer
            minimum: 0
        Retry-After:
          description: >-
            RFC 7231 §7.1.3 — number of seconds the client should wait before
            retrying.
          schema:
            type: integer
            minimum: 1
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                required:
                  - code
                  - message
                  - status
                  - retry_after
                properties:
                  code:
                    type: string
                    enum:
                      - RATE_LIMITED
                    description: >-
                      Always `RATE_LIMITED` — the global request-limiter 429.
                      Distinct from `RATE_LIMIT_EXCEEDED`, the live
                      per-recipient/per-tenant/per-resource frequency-cap 429
                      (not retired).
                  message:
                    type: string
                  status:
                    type: integer
                    enum:
                      - 429
                  retry_after:
                    type: integer
                    minimum: 1
                    description: >-
                      Seconds to wait before retrying. Mirrors `Retry-After`
                      header.
              meta:
                type: object
                properties:
                  request_id:
                    type: string
                  timestamp:
                    type: string
                    format: date-time
                  docs_url:
                    type: string
                    format: uri
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Dashboard JWT token from Clerk
    ApiKey:
      type: apiKey
      name: X-API-Key
      in: header
      description: Server-to-server API key (dv_live_sk_*)

````