Microsoft Azure Communication Services Find and purchase available phone numbers API

The Find and purchase available phone numbers API from Microsoft Azure Communication Services — 3 operation(s) for find and purchase available phone numbers.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Numbering Resource Management BC-2640.30

Operations 3

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /availablePhoneNumbers/countries/{countryCode}/:search Search available phone numbers to buy · Search for available phone numbers to purchase #
Ask an LLM
“Which phone numbers are available to buy in the US?”
“Can I find toll-free numbers for a specific area code?”
Tell an agent
Search available {phoneNumberType} numbers in {countryCode} with capabilities {capabilities}.
Find {quantity} {phoneNumberType} numbers in {countryCode} for {assignmentType} with area code {areaCode}.
GET /availablePhoneNumbers/searchResults/{searchId} Get a phone number search result · Gets a phone number search result by search id #
Ask an LLM
“What numbers did my phone number search return?”
“Can I check a phone number search result by its id?”
Tell an agent
Get phone number search result {searchId}.
Show the numbers found in search {searchId}.
POST /availablePhoneNumbers/:purchase Purchase phone numbers · Purchases phone numbers #
Ask an LLM
“How do I buy the phone numbers from a search?”
“Can I agree not to resell the numbers I purchase?”
Tell an agent
Purchase the numbers from search {searchId}.
Buy the numbers found in search {searchId} and agree to not resell them.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-communication-services:microsoft-azure-communication-services-find-and-purchase-available-phone-numbers-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-communication-services-find-and-purchase-available-phone-numbers-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PhoneNumbersClient Find and purchase available phone…
  description: The phone numbers client uses Azure Communication Services to purchase and manage phone numbers.
  version: '2025-06-01'
tags:
- name: Find and purchase available phone numbers
paths:
  /availablePhoneNumbers/countries/{countryCode}/:search:
    post:
      tags:
      - Find and purchase available phone numbers
      summary: Search for available phone numbers to purchase
      operationId: PhoneNumbers_SearchAvailablePhoneNumbers
      parameters:
      - in: path
        name: countryCode
        description: The ISO 3166-2 country code, e.g. US.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '202':
          description: The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' and 'Location' headers. Client side should further query the operation status using the URL specified in 'Operation-Location' header. When operation completes successfully query final result using URL specified in 'Location' header.
          headers:
            Location:
              description: URL to retrieve the final result after operation completes.
              schema:
                type: string
            Operation-Location:
              description: URL to query for status of the operation.
              schema:
                type: string
            operation-id:
              description: The operation id.
              schema:
                type: string
            search-id:
              description: The search operation id.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberSearchResult'
        default:
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
      x-ms-long-running-operation: true
      x-ms-long-running-operation-options:
        final-state-via: location
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneNumberSearchRequest'
        description: The phone number search request.
        required: true
  /availablePhoneNumbers/searchResults/{searchId}:
    get:
      tags:
      - Find and purchase available phone numbers
      summary: Gets a phone number search result by search id
      operationId: PhoneNumbers_GetSearchResult
      parameters:
      - in: path
        name: searchId
        description: The search Id.
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberSearchResult'
        default:
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
  /availablePhoneNumbers/:purchase:
    post:
      tags:
      - Find and purchase available phone numbers
      summary: Purchases phone numbers
      operationId: PhoneNumbers_PurchasePhoneNumbers
      parameters:
      - $ref: '#/components/parameters/ApiVersionParameter'
      responses:
        '202':
          description: The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' header. Client side should further query the operation status using the URL specified in 'Operation-Location' header.
          headers:
            Operation-Location:
              description: URL to query for status of the operation.
              schema:
                type: string
            operation-id:
              description: The operation id.
              schema:
                type: string
            purchase-id:
              description: The purchase operation id.
              schema:
                type: string
        default:
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommunicationErrorResponse'
      x-ms-long-running-operation: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhoneNumberPurchaseRequest'
        description: The phone number purchase request
        required: true
components:
  schemas:
    PhoneNumberCapabilities:
      description: Capabilities of a phone number.
      required:
      - calling
      - sms
      type: object
      properties:
        calling:
          description: Capability value for calling.
          enum:
          - none
          - inbound
          - outbound
          - inbound+outbound
          type: string
          x-ms-enum:
            name: PhoneNumberCapabilityType
            modelAsString: true
        sms:
          description: Capability value for SMS.
          enum:
          - none
          - inbound
          - outbound
          - inbound+outbound
          type: string
          x-ms-enum:
            name: PhoneNumberCapabilityType
            modelAsString: true
    PhoneNumberSearchRequest:
      description: Represents a phone number search request to find phone numbers. Found phone numbers are temporarily held for a following purchase.
      required:
      - assignmentType
      - capabilities
      - phoneNumberType
      type: object
      properties:
        phoneNumberType:
          description: The type of phone numbers to search for, e.g. geographic, tollFree, mobile.
          enum:
          - geographic
          - tollFree
          - mobile
          type: string
          x-ms-enum:
            name: PhoneNumberType
            modelAsString: true
        assignmentType:
          description: The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application.
          enum:
          - person
          - application
          type: string
          x-ms-enum:
            name: PhoneNumberAssignmentType
            modelAsString: true
        capabilities:
          $ref: '#/components/schemas/PhoneNumberCapabilities'
        areaCode:
          description: The area code of the desired phone number, e.g. 425.
          type: string
        quantity:
          format: int32
          description: The quantity of desired phone numbers. The default value is 1.
          default: 1
          maximum: 2147483647
          minimum: 1
          type: integer
    PhoneNumberPurchaseRequest:
      description: The phone number search purchase request.
      type: object
      properties:
        searchId:
          description: The search id.
          type: string
        agreeToNotResell:
          description: The agreement to not resell the phone numbers. Defaults to false if not provided.
          type: boolean
    PhoneNumberCost:
      description: The incurred cost for a single phone number.
      required:
      - amount
      - billingFrequency
      - currencyCode
      type: object
      properties:
        amount:
          format: double
          description: The cost amount.
          type: number
        currencyCode:
          description: The ISO 4217 currency code for the cost amount, e.g. USD.
          type: string
        billingFrequency:
          description: The frequency with which the cost gets billed.
          enum:
          - monthly
          type: string
          x-ms-enum:
            name: BillingFrequency
            modelAsString: true
    PhoneNumberSearchResult:
      description: The result of a phone number search operation.
      required:
      - assignmentType
      - capabilities
      - cost
      - phoneNumbers
      - phoneNumberType
      - searchExpiresBy
      - searchId
      type: object
      properties:
        searchId:
          description: The search id.
          type: string
        phoneNumbers:
          description: The phone numbers that are available. Can be fewer than the desired search quantity.
          type: array
          items:
            type: string
        phoneNumberType:
          description: The phone number's type, e.g. geographic, tollFree, mobile.
          enum:
          - geographic
          - tollFree
          - mobile
          type: string
          x-ms-enum:
            name: PhoneNumberType
            modelAsString: true
        assignmentType:
          description: Phone number's assignment type.
          enum:
          - person
          - application
          type: string
          x-ms-enum:
            name: PhoneNumberAssignmentType
            modelAsString: true
        capabilities:
          $ref: '#/components/schemas/PhoneNumberCapabilities'
        cost:
          $ref: '#/components/schemas/PhoneNumberCost'
        searchExpiresBy:
          format: date-time
          description: The date that this search result expires and phone numbers are no longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z.
          type: string
        isAgreementToNotResellRequired:
          description: Indicates if do not resell agreement is required. If true, the phone numbers cannot be acquired unless the customer provides explicit agreement to not resell them.
          type: boolean
        errorCode:
          format: int32
          description: The error code of the search.
          type: integer
        error:
          description: Mapping Error Messages to Codes
          enum:
          - NoError
          - UnknownErrorCode
          - OutOfStock
          - AuthorizationDenied
          - MissingAddress
          - InvalidAddress
          - InvalidOfferModel
          - NotEnoughLicenses
          - NoWallet
          - NotEnoughCredit
          - NumbersPartiallyAcquired
          - AllNumbersNotAcquired
          - ReservationExpired
          - PurchaseFailed
          - BillingUnavailable
          - ProvisioningFailed
          - UnknownSearchError
          type: string
          x-ms-enum:
            name: Error
            modelAsString: true
    CommunicationErrorResponse:
      description: The Communication Services error.
      type: object
      required:
      - error
      properties:
        error:
          description: The Communication Services error.
          $ref: '#/components/schemas/CommunicationError'
    CommunicationError:
      description: The Communication Services error.
      type: object
      required:
      - code
      - message
      properties:
        code:
          type: string
          description: The error code.
        message:
          type: string
          description: The error message.
        target:
          type: string
          readOnly: true
          description: The error target.
        details:
          type: array
          items:
            $ref: '#/components/schemas/CommunicationError'
          readOnly: true
          description: Further details about specific errors that led to this error.
        innererror:
          x-ms-client-name: innerError
          readOnly: true
          $ref: '#/components/schemas/CommunicationError'
          description: The inner error if any.
  parameters:
    ApiVersionParameter:
      in: query
      name: api-version
      description: Version of API to invoke
      required: true
      x-ms-parameter-location: client
      schema:
        type: string
  securitySchemes:
    azure_auth:
      type: oauth2
      flows:
        implicit:
          scopes:
            user_impersonation: impersonate your user account
          authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
      description: Azure Active Directory OAuth2 Flow
x-ms-parameterized-host:
  hostTemplate: '{endpoint}'
  useSchemePrefix: false
  parameters:
  - $ref: '#/components/parameters/Endpoint'