# Elastic SIP Trunk API 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](#basic) and [OAuth2](#oauth2) authentication types. ### Basic {% partial file="/partials/authentication/basic/_intro.md"/ %} {% partial file="/partials/authentication/basic/_instructions.md"/ %} ### OAuth2 {% partial file="/partials/authentication/oauth/_intro.md"/ %} {% partial file="/partials/authentication/oauth/_instructions.md"/ %} ## Servers Elastic SIP Trunk API serves all endpoints from the following server: ```https://elastic-trunking.api.sinch.com/v1/projects/{projectId}``` {% admonition type="info" name="Note:" %} The `projectId` is a required parameter you must include when making any API calls. You can find your project ID on your [dashboard](https://dashboard.sinch.com). {% /admonition %} Version: 1.0.0 License: MIT ## Servers ``` https://elastic-trunking.api.sinch.com/v1/projects/{projectId} ``` Variables: - `projectId`: The `projectId` is a required parameter you must include when making any API calls. You can find your project ID on your [dashboard](https://dashboard.sinch.com). ## Security ### Basic To use basic authentication, use your Access Key ID as your username and your Access Key Secret as your password. To read about more basic authentication, see the [Basic Authentication](https://developers.sinch.com/docs/est/api-reference/est#basic) section. Type: http Scheme: basic ### OAuth2.0 To use OAuth 2.0 authentication, use your Access Key ID and Access Key Secret to obtain your bearer token. For detailed instructions on how to do this, see the [OAuth Authentication](https://developers.sinch.com/docs/est/api-reference/est#oauth) section. Type: oauth2 ## Download OpenAPI description [Elastic SIP Trunk API](https://developers.sinch.com/_spec/docs/est/api-reference/est.yaml) ## SIP Trunks The SIP Trunks endpoint has operations that allow you to create, view, update, and remove SIP trunks. ### Create SIP trunk - [POST /trunks](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/createsiptrunk.md): Creates a new SIP trunk. ### List SIP trunks - [GET /trunks](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/getsiptrunks.md): Returns a list of all SIP trunks. If you specify pagination settings, the list of SIP trunks can be returned separated and sorted into pages. ### Get SIP Trunk - [GET /trunks/{sipTrunkId}](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/getsiptrunkbyid.md): Search for a SIP trunk by ID. ### Update SIP trunk - [PUT /trunks/{sipTrunkId}](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/updatesiptrunk.md): Update an existing SIP Trunk by ID. The whole object must be sent. Any missing fields will be set to null. ### Delete SIP trunk - [DELETE /trunks/{sipTrunkId}](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/deletesiptrunk.md): Delete a SIP trunk by its ID. ### Add ACL to a trunk - [POST /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/addaccesscontrollisttotrunk.md): Add an access control list entry to a trunk. ### List all ACLs for a trunk - [GET /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/getaccesscontrollistsfortrunk.md): Get all access control list entries for a trunk. ### Bulk update credential lists for a trunk - [PUT /trunks/{trunkId}/credentialLists](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/bulkupdatecredentiallistsfortrunk.md): Update the list of credential list entries for a trunk. ### Delete ACL from trunk - [DELETE /trunks/{trunkId}/accessControlLists/{accessControlListId}](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/deleteaccesscontrollistfromtrunk.md): Remove an access control list entry from a trunk. ### Add ACL to a trunk - [POST /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/addaccesscontrollisttotrunk.md): Add an access control list entry to a trunk. ### List all ACLs for a trunk - [GET /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/getaccesscontrollistsfortrunk.md): Get all access control list entries for a trunk. ### Delete ACL from trunk - [DELETE /trunks/{trunkId}/accessControlLists/{accessControlListId}](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/deleteaccesscontrollistfromtrunk.md): Remove an access control list entry from a trunk. ### Bulk update credential lists for a trunk - [PUT /trunks/{trunkId}/credentialLists](https://developers.sinch.com/docs/est/api-reference/est/credential-list/bulkupdatecredentiallistsfortrunk.md): Update the list of credential list entries for a trunk. ## 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. ### Add ACL to a trunk - [POST /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/addaccesscontrollisttotrunk.md): Add an access control list entry to a trunk. ### List all ACLs for a trunk - [GET /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/getaccesscontrollistsfortrunk.md): Get all access control list entries for a trunk. ### Delete ACL from trunk - [DELETE /trunks/{trunkId}/accessControlLists/{accessControlListId}](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/deleteaccesscontrollistfromtrunk.md): Remove an access control list entry from a trunk. ### List ACLs - [GET /accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/getaccesscontrollist.md): Fetches the list of Access Control List entries. ### Create an ACL - [POST /accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/createaccesscontrollist.md): Create an access control list entry with at least one IP address or IP range. ### Update ACL - [PUT /accessControlLists/{id}](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/updateaccesscontrollist.md): Create an access control list entry with at least one IP address or IP range. ### Delete ACL - [DELETE /accessControlLists/{id}](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/deleteaccesscontrollist.md): Delete an access control list entry. ### Get trunks for ACL - [GET /accessControlLists/{id}/trunks](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/trunksbyacl.md): Returns a list of all trunks which use the specified access control list. ### Add IP range to ACL - [POST /accessControlLists/{accessControlListId}/ipRanges](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/addiprangetoaccesscontrollist.md): Add an IP range to an access control list entry. ### List all IP ranges for ACL - [GET /accessControlLists/{accessControlListId}/ipRanges](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/getiprangesforaccesscontrollist.md): Get all IP ranges for an access control list entry. ### Delete IP range from ACL - [DELETE /accessControlLists/{accessControlListId}/ipRanges/{ipRangeId}](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/deleteiprangefromaccesscontrollist.md): Remove an IP range to an access control list entry. ### Update IP range - [PUT /accessControlLists/{accessControlListId}/ipRanges/{ipRangeId}](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/updateiprangefromaccesscontrollist.md): Update an IP range to an access control list entry. ### Add ACL to a trunk - [POST /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/addaccesscontrollisttotrunk.md): Add an access control list entry to a trunk. ### List all ACLs for a trunk - [GET /trunks/{trunkId}/accessControlLists](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/getaccesscontrollistsfortrunk.md): Get all access control list entries for a trunk. ### Delete ACL from trunk - [DELETE /trunks/{trunkId}/accessControlLists/{accessControlListId}](https://developers.sinch.com/docs/est/api-reference/est/access-control-list/deleteaccesscontrollistfromtrunk.md): Remove an access control list entry from a trunk. ## 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. ### Bulk update credential lists for a trunk - [PUT /trunks/{trunkId}/credentialLists](https://developers.sinch.com/docs/est/api-reference/est/sip-trunks/bulkupdatecredentiallistsfortrunk.md): Update the list of credential list entries for a trunk. ### Get trunks for credential list - [GET /credentialLists/{id}/trunks](https://developers.sinch.com/docs/est/api-reference/est/credential-list/trunksbycredentiallist.md): Returns a list of all the trunks which use the specified credential list. ### Bulk update credential lists for a trunk - [PUT /trunks/{trunkId}/credentialLists](https://developers.sinch.com/docs/est/api-reference/est/credential-list/bulkupdatecredentiallistsfortrunk.md): Update the list of credential list entries for a trunk. ## 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. ### Return SIP endpoints - [GET /trunks/{sipTrunkId}/endpoints](https://developers.sinch.com/docs/est/api-reference/est/sip-endpoints/getsipendpoint.md): Returns a list of all SIP endpoints with paging. ### Create SIP endpoint - [POST /trunks/{sipTrunkId}/endpoints](https://developers.sinch.com/docs/est/api-reference/est/sip-endpoints/createsipendpoint.md): Create a new SIP endpoint. ### Get SIP endpoint by ID - [GET /trunks/{sipTrunkId}/endpoints/{sipEndpointId}](https://developers.sinch.com/docs/est/api-reference/est/sip-endpoints/getsipendpointbyid.md): Get a SIP endpoint by specifying its ID. ### Update existing SIP endpoint - [PUT /trunks/{sipTrunkId}/endpoints/{sipEndpointId}](https://developers.sinch.com/docs/est/api-reference/est/sip-endpoints/updatesipendpoint.md): Updated an existing SIP endpoint by specifying its ID. ### Delete SIP endpoint - [DELETE /trunks/{sipTrunkId}/endpoints/{sipEndpointId}](https://developers.sinch.com/docs/est/api-reference/est/sip-endpoints/deletesipendpoint.md): Delete a SIP endpoint by specifying its ID. ## 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. ### Fetch all country permissions - [GET /countryPermissions](https://developers.sinch.com/docs/est/api-reference/est/country-permissions/getcountrypermissions.md): Fetches the list of country permissions. ### Fetch country permission - [GET /countryPermissions/{isoCode}](https://developers.sinch.com/docs/est/api-reference/est/country-permissions/getcountrypermission.md): Fetches the requested country permission. ### Update country permission - [PUT /countryPermissions/{isoCode}](https://developers.sinch.com/docs/est/api-reference/est/country-permissions/updatecountrypermission.md): Update the requested country permission. ## Phone Numbers The `/phoneNumbers` endpoint has operations that allow you to assign and remove phone numbers from SIP trunks. ### Get all phone numbers - [GET /phoneNumbers](https://developers.sinch.com/docs/est/api-reference/est/phone-numbers/getphonenumbers.md): Get all phone numbers. You can filter and sort the phone numbers returned with paging. ### Find a specific phone number - [GET /phoneNumbers/{phoneNumber}](https://developers.sinch.com/docs/est/api-reference/est/phone-numbers/getphonenumberbynumber.md): Search for an Elastic SIP Trunk-enabled phone number by the e.164 number. ## Calls The `/calls` endpoint has operations that allow you to retrieve call history and details about calls made or received using EST. ### Find calls - [GET /calls](https://developers.sinch.com/docs/est/api-reference/est/calls/findcalls.md): Find calls by query parameters. ## Projects Manage your Elastic SIP Trunking projects. ### Add additional projects to EST - [POST /addProjects](https://developers.sinch.com/docs/est/api-reference/est/projects/addestprojects.md): Programmatically add additional projects for use with Elastic SIP Trunking. If you list a project ID which EST is already aware of, it will be ignored.