sinch-number-order-api
Number Order API
Order phone numbers with KYC compliance through a guided multi-step workflow. Required in countries where number purchases need identity verification.
Agent Instructions
This is a sequential, fragile workflow — steps must be followed in order. Do not combine API calls. Step 2 may be skipped if the user already has a specific E.164 number.
Before starting, collect from the user:
- Country — ISO 3166-1 alpha-2 region code (e.g.
AU,DE,BR) - Number type —
MOBILE,LOCAL, orTOLL_FREE - Specific number or quantity? — E.164 phone number, or quantity + criteria
- SMS or Voice?
- SMS → needs
servicePlanId(+campaignIdfor US 10DLC) - Voice → needs
type(RTC/EST/FAX) + corresponding ID (appId/trunkId/serviceId)
- SMS → needs
For authentication setup, see the authentication skill.
Workflow
Execute in order. Report state to the user after each step.
- Step 1 — Lookup requirements:
POST /v1/projects/{projectId}/numberOrders:lookupNumberRequirementswithregionCode+numberType. Save the response — it defines KYCfieldsschema andattachments(withid,mandatory,allowedMimeTypes,allowedDocumentTypes). Tell the user what's needed. - Step 2 — Search available numbers (skip if user has a specific number):
GET /v1/projects/{projectId}/availableNumbers?regionCode=XX&type=YY. Optional filters:capabilities,numberPattern.pattern,numberPattern.searchPattern,size. Present results and let user choose. - Step 3 — Create order:
POST /v1/projects/{projectId}/numberOrders:createNumberOrder. UsenumberOrderOption(specific phones) orquantityOrderOption(criteria-based) — never both. SaveidNumberOrderandexpireTimefrom response. - Step 4 — Submit registration:
PUT /v1/projects/{projectId}/numberOrders/{numberOrderId}/registration. PopulaterequestDetails.datausing the schema from Step 1. Returns 400 on validation errors — fix and retry. UseGET /v1/projects/{projectId}/numberOrders/{numberOrderId}/registrationto review. - Step 5 — Upload attachments (if Step 1 returned mandatory attachments):
POST /v1/projects/{projectId}/numberOrders/{numberOrderId}/attachments/{attachmentId}asmultipart/form-data. CheckallowedMimeTypesbefore uploading. - Step 6 — Submit order:
POST /v1/projects/{projectId}/numberOrders/{numberOrderId}/submit. State becomesIN_REVIEW.
The 48-hour clock starts at Step 3. Steps 4–6 must complete before the order expires.
Check status anytime: GET /v1/projects/{projectId}/numberOrders/{numberOrderId}
Order States
CREATED → IN_REVIEW → COMPLETED | REJECTED | EXPIRED | BLOCKED | NUMBER_ORDER_STATE_UNSPECIFIED
Canonical Example — Lookup Requirements (Step 1)
Base URL: https://numbers.api.sinch.com. Auth: OAuth2 bearer token (recommended) or Basic.
Store credentials in environment variables — never hardcode tokens or keys in commands or source code:
export SINCH_PROJECT_ID="your-project-id"
export SINCH_ACCESS_TOKEN="your-oauth-token"
curl -X POST \
"https://numbers.api.sinch.com/v1/projects/$SINCH_PROJECT_ID/numberOrders:lookupNumberRequirements" \
-H "Authorization: Bearer $SINCH_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"regionCode": "AU", "numberType": "MOBILE"}'
For all other endpoints, request/response schemas, and field-level details, see the Number Order API Reference.
Error Recovery
- Step 3 fails (number unavailable) — go back to Step 2, pick a different number, and retry Step 3.
- Step 4 returns 400 — read the error response, fix the
datafields, and PUT again. No need to recreate the order. - Order expires — start over from Step 1. The
idNumberOrderis no longer valid. - Order rejected — check the rejection reason in the GET response, correct KYC data, and create a new order.
Gotchas
- 48-hour expiry — reservation starts at order creation (Step 3), not at submission.
- Country-specific KYC — the
dataschema varies per country. Always use Step 1 output — never hardcode. - Attachments are conditional — only required when Step 1 says
mandatory: true. - Registration validation is synchronous — Step 4 returns 400 immediately on bad data.
- E.164 required — phone numbers must include the
+prefix. - Auth is Key ID / Key Secret — not the project ID.
callbackUrl— optional on order creation. Allowlist IPs:54.76.19.159,54.78.194.39,54.155.83.128.
Common Patterns
- Simple number purchase (KYC country) — Steps 1–6 in order. Most common flow.
- Bulk number purchase — Use
quantityOrderOptionin Step 3 with criteria instead of specific numbers. - Check order status —
GET /v1/projects/{projectId}/numberOrders/{numberOrderId}to poll for state transitions. - Retry after rejection — Check rejection reason, correct KYC data, create a new order from Step 1.
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-numbers-api
Search, rent, manage, and release phone numbers with the Sinch Numbers API. Use when listing active numbers, searching available numbers, renting or releasing numbers, updating number configuration (SMS/voice/callback), managing emergency addresses, or checking available regions.
70sinch-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.
68