Skip to content

Elastic SIP Trunk API (1.0.0)

This document provides a detailed user guide and reference documentation on the Sinch Elastic SIP Trunk API. For information on how to authenticate API requests, please check the Authentication section.

Authentication

Elastic SIP Trunk API supports both basic and OAuth2 authentication types.

Basic

HTTP Basic authentication works on all Sinch REST APIs. Basic auth is often the preferred option for testing because it is simple and easy to use.

Important!

Basic authentication is intended for test purposes only, and should only be used for experimenting with APIs and building prototypes. API calls using basic authentication are heavily rate limited, and these limits may change at any time without warning. Production systems should use OAuth access tokens instead.

Basic authentication is sent in the authorization header with each call.

No matter the programming language, there are three main components for successful basic authentication in a request:

  • The designation of authorization type, which is basic
  • The username, which in Sinch's case is YOUR_Key_ID, corresponding to your project
  • The password, which is YOUR_Key_Secret, again, corresponding to the project

You can view and manage your API credentials here.

Need help?

Check out this article for a walk-through on finding your key and secret.

To use basic auth in an API call, do the following:

  1. First, create a new access key in the Sinch Build Dashboard by clicking Create Access Key.

  2. Copy your project ID, key ID, and key secret.

    Important!

    Keep your key secret somewhere safe as it is only viewable upon initial project creation. The project ID and key ID are always readily available in the Sinch Build Dashboard. If you misplace your key secret, simply generate a new key!

  3. Use your key ID as the username (sometimes called the client_id) and your key secret as the password (can be referred to as the client_secret) in every call made to a Sinch API.

OAuth2

Achieve more secure API authentication with OAuth 2.0 access tokens.

Access tokens are short lived. Typically, they will only last one hour. This is done to keep your data (and ours) safer.

In exchanging credentials, you'll get a long string called an access token. This access token will serve as your bearer token in the authorization header of API calls.

Find your credentials in the Sinch Build Dashboard.

There are two pieces of information needed to obtain an access token: the key ID and key secret corresponding to your project ID.

To get an access token, do the following:

  1. Login to the Sinch Build Dashboard to get your access keys.

  2. Click on Create Access Key and when prompted, enter a display name, then click Confirm.

    Does it have to be a new key?

    Not at all. If you have existing credentials saved, feel free to use them.

  3. A Key ID and Key Secret will display. Save the project ID, key ID, and key secret someplace safe.

    Important!

    The key secret is only viewable at the time of initial creation.

    If you accidentally misplace they key secret, no worries! Create a new key.

  4. Using the following curl command, get your access token using the key ID and key secret.

    curl https://auth.sinch.com/oauth2/token \
    -d grant_type=client_credentials \
    -u YOUR_Key_ID:YOUR_Key_Secret
  5. You'll see your new access token in the response. Now you're ready to use this token on calls to the API. The access token will be useable for one hour.

Short lived

The access token is meant to be short lived for enhanced security. Generate one as often as it is necessary.

Servers

Elastic SIP Trunk API serves all endpoints from the following server:

https://elastic-trunking.api.sinch.com/v1/projects/{projectId}

Note:

The projectId is a required parameter you must include when making any API calls. You can find your project ID on your dashboard.

Download OpenAPI description
Overview
support at sinch

support@sinch.com

License

MIT

Languages
Servers

https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/

SIP Trunks

The SIP Trunks endpoint has operations that allow you to create, view, update, and remove SIP trunks.

Operations

SIP Endpoints

A SIP endpoint is the resource that represents your SIP infrastructure, typically an SBC. Note the Elastic SIP Trunk API does not support user registration and presence.

Operations

Country Permissions

Country permissions are used to control which countries can be dialed from a specific SIP trunk. You can view, update, and remove country permissions. For beta, only US, CA and wild card are supported. Please note that these permissions are not per trunk but rather they are per project/account. In the future Sinch may extend these permissions to other voice and messaging products. If you are using sub-projects you can use the same country permissions for all sub-projects. You can also specify different country permissions for each sub-project that will override the parent country permissions.

Operations

Phone Numbers

The /phoneNumbers endpoint has operations that allow you to assign and remove phone numbers from SIP trunks.

Operations

Calls

The /calls endpoint has operations that allow you to retrieve call history and details about calls made or received using EST.

Operations

Access Control List

The Access Control List (ACL) endpoint has operations that allow you to create, view, update, and remove ACLs. You use ACLs to control which IP addresses can send traffic to your SIP trunk. You can create multiple ACLs and assign them to multiple SIP trunks. In order to make outbound calls you need to have at least one ACL set up.

Operations

Request

Fetches the list of Access Control List entries.

Security
Basic or OAuth2.0
curl -i -X GET \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists'

Responses

The list of ACL entries

Bodyapplication/json
accessControlListsArray of objects(AccessControlList)
totalItemsinteger(int32)read-only

Total size of the result.

Example: 10000
pageNumberstringread-only

The token to be used for listing the next page

Example: "1"
pageSizeinteger(int32)read-only

The number of items per page. default is 1000

Example: 2000
Response
application/json

List all access control lists for the project.

{ "accessControlLists": [ {}, {} ], "pageNumber": "1", "pageSize": 1000, "totalItems": 2 }

Request

Create an access control list entry with at least one IP address or IP range.

Security
Basic or OAuth2.0
Bodyapplication/json
namestringrequired

Your name for the access control list entry.

Example: "LA Office"
ipRangesArray of objects(IpRange)non-emptyrequired

The associated IP ranges. When creating you need to submit at least one IP range.

ipRanges[].​descriptionstring

A description of the IP range.

Example: "West wing of office"
ipRanges[].​ipAddressstring

The start of the IP range.

Example: "10.0.1.1"
ipRanges[].​rangeinteger

A range, also known as a CIDR, represents the number of leading bits that define the network portion of an IP address in CIDR notation. The range is specified after a slash (/) at the end of the IP address. The remaining bits define specific hosts within the network.

  • 10.0.0.0/8: Represents all IP addresses from 10.0.0.0 to 10.255.255.255, allowing for over 16 million unique host addresses.
  • 172.16.0.0/16: Includes all IP addresses from 172.16.0.0 to 172.16.255.255, providing up to 65,536 unique host addresses.
  • 192.168.1.0/24: Encompasses all IP addresses from 192.168.1.0 to 192.168.1.255, offering 256 unique host addresses.
  • 192.168.1.0/32: Encompasses one ip address
Default 32
Example: 32
enabledboolean

Whether the access control list entry is enabled. You can use this to disable an list temporarily without deleting it.

Default true
curl -i -X POST \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "My new ACL",
    "enabled": true,
    "ipRanges": [
      {
        "description": "Location 1",
        "ipAddress": "15.15.15.15",
        "range": 20
      }
    ]
  }'

Responses

The list of access control list entries

Bodyapplication/json
namestringrequired

Your name for the access control list entry.

Example: "LA Office"
ipRangesArray of objects(IpRange)non-emptyrequired

The associated IP ranges. When creating you need to submit at least one IP range.

ipRanges[].​idstringread-only

The ID of the IP range.

ipRanges[].​descriptionstring

A description of the IP range.

Example: "West wing of office"
ipRanges[].​ipAddressstring

The start of the IP range.

Example: "10.0.1.1"
ipRanges[].​rangeinteger

A range, also known as a CIDR, represents the number of leading bits that define the network portion of an IP address in CIDR notation. The range is specified after a slash (/) at the end of the IP address. The remaining bits define specific hosts within the network.

  • 10.0.0.0/8: Represents all IP addresses from 10.0.0.0 to 10.255.255.255, allowing for over 16 million unique host addresses.
  • 172.16.0.0/16: Includes all IP addresses from 172.16.0.0 to 172.16.255.255, providing up to 65,536 unique host addresses.
  • 192.168.1.0/24: Encompasses all IP addresses from 192.168.1.0 to 192.168.1.255, offering 256 unique host addresses.
  • 192.168.1.0/32: Encompasses one ip address
Default 32
Example: 32
ipRanges[].​createTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
ipRanges[].​updateTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
ipRanges[].​projectIdstringread-only

The ID of the project.

ipRanges[].​accessControlListIdstringread-only

The ID of the access control list.

idstringread-only

The ID of the access control list entry.

enabledboolean

Whether the access control list entry is enabled. You can use this to disable an list temporarily without deleting it.

Default true
trunksArray of stringsread-only

The associated SIP trunks ID.

createTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
updateTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
projectIdstringread-only

The ID of the project.

Response
application/json

The newly created access control list.

{ "name": "My new ACL", "projectId": "3acb7ae1-cf3d-4112-ba5e-3a9d8c71cd47", "enabled": true, "id": "01HA9BRJW4J3QE4WBKVC337V4E", "createTime": "2023-09-14T08:08:48.264185988", "updateTime": "null,", "ipRanges": [ {} ] }

Request

Create an access control list entry with at least one IP address or IP range.

Security
Basic or OAuth2.0
Path
idstringrequired

The ID of the access control list entry.

Bodyapplication/json
namestringrequired

Your name for the access control list entry.

Example: "LA Office"
enabledboolean

Whether the access control list entry is enabled. You can use this to disable a list temporarily without deleting it.

Default true
ipRangesArray of objects(IpRange)

An array of all the IP ranges to update.

curl -i -X PUT \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists/{id}' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Test Prague 5",
    "enabled": false,
    "ipRanges": [
      {
        "description": "Location 1",
        "ipAddress": "15.15.15.16",
        "range": 20
      }
    ]
  }'

Responses

The list of access control list entries

Bodyapplication/json
namestringrequired

Your name for the access control list entry.

Example: "LA Office"
ipRangesArray of objects(IpRange)non-emptyrequired

The associated IP ranges. When creating you need to submit at least one IP range.

ipRanges[].​idstringread-only

The ID of the IP range.

ipRanges[].​descriptionstring

A description of the IP range.

Example: "West wing of office"
ipRanges[].​ipAddressstring

The start of the IP range.

Example: "10.0.1.1"
ipRanges[].​rangeinteger

A range, also known as a CIDR, represents the number of leading bits that define the network portion of an IP address in CIDR notation. The range is specified after a slash (/) at the end of the IP address. The remaining bits define specific hosts within the network.

  • 10.0.0.0/8: Represents all IP addresses from 10.0.0.0 to 10.255.255.255, allowing for over 16 million unique host addresses.
  • 172.16.0.0/16: Includes all IP addresses from 172.16.0.0 to 172.16.255.255, providing up to 65,536 unique host addresses.
  • 192.168.1.0/24: Encompasses all IP addresses from 192.168.1.0 to 192.168.1.255, offering 256 unique host addresses.
  • 192.168.1.0/32: Encompasses one ip address
Default 32
Example: 32
ipRanges[].​createTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
ipRanges[].​updateTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
ipRanges[].​projectIdstringread-only

The ID of the project.

ipRanges[].​accessControlListIdstringread-only

The ID of the access control list.

idstringread-only

The ID of the access control list entry.

enabledboolean

Whether the access control list entry is enabled. You can use this to disable an list temporarily without deleting it.

Default true
trunksArray of stringsread-only

The associated SIP trunks ID.

createTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
updateTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
projectIdstringread-only

The ID of the project.

Response
application/json

The updated access control list.

{ "name": "Test Prague 5", "projectId": "3acb7ae1-cf3d-4112-ba5e-3a9d8c71cd47", "enabled": false, "id": "01HA9BRJW4J3QE4WBKVC337V4E", "createTime": "2023-09-14T08:08:48", "updateTime": "2023-09-14T08:10:10.187513334", "ipRanges": [ {} ] }

Request

Delete an access control list entry.

Security
Basic or OAuth2.0
Path
idstringrequired

The ID of the access control list entry.

curl -i -X DELETE \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists/{id}'

Responses

List deleted

Request

Returns a list of all trunks which use the specified access control list.

Security
Basic or OAuth2.0
Path
idstringrequired

The ID of the access control list entry.

curl -i -X GET \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists/{id}/trunks'

Responses

The list of trunks which use the access control list.

Bodyapplication/json
trunksArray of objects(SipTrunk)
totalItemsinteger(int32)read-only

Total size of the result.

Example: 10000
pageNumberstringread-only

The token to be used for listing the next page

Example: "1"
pageSizeinteger(int32)read-only

The number of items per page. default is 1000

Example: 2000
Response
application/json
{ "trunks": [ {} ], "totalItems": 10000, "pageNumber": "1", "pageSize": 2000 }

Request

Add an IP range to an access control list entry.

Security
Basic or OAuth2.0
Path
accessControlListIdstringrequired

The ID of the access control list entry. that you want to work with

Bodyapplication/json
descriptionstring

A description of the IP range.

Example: "West wing of office"
ipAddressstring

The start of the IP range.

Example: "10.0.1.1"
rangeinteger

A range, also known as a CIDR, represents the number of leading bits that define the network portion of an IP address in CIDR notation. The range is specified after a slash (/) at the end of the IP address. The remaining bits define specific hosts within the network.

  • 10.0.0.0/8: Represents all IP addresses from 10.0.0.0 to 10.255.255.255, allowing for over 16 million unique host addresses.
  • 172.16.0.0/16: Includes all IP addresses from 172.16.0.0 to 172.16.255.255, providing up to 65,536 unique host addresses.
  • 192.168.1.0/24: Encompasses all IP addresses from 192.168.1.0 to 192.168.1.255, offering 256 unique host addresses.
  • 192.168.1.0/32: Encompasses one ip address
Default 32
Example: 32
curl -i -X POST \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists/{accessControlListId}/ipRanges' \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "IP range name",
    "ipAddress": "11.12.13.14",
    "range": 27
  }'

Responses

The list of IP ranges

Bodyapplication/json
idstringread-only

The ID of the IP range.

descriptionstring

A description of the IP range.

Example: "West wing of office"
ipAddressstring

The start of the IP range.

Example: "10.0.1.1"
rangeinteger

A range, also known as a CIDR, represents the number of leading bits that define the network portion of an IP address in CIDR notation. The range is specified after a slash (/) at the end of the IP address. The remaining bits define specific hosts within the network.

  • 10.0.0.0/8: Represents all IP addresses from 10.0.0.0 to 10.255.255.255, allowing for over 16 million unique host addresses.
  • 172.16.0.0/16: Includes all IP addresses from 172.16.0.0 to 172.16.255.255, providing up to 65,536 unique host addresses.
  • 192.168.1.0/24: Encompasses all IP addresses from 192.168.1.0 to 192.168.1.255, offering 256 unique host addresses.
  • 192.168.1.0/32: Encompasses one ip address
Default 32
Example: 32
createTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
updateTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
projectIdstringread-only

The ID of the project.

accessControlListIdstringread-only

The ID of the access control list.

Response
application/json

The added IP range.

{ "description": "IP range name", "ipAddress": "11.12.13.14", "range": 27, "projectId": "3acb7ae1-cf3d-4112-ba5e-3a9d8c71cd47", "accessControlListId": "01H8Y95DBJT31F104PWFVV9H8B", "id": "01HA9BYAH3J5TFDGK62991YYWC", "createTime": "2023-09-14T08:11:56.324855024", "updateTime": "" }

Request

Get all IP ranges for an access control list entry.

Security
Basic or OAuth2.0
Path
accessControlListIdstringrequired

The ID of the access control list entry. that you want to work with

curl -i -X GET \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists/{accessControlListId}/ipRanges'

Responses

The list of IP ranges

Bodyapplication/json
ipRangesArray of objects(IpRange)

The list of IP ranges

totalItemsinteger(int32)read-only

Total size of the result.

Example: 10000
pageNumberstringread-only

The token to be used for listing the next page

Example: "1"
pageSizeinteger(int32)read-only

The number of items per page. default is 1000

Example: 2000
Response
application/json
{ "ipRanges": [ {} ], "totalItems": 10000, "pageNumber": "1", "pageSize": 2000 }

Request

Remove an IP range to an access control list entry.

Security
Basic or OAuth2.0
Path
accessControlListIdstringrequired

The ID of the access control list entry that you want to update.

ipRangeIdstringrequired

The ID of the IP range that you want to update.

curl -i -X DELETE \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists/{accessControlListId}/ipRanges/{ipRangeId}'

Responses

IP range deleted

Request

Update an IP range to an access control list entry.

Security
Basic or OAuth2.0
Path
accessControlListIdstringrequired

The ID of the access control list entry that you want to update.

ipRangeIdstringrequired

The ID of the IP range that you want to update.

Bodyapplication/json
descriptionstring

A description of the IP range.

Example: "West wing of office"
ipAddressstring

The start of the IP range.

Example: "10.0.1.1"
rangeinteger

A range, also known as a CIDR, represents the number of leading bits that define the network portion of an IP address in CIDR notation. The range is specified after a slash (/) at the end of the IP address. The remaining bits define specific hosts within the network.

  • 10.0.0.0/8: Represents all IP addresses from 10.0.0.0 to 10.255.255.255, allowing for over 16 million unique host addresses.
  • 172.16.0.0/16: Includes all IP addresses from 172.16.0.0 to 172.16.255.255, providing up to 65,536 unique host addresses.
  • 192.168.1.0/24: Encompasses all IP addresses from 192.168.1.0 to 192.168.1.255, offering 256 unique host addresses.
  • 192.168.1.0/32: Encompasses one ip address
Default 32
Example: 32
curl -i -X PUT \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/accessControlLists/{accessControlListId}/ipRanges/{ipRangeId}' \
  -H 'Content-Type: application/json' \
  -d '{
    "ipAddress": "11.12.13.14",
    "range": 27
  }'

Responses

The updated IP range.

Bodyapplication/json
idstringread-only

The ID of the IP range.

descriptionstring

A description of the IP range.

Example: "West wing of office"
ipAddressstring

The start of the IP range.

Example: "10.0.1.1"
rangeinteger

A range, also known as a CIDR, represents the number of leading bits that define the network portion of an IP address in CIDR notation. The range is specified after a slash (/) at the end of the IP address. The remaining bits define specific hosts within the network.

  • 10.0.0.0/8: Represents all IP addresses from 10.0.0.0 to 10.255.255.255, allowing for over 16 million unique host addresses.
  • 172.16.0.0/16: Includes all IP addresses from 172.16.0.0 to 172.16.255.255, providing up to 65,536 unique host addresses.
  • 192.168.1.0/24: Encompasses all IP addresses from 192.168.1.0 to 192.168.1.255, offering 256 unique host addresses.
  • 192.168.1.0/32: Encompasses one ip address
Default 32
Example: 32
createTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
updateTimestring(date-time)read-only

The time the call was created.

Example: "2021-11-01T23:20:50Z"
projectIdstringread-only

The ID of the project.

accessControlListIdstringread-only

The ID of the access control list.

Response
application/json

The updated access control list.

{ "name": "Test Prague 5", "projectId": "3acb7ae1-cf3d-4112-ba5e-3a9d8c71cd47", "enabled": false, "id": "01HA9BRJW4J3QE4WBKVC337V4E", "createTime": "2023-09-14T08:08:48", "updateTime": "2023-09-14T08:10:10.187513334", "ipRanges": [ {} ] }

Request

Add an access control list entry to a trunk.

Security
Basic or OAuth2.0
Path
trunkIdstringrequired

The ID of the trunk that you want to work with

Bodyapplication/json
accessControlListIdsArray of strings

Array of AccessControlList ids

curl -i -X POST \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/trunks/{trunkId}/accessControlLists' \
  -H 'Content-Type: application/json' \
  -d '{
    "accessControlListIds": [
      "01HA2E80QCBX185VVP21PJG9CT",
      "01H8Y95DBJT31F104PWFVV9H8B"
    ]
  }'

Responses

The list of access control list entries

Bodyapplication/json
accessControlListIdsArray of strings

Array of AccessControlList ids

Response
application/json

The access control lists added to a trunk.

{ "accessControlListIds": [ "01HA2E80QCBX185VVP21PJG9CT", "01H8Y95DBJT31F104PWFVV9H8B" ] }

Request

Get all access control list entries for a trunk.

Security
Basic or OAuth2.0
Path
trunkIdstringrequired

The ID of the trunk that you want to work with

curl -i -X GET \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/trunks/{trunkId}/accessControlLists'

Responses

The list of access control list entries

Bodyapplication/json
accessControlListIdsArray of strings

Array of AccessControlList ids

totalItemsinteger(int32)read-only

Total size of the result.

Example: 10000
pageNumberstringread-only

The token to be used for listing the next page

Example: "1"
pageSizeinteger(int32)read-only

The number of items per page. default is 1000

Example: 2000
Response
application/json

All access control lists assigned to a trunk.

{ "accessControlListIds": [ "01HA2E80QCBX185VVP21PJG9CT" ], "pageNumber": 1, "pageSize": 1000, "totalItems": 1 }

Request

Remove an access control list entry from a trunk.

Security
Basic or OAuth2.0
Path
trunkIdstringrequired

The ID of the trunk that you want to work with

accessControlListIdstringrequired

The ID of the access control list entry. that you want to remove from trunk

curl -i -X DELETE \
  -u <username>:<password> \
  'https://elastic-trunking.api.sinch.com/v1/projects/{projectId}/trunks/{trunkId}/accessControlLists/{accessControlListId}'

Responses

Access control list entry deleted

Credential List

The Credential List endpoint has operations that allow you to view credential lists. You use credential lists to easily configure which users are allowed to make calls on a trunk.

Operations

Projects

Manage your Elastic SIP Trunking projects.

Operations