Skip to main content

Get Regions

Get the available regions for a given country. Use this as the first step when browsing phone numbers to purchase.

Endpoint

GET https://api.p.2chat.io/open/numbers/regions

Authentication

Include your API key in the X-User-API-Key header. Learn more about authentication.

Parameters

These are query-string parameters.

FieldTypeRequiredDescription
countrystringYesISO country code (e.g. US, BR, DE)

Invocation

curl --location --request GET 'https://api.p.2chat.io/open/numbers/regions?country=US' \
--header 'X-User-API-Key: your_api_key_here'

Response

Success

{
"success": true,
"data": {
"regions": [
{
"id": 123,
"region_name": "California",
"iso_country_code": "US"
}
]
}
}
FieldDescription
regions[].idRegion ID to use with other endpoints (e.g. filtering cities)
regions[].region_nameHuman-readable name of the region
regions[].iso_country_codeISO country code the region belongs to

Error

{
"success": false,
"error": true,
"error_message": "Description of what went wrong"
}