API referencePhone

Search available phone numbers to buy

Searches carrier inventory for numbers you can buy — this reads live availability, not the numbers you already own.

Endpoint
GET https://api.dairo.app/v1/phone/numbers/available

Searches carrier inventory for numbers you can buy — this reads live availability, not the numbers you already own. Narrow the search with country (ISO 3166-1 alpha-2, defaults to US; a value that is not two letters is a 400), areaCode, contains (digits the number must include), and type; limit accepts 1–100 and defaults to 10. Each result includes phoneNumber, numberType, locality, region, capabilities, monthlyCostUsd, setupCostUsd, and purchasable. Numbers your account cannot yet buy — for example because they require identity verification — come back with purchasable: false and a masked phoneNumber. Requires the phone:read scope.

Scope: phone:read. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl "https://api.dairo.app/v1/phone/numbers/available" \
  -H "Authorization: Bearer $DAIRO_API_KEY"

Query parameters

NameTypeRequiredDescription
countrystringnoISO 3166-1 alpha-2 country code. Defaults to US. (min length 2, max length 2)
areaCodestringnoNational destination code (e.g. 415).
containsstringnoDigits the number must contain.
type"local", "toll_free", "national", "mobile"noNumber type.
limitintegernoMaximum results (1-100). Defaults to 10. (minimum 1, maximum 100)

Response

200 Success. Body: application/json, AvailablePhoneNumberListResponse.

FieldTypeRequiredDescription
object"list"yes
dataarray of AvailablePhoneNumberyes
200
{
  "object": "list",
  "data": [
    {
      "object": "phone_number.available",
      "phoneNumber": "string",
      "countryCode": "string",
      "numberType": "string",
      "locality": null,
      "region": null,
      "capabilities": [
        "string"
      ],
      "monthlyCostUsd": null,
      "setupCostUsd": null,
      "purchasable": true
    }
  ]
}

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page