You can use the Available Number API to search for available numbers or activate an available number.
Numbers | Sinch (1.0.3)
The Numbers API enables you to search for, view, and activate numbers. It's considered a precursor to other APIs in the Sinch product family. The numbers API can be used in tandem with any of our APIs that perform messaging or calling. Once you have activated your numbers, you can then use the various other APIs, such as SMS or Voice, to assign and use those numbers.
Let's take a brief look at some of the formats used in the REST API.
JSON (application/json) is the content type of both requests and responses if not otherwise specified.
Requests with invalid JSON will be rejected.
Null values can be omitted in requests and will be omitted in responses. In some cases, explicitly setting null will overwrite a previously set value with null.
Only phone numbers in E.164 standard format are accepted by the API.
A summary of status codes can be found on the HTTP status codes page.
To successfully use callbacks with Numbers, add the following IP addresses to your allowlist:
- 54.76.19.159
- 54.78.194.39
- 54.155.83.128
New features might result in additional request and response parameters. New request parameters will either have a default value or be considered optional to retain backwards compatibility. It's highly recommended to ignore any unexpected parameters when reading JSON in API responses and in callback handlers.
Number Order
You can use the Number Order API to search for available numbers or activate an available number after providing KYC info.
Steps for buying a number via an order and providing the required KYC information:
- "Lookup number requirements" endpoint: look up country KYC requirements to establish which fields / information needs to be provided as part of buying the phone number. Also reveals if any attachment files need to be provided.
- "Search for available phone numbers" endpoint: search numbers you may want to buy.
- "Create a number order" endpoint: create the Number Order for a specific phone number or for a set of criteria (max 1 number per order supported now), which reserved the number for 48h, giving plenty of time to call the other endpoint to submit the fields required as revealed by the API at 1. and also to hit the final Submit endpoint.
- "Update number order registration" endpoint: update the order Registration (container for the actual KYC required fields / information revealed at step #1). This is validated on the spot for required / optional fields, fields lengths etc. (also revealed at step #1).
- "Upload an attachment for a number order" endpoint: upload file attachments - only if mandatory as per requirements revealed by step #1. AttachmentId necessary for the URL will be returned at step #1.
- "Submit number order" endpoint: submit the order - final step after creating the order and providing registration info and (if required) attachments
Numbers Callbacks
You can set up callback URLs to receive event notifications when your numbers are updated.
When delivering events the order is not guaranteed (for example, a failed event scheduled for retry will not block other events that were queued).
The client's callback handler must implement the state machine that can decide what to do with unexpected events, for example, "old" events or invalid state transitions. In these cases the handler could use the API to GET the latest state for the resource.
The callback handler is expected to "ingest" the event and respond with 200 OK. The domain-specific business logic and processes should be executed outside of the callback request, as internal asynchronous jobs.
To use callbacks, add the following IP addresses to your allowlist:
- 54.76.19.159
- 54.78.194.39
- 54.155.83.128