sinch-numbers-api
Sinch Numbers API
The Numbers API lets you search, activate, manage, and release phone numbers — the prerequisite for SMS, Voice, and Conversation APIs.
Instructions
Step 1: Choose approach
- SDK project? Default to SDK if
@sinch/sdk-core(Node),sinch(Python), orcom.sinch.sdk(Java) is present. - Direct HTTP? Use curl/fetch with Basic auth.
For SDK code, read the correct reference before generating any code:
| Language | Reference | SDK docs |
|---|---|---|
| TypeScript/Node.js | references/typescript.md | Syntax reference |
| Python | references/python.md | Syntax reference |
| Java | references/java.md | Syntax reference |
For direct HTTP calls, see Numbers API Reference.
Step 2: Authenticate
See sinch-authentication for full setup.
Step 3: Verify connectivity
curl -X GET \
"https://numbers.api.sinch.com/v1/projects/$SINCH_PROJECT_ID/activeNumbers?regionCode=US&type=LOCAL&pageSize=10" \
-H "Authorization: Bearer $SINCH_ACCESS_TOKEN" \
-H "Content-Type: application/json"
A 200 response confirms credentials and project access.
Key Concepts
- Active Number — A phone number currently rented and owned by your project. Managed via
/activeNumbers. - Available Number — A phone number available for rent in a given region and type. Searched via
/availableNumbers. - Number Type —
LOCAL,MOBILE, orTOLL_FREE. Required when searching or listing numbers. - Region Code — ISO 3166-1 alpha-2 country code (e.g.,
US,GB,SE). Required for search and list operations. - SMS Configuration — Settings for SMS on a number:
servicePlanId,campaignId(US 10DLC only),scheduledProvisioningstatus. - Voice Configuration — Discriminated union on
type:RTC(requiresappId),EST(requirestrunkId),FAX(requiresserviceId). - Callback Configuration — Project-level HMAC secret for signature verification on number lifecycle webhooks. Does NOT set a callback URL.
- Scheduled Provisioning — Async provisioning status for SMS/voice config. Status values:
WAITING,IN_PROGRESS,FAILED.
Workflows
Search and rent a number
GET /availableRegions— discover validregionCodevaluesGET /availableNumbers?regionCode={code}&type={type}— search (both params required)- Pick a number →
POST /availableNumbers/{phoneNumber}:rentwith config body GET /activeNumbers/{phoneNumber}— confirm activation
Use POST /availableNumbers:rentAny to skip step 3 (US LOCAL numbers only).
Safe retries for billable operations
Before retrying any potentially billable action (for example :rent, :rentAny, or :release) after an incomplete/uncertain response:
- Check current state first using a read endpoint (
GET /activeNumbers/{phoneNumber}orGET /activeNumberswith filters) - Retry only if the verification shows the prior action did not succeed
- If state is ambiguous, prefer listing active numbers and matching on
phoneNumberbefore issuing another billable request
Update number configuration
GET /activeNumbers/{phoneNumber}— check current configPATCH /activeNumbers/{phoneNumber}— setdisplayName,smsConfiguration, orvoiceConfiguration- To unlink, send empty string
""inservicePlanIdorcampaignId
Release a number
POST /activeNumbers/{phoneNumber}:release
Fetch all numbers to JSON
Run node scripts/get_numbers.cjs --output numbers.json (uses SINCH_PROJECT_ID, SINCH_KEY_ID, SINCH_KEY_SECRET env vars). Supports --region and --type filters.
Emergency addresses
Use the emergency address endpoints on active numbers: GET, provision, deprovision, validate. See API reference.
Number orders (KYC-regulated regions)
Use the numberOrders endpoints: lookupNumberRequirements → createNumberOrder → upload registration/attachments → submit. See API reference.
Imported numbers
A separate API at https://imported.numbers.api.sinch.com handles importing non-Sinch numbers (DCA) and hosting orders. See API reference.
Gotchas
- Param names differ between endpoints:
GET /activeNumbersusescapability(singular) andpageSize.GET /availableNumbersusescapabilities(plural) andsize(single page, no pagination). typedefaults toMOBILE— omitting it returns only MOBILE numbers, not all types.- Always set
pageSizeexplicitly onGET /activeNumbers— no documented default. rentAnyis US LOCAL only — use:rentfor other types/regions.- Do not blindly retry billable actions — if output is incomplete, verify state via
GET /activeNumbers/{phoneNumber}(or list + filter) before retrying:rent,:rentAny, or:release. - Never pass both config objects unnecessarily — sending empty
voiceConfigurationwhen you only need SMS will error. - Unlink before relinking — a number must be detached from its current service/campaign before attaching to a new one.
campaignIdis US-only — required for 10DLC, irrelevant elsewhere.scheduledProvisioning/scheduledVoiceProvisioningare objects (withstatus,lastUpdatedTime,errorCodes), not strings. Status values:PROVISIONING_STATUS_UNSPECIFIED,WAITING,IN_PROGRESS,FAILED.voiceConfigurationis a discriminated union ontype:RTC→appId,EST→trunkId,FAX→serviceId.- Callback config (
PATCH /callbackConfiguration) sets onlyhmacSecretfor HMAC-SHA1 signature verification — it does not set a callback URL. - Callback IP allowlist:
54.76.19.159,54.78.194.39,54.155.83.128.
Links
More from sinch/skills
sinch-conversation-api
Sends and receives omnichannel messages with Sinch Conversation API. One unified API for SMS, WhatsApp, RCS, MMS, Viber, Messenger, and more. Use when sending texts, WhatsApp messages, rich cards, carousels, templates, batch messages, or building multi-channel messaging.
80sinch-authentication
Configures Sinch API credentials and authentication. Use when setting up OAuth2, Basic auth, application signing, or API keys for any Sinch product including Conversation API, Voice, Verification, Numbers, Fax, and Mailgun. Also use when troubleshooting 401 Unauthorized, 403 Forbidden, invalid signature, or credential errors against any Sinch API. For SDKs usage, see sinch-sdks.
75sinch-mailgun
Sends, receives, and tracks email via the Mailgun (Sinch) API. Use when the user wants to send email, manage domains, configure webhooks, query email events/logs, manage templates, handle suppressions (bounces, unsubscribes, complaints), set up inbound routes, manage mailing lists, DKIM keys, or IP warmup using Mailgun.
73sinch-provisioning-api
Provisions and manages channel resources for Conversation API projects, including WhatsApp accounts/senders/templates, RCS senders, KakaoTalk senders/templates, webhooks, and bundles. Use when the user asks to onboard channels, configure provisioning webhooks, manage templates, orchestrate multi-service bundles, or automate channel setup.
72sinch-10dlc
Registers US 10DLC brands and campaigns with Sinch for A2P SMS messaging. Use when the user needs to register a brand, create a 10DLC campaign, check registration status, troubleshoot a 10DLC rejection, fix an EIN mismatch, upgrade from simplified to full registration, or qualify a campaign for US SMS sending on 10-digit long codes. Do NOT use for non-US messaging or toll-free/short code registration.
68sinch-number-lookup-api
Looks up phone number details via Sinch Number Lookup API. Use when checking carrier, line type, porting status, SIM swap, VoIP detection, or reassigned number detection (RND) for fraud prevention or routing decisions.
68