Search Available Numbers
Search for available phone numbers to rent from the Sinch Numbers API (by region, type, capability). Uses OAuth2.
IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.
Input
--region / -r: Region code (e.g. US, GB) - required
--type / -t: Number type: LOCAL, MOBILE, TOLL_FREE - optional
--capability / -c: Capability: SMS, VOICE (comma-separated for multiple) - optional
--page-size / -n: Results per page - optional, default 10
--format / -f: Output format (table or json) - optional
Arguments: $ARGUMENTS
Instructions
Execute these steps directly - do not write code or scripts:
If $ARGUMENTS empty: ask for region, optional type and capability. Otherwise parse.
Validate: --region (e.g. US, GB), optional type, capability, page-size. Get CONVERSATION_* or NUMBERS_* env vars. Numbers API: https://numbers.api.sinch.com/v1. If missing, report "Sinch API is not configured."
GET https://numbers.api.sinch.com/v1/projects/{projectId}/availableNumbers or equivalent with query params: regionCode, type, capabilities, pageSize. Use OAuth2.
Format response: table (number, type, region, capabilities) or JSON. Display "✅ Available numbers" with count. Handle 401, 404.
Handle all errors gracefully.
Examples
/sinch-api-numbers-search --region=US --type=LOCAL --capability=SMS
/sinch-api-numbers-search -r US -c SMS,VOICE -n 20
API Reference
1---2name: sinch-api-numbers-search3description: Search available phone numbers to rent via Sinch Numbers API4---56# Search Available Numbers78Search for available phone numbers to rent from the Sinch Numbers API (by region, type, capability). Uses OAuth2.910**IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.**1112## Input1314- `--region` / `-r`: Region code (e.g. US, GB) - required15- `--type` / `-t`: Number type: LOCAL, MOBILE, TOLL_FREE - optional16- `--capability` / `-c`: Capability: SMS, VOICE (comma-separated for multiple) - optional17- `--page-size` / `-n`: Results per page - optional, default 1018- `--format` / `-f`: Output format (table or json) - optional1920Arguments: $ARGUMENTS2122## Instructions2324**Execute these steps directly - do not write code or scripts:**25260. If $ARGUMENTS empty: ask for region, optional type and capability. Otherwise parse.27281. Validate: --region (e.g. US, GB), optional type, capability, page-size. Get CONVERSATION_* or NUMBERS_* env vars. Numbers API: https://numbers.api.sinch.com/v1. If missing, report "Sinch API is not configured."29302. GET https://numbers.api.sinch.com/v1/projects/{projectId}/availableNumbers or equivalent with query params: regionCode, type, capabilities, pageSize. Use OAuth2.31323. Format response: table (number, type, region, capabilities) or JSON. Display "✅ Available numbers" with count. Handle 401, 404.33344. Handle all errors gracefully.3536## Examples3738```39/sinch-api-numbers-search --region=US --type=LOCAL --capability=SMS40/sinch-api-numbers-search -r US -c SMS,VOICE -n 2041```4243## API Reference4445- **Base URL**: https://numbers.api.sinch.com/v146- **Active numbers**: GET /projects/{projectId}/activeNumbers47- **Available numbers**: Check Numbers API docs for search/available endpoint48- **Documentation**: https://developers.sinch.com/docs/numbers/