Skip to main content

Get Available Numbers

Agent Skill

Automate this endpoint with an AI agent using the 2chat-numbers skill:

npx skills add 2ChatCo/agent-skills -s 2chat-numbers

Get specific available phone numbers within a number group. Use this after finding a group via the Search Number Groups endpoint.

Endpointโ€‹

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

Authenticationโ€‹

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

API costโ€‹

1API credit

Each call to this endpoint deducts 1 API credit from your plan's API credit pool.

Parametersโ€‹

These are query-string parameters.

FieldTypeRequiredDescription
group_idstringYesThe group ID from the Search Number Groups endpoint
number_containsstringNoFilter numbers containing this digit sequence

Invocationโ€‹

curl --location --request GET 'https://api.p.2chat.io/open/numbers/available?group_id=abc-123' \
--header 'X-User-API-Key: your_api_key_here'

Responseโ€‹

Successโ€‹

{
"success": true,
"data": {
"numbers": [
{
"id": "did-xyz",
"number": "+12135551234"
}
]
}
}
FieldDescription
numbers[].idThe DID identifier for this number
numbers[].numberThe phone number in E.164 format

Errorโ€‹

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