API for importing, hosting, and qualifying numbers to enable them for use with Sinch SMS text messaging services.
- API reference
- Imported and Hosted Numbers Overview
- List imported numbers
Imported Numbers and Hosting Orders (1.0)
https://imported.numbers.api.sinch.com/
Hosting Orders
Hosted numbers provide you with an easy method to port your SMS enabled numbers to Sinch or to use SMS messaging and other products to send and receive messages, on voice-enabled numbers (including landline numbers) that you already own.
Note: The SMS enablement process is only supported in United States and Canada.
The Hosting Orders API allows you to manage all the numbers that you are hosting on the Sinch platform. This includes numbers that you have ported to Sinch and/or any non- Sinch numbers that you already own and are hosting on Sinch to enable Sinch SMS messaging and other products.
Imported Numbers
Use the Imported Numbers API endpoints to list imported numbers or import a number that's already been provisioned with an NNID for use with Sinch. Imported numbers can be used with Sinch SMS services.
Note: The SMS enablement process is only supported in United States and Canada.
Found on your Sinch Customer Dashboard. Settings > Projects.
The hosting order servicePlanId
The hosting order campaignId
Region code to filter by. ISO 3166-1 alpha-2 country code of the phone number. Currently supported are US, CA
Sequence of digits to search for. If you prefer or need certain digits in sequential order, you can enter the sequence of numbers here. When using START, a plus sign (+) must be included and URL encoded. For example, to search for area code 206 in the US, the url encoded string would be %2B1206
Search pattern to apply. The options are, START, CONTAIN, and END. Numbers that begin with the numberPattern.pattern entered. Often used to search for a specific area code.
| Enum Value | Description |
|---|---|
| START | Number starts with specified pattern. |
| CONTAIN | Number contains specified pattern. |
| END | Number ends with specified pattern. |
The maximum number of items to return, server can enforce an upper limit and overwrite the value.
The next page token value returned from a previous listing.
- Global API
https://imported.numbers.api.sinch.com/v1/projects/{projectId}/importedNumbers
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://imported.numbers.api.sinch.com/v1/projects/d1923022-5199-4bb3-a513-c47b3a656bc5/importedNumbers?servicePlanId=324e4567-e89b-12d3-a456-426614174000&campaignId=123e4567-e89b-12d3-a456-426614174000®ionCode=US&numberPattern.pattern=%2B1732&numberPattern.searchPattern=START&pageSize=20&pageToken=C2VNYXJrEg4KDCsxMjAxMjI2MzUyOQ%3D%3D&orderBy=createdTime'{ "importedNumbers": [ { … } ], "nextPageToken": "string", "totalSize": 0 }
Request
You can use the Import Numbers API to import a non-Sinch number that you want to enable for SMS with Sinch as the Direct Connectivity Aggregator (DCA) without porting (or even partially porting) the number.
Note: Customers who are importing numbers (i.e. want to use their own NNID) will need to complete the NNID provisioning process to support proper message routing with the carriers. To learn more, refer to the article How can you provision a Network Number ID (NNID)?
Found on your Sinch Customer Dashboard. Settings > Projects.
ISO 3166-1 alpha-2 country code of the phone number. Example US, UK or SE.
Configuration for SMS
The current SMS configuration for this number. The `servicePlanId`` can be found when logging into dashboard.sinch.com in the SMS>APIs section.
The ID of the project resource. You can find your project ID on dashboard.sinch.com.
- Global API
https://imported.numbers.api.sinch.com/v1/projects/{projectId}/importedNumbers
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://imported.numbers.api.sinch.com/v1/projects/d1923022-5199-4bb3-a513-c47b3a656bc5/importedNumbers \
-H 'Content-Type: application/json' \
-d '{
"regionCode": "US",
"smsConfiguration": {
"servicePlanId": "YOUR_service_plan_id",
"campaignId": "YOUR_campaign_id",
"migrateToSinchTmo": true
},
"phoneNumber": "+11234567890",
"displayName": "MyPhoneNumber",
"callbackUrl": "https://www.your-callback-server.com/callback"
}'{ "phoneNumber": "+12025550134", "projectId": "YOUR_project_id", "regionCode": "US", "displayName": "MyPhoneNumber", "smsConfiguration": { "servicePlanId": "YOUR_service_plan_id", "scheduledProvisioning": { … }, "campaignId": "YOUR_campaign_id", "migrateToSinchTmo": true }, "callbackUrl": "https://www.your-callback-server.com/callback" }
Found on your Sinch Customer Dashboard. Settings > Projects.
- Global API
https://imported.numbers.api.sinch.com/v1/projects/{projectId}/importedNumbers/{phoneNumber}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://imported.numbers.api.sinch.com/v1/projects/d1923022-5199-4bb3-a513-c47b3a656bc5/importedNumbers/+12025550134'OK
The ID of the project resource. You can find your project ID on dashboard.sinch.com.
ISO 3166-1 alpha-2 country code of the phone number. Example US, UK or SE.
The client's callback URL to be called upon finishing the number import.
The mnoConfiguration object represents the status and progress of configuration operations for SMS and MMS services across different carriers (AT&T and T-Mobile). Each key within this object (smsAtt, smsTmo, mmsAtt and mmsTmo) corresponds to a specific service type (SMS or MMS) associated with a particular mobile network operator.
{ "phoneNumber": "+12025550134", "projectId": "YOUR_project_id", "regionCode": "US", "displayName": "MyPhoneNumber", "smsConfiguration": { "servicePlanId": "YOUR_service_plan_id", "scheduledProvisioning": { … }, "campaignId": "YOUR_campaign_id", "migrateToSinchTmo": true }, "callbackUrl": "https://www.your-callback-server.com/callback", "mnoConfiguration": { "smsAtt": { … }, "smsTmo": { … }, "mmsAtt": { … }, "mmsTmo": { … } }, "smsProvisioning": { "serviceType": "SMS", "serviceId": "0130a21c9ed6461ba3a1fefda83f7ec7", "type": "PROVISIONING", "state": "DONE", "updateTime": "2023-02-02T21:00:07.467353Z", "errorMessage": "", "errorCode": "" }, "campaignProvisioning": { "serviceType": "SMS", "serviceId": "CDCQLGJ", "type": "PROVISIONING", "state": "DONE", "updateTime": "2023-02-02T21:00:07.467353Z", "errorMessage": "", "errorCode": "" } }
Found on your Sinch Customer Dashboard. Settings > Projects.
- Global API
https://imported.numbers.api.sinch.com/v1/projects/{projectId}/importedNumbers/{phoneNumber}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
-u <username>:<password> \
'https://imported.numbers.api.sinch.com/v1/projects/d1923022-5199-4bb3-a513-c47b3a656bc5/importedNumbers/+12025550134'Request
Update an imported phone number. You can perform the following updates:
- Update the name that displays for a customer by modifying the
displayNameparameter. - Unlink the number from an SMS service or campaign by updating the
smsConfigurationconfiguration object. To unlink a number, submit the request with an empty string (””) in the service plan ID or campaign ID fields. - Before linking a number to a new service or campaign, it must be unlinked from any existing service or campaign. Then, link the number to a new SMS service or campaign by updating the service plan ID or campaign ID with the new desired value.
Found on your Sinch Customer Dashboard. Settings > Projects.
The ID of the project resource. You can find your project ID on dashboard.sinch.com.
ISO 3166-1 alpha-2 country code of the phone number. Example US, UK or SE.
- Global API
https://imported.numbers.api.sinch.com/v1/projects/{projectId}/importedNumbers/{phoneNumber}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
-u <username>:<password> \
'https://imported.numbers.api.sinch.com/v1/projects/d1923022-5199-4bb3-a513-c47b3a656bc5/importedNumbers/+12025550134' \
-H 'Content-Type: application/json' \
-d '{
"displayName": "My Display Name",
"smsConfiguration": {
"servicePlanId": "",
"campaignId": ""
},
"callbackUrl": "https://www.your-callback-server.com/callback"
}'{ "phoneNumber": "+12025550134", "projectId": "YOUR_project_id", "regionCode": "US", "displayName": "MyPhoneNumber", "smsConfiguration": { "servicePlanId": "YOUR_service_plan_id", "scheduledProvisioning": { … }, "campaignId": "YOUR_campaign_id", "migrateToSinchTmo": true }, "callbackUrl": "https://www.your-callback-server.com/callback" }
Qualified Numbers
You can use the Qualified Numbers API to qualify numbers you want Sinch to host and have available for use with Sinch SMS services. Qualifying a number involves verifying ownership of a number either by providing a one time passcode sent to the number by voice call or by providing invoices for multiple numbers. Once numbers are qualified, you can then enable those numbers for SMS text messaging services.
Note: The SMS enablement process is only supported in United States and Canada.
Imported Numbers and Hosting Orders 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