openapi: 3.2.0 info: title: Elastic SIP Trunk Credential Lists API description: This document provides a detailed user guide and reference documentation on the Sinch Elastic SIP Trunk API. version: 1.0.0 license: name: MIT url: https://www.sinch.com/toc contact: email: support@sinch.com name: support at sinch servers: - url: https://elastic-trunking.api.sinch.com security: - Basic: [] - OAuth2.0: [] tags: - name: Credential Lists description: 'The Credential Lists endpoint has operations that allow you to view and manage credential lists. You use credential lists to easily configure which users are allowed to make calls on a trunk.' paths: /v1/projects/{projectId}/credentialLists/{id}: get: tags: - Credential Lists summary: Get credential list description: Return a credential list by its specified ID. operationId: getCredentialListById parameters: - $ref: '#/components/parameters/ProjectId' - name: id in: path required: true description: The ID of the credential list to return. schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CredentialListResponse' x-codeSamples: - lang: Node.js source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n // The credential list ID you want to retrieve\n const credentialListId = 'CREDENTIAL_LIST_ID';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n const response = await sinch.elasticSipTrunking.credentialLists.get({\n id: credentialListId,\n });\n console.log('✅ Successfully retrieved the credential list.');\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to retrieve the credential list with ID ${credentialListId}:`);\n console.error(err);\n }\n}\n\nmain();\n" put: tags: - Credential Lists summary: Update a credential list operationId: updateCredentialList parameters: - $ref: '#/components/parameters/ProjectId' - name: id in: path required: true description: The ID of the credential list to update. schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/CredentialListRequest' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CredentialListResponse' x-codeSamples: - lang: Node.js source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n // The credential list ID you want to update\n const credentialListId = 'CREDENTIAL_LIST_ID';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n const response = await sinch.elasticSipTrunking.credentialLists.update({\n id: credentialListId,\n updateCredentialListRequestBody: {\n name: 'Updated credential list name',\n },\n });\n console.log(`✅ Successfully updated the credential list with ID ${credentialListId}.`);\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to update the credential list with ID ${credentialListId}:`);\n console.error(err);\n }\n}\n\nmain();\n" delete: tags: - Credential Lists summary: Delete a credential list operationId: deleteCredentialList parameters: - $ref: '#/components/parameters/ProjectId' - name: id in: path required: true description: The ID of the credential list to delete. schema: type: string responses: '204': description: No Content x-codeSamples: - lang: Node.js source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n // The credential list ID you want to delete\n const credentialListId = 'CREDENTIAL_LIST_ID';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n await sinch.elasticSipTrunking.credentialLists.delete({\n id: credentialListId,\n });\n console.log(`✅ Successfully deleted the credential list with ID ${credentialListId}.`);\n } catch (err) {\n console.error(`❌ Failed to delete the credential list with ID ${credentialListId}:`);\n console.error(err);\n }\n}\n\nmain();\n" /v1/projects/{projectId}/credentialLists/{credentialListId}/credentials/{username}: put: tags: - Credential Lists summary: Update the password for a credential operationId: updateCredential parameters: - $ref: '#/components/parameters/ProjectId' - name: credentialListId in: path required: true description: The ID of the credential list entry. schema: type: string - name: username in: path required: true description: The username of the credential. schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/Credential' required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Credential' x-codeSamples: - lang: Node.js source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n // The credential list ID that contains the credential to update\n const credentialListId = 'CREDENTIAL_LIST_ID';\n // The username of the credential to update\n const credentialUsername = 'CREDENTIAL_USERNAME';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n const response = await sinch.elasticSipTrunking.credentialLists.updateCredential({\n id: credentialListId,\n username: credentialUsername,\n updateCredentialPasswordRequestBody: {\n password: 'newSecurePassword123[]',\n },\n });\n console.log(`✅ Successfully updated the credential password for the username ${credentialUsername} in credential list ${credentialListId}.`);\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to update the credential password for the username ${credentialUsername} in credential list ${credentialListId}:`);\n console.error(err);\n }\n}\n\nmain();\n" /v1/projects/{projectId}/credentialLists/{id}/trunks: parameters: - $ref: '#/components/parameters/ProjectId' - name: id in: path description: The ID of the credential list entry. required: true schema: type: string get: description: Returns a list of all the trunks which use the specified credential list. summary: Get trunks for credential list operationId: trunksByCredentialList tags: - Credential Lists responses: '200': description: The list of trunks which use the credential list. content: application/json: schema: allOf: - type: object properties: trunks: type: array items: $ref: '#/components/schemas/SipTrunk' - $ref: '#/components/schemas/Pagination' x-codeSamples: - lang: Node.js source: "/**\n * Sinch Node.js Snippet\n * See: https://github.com/sinch/sinch-sdk-node/examples/snippets\n */\nimport { SinchClient } from '@sinch/sdk-core';\nimport * as dotenv from 'dotenv';\ndotenv.config();\n\nasync function main() {\n const projectId = process.env.SINCH_PROJECT_ID ?? 'MY_PROJECT_ID';\n const keyId = process.env.SINCH_KEY_ID ?? 'MY_KEY_ID';\n const keySecret = process.env.SINCH_KEY_SECRET ?? 'MY_KEY_SECRET';\n\n // The credential list ID you want to list SIP Trunks for\n const credentialListId = 'CREDENTIAL_LIST_ID';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n const response = await sinch.elasticSipTrunking.credentialLists.listTrunks({\n id: credentialListId,\n });\n if (response.data.length === 0) {\n console.log(`No SIP Trunks found for the credential list with ID ${credentialListId}.`);\n return;\n }\n console.log(`✅ Found ${response.data.length} SIP Trunks for the credential list with ID ${credentialListId}.`);\n response.data.forEach((trunk) => {\n console.log(trunk);\n });\n } catch (err) {\n console.error(`❌ Failed to list the SIP Trunks for the credential list with ID ${credentialListId}:`);\n console.error(err);\n }\n}\n\nmain();\n" components: schemas: Pagination: type: object readOnly: true properties: totalItems: type: integer readOnly: true format: int32 description: Total size of the result. example: 10000 pageNumber: readOnly: true type: string description: The token to be used for listing the next page example: '1' size: type: integer readOnly: true format: int32 description: The number of items per page. default is 1000 example: 2000 CredentialListResponse: type: object properties: name: type: string description: The name of the credential list. example: My Credential List id: type: string description: The ID of the credential list. example: 01GNZ9MXEZ4K6S8GB7RW063VAN SipTrunk: required: - name - hostName type: object properties: id: type: string readOnly: true description: The SIP trunk id. example: '' hostName: type: string description: The host of the domain you would like to have for you trunk. example: acme-domain-1 topLevelDomain: readOnly: true type: string description: The top level domain to which the SIP trunk belongs. example: .elastic-sip.sinch.com domain: readOnly: true type: string description: The fully qualified name of the domain, which is a combination of your 'hostName' and the 'topLevelDomain'. example: acme-domain-1.elastic-sip.sinch.com name: type: string description: The friendly name of your SIP trunk. example: Acme Trunk callsPerSecond: minimum: 1 readOnly: true type: integer description: Number of calls started per second, to increase this please contact your account manager. example: 100 default: 1 enableCallerName: type: boolean description: Enable caller name lookup for incoming calls. US and canada only. example: true default: false callForwardNumber: type: string description: The valid E.164 phone number that will be dialed on inbound calls when no SIP endpoints are available. Required if `enableCallForward` property is `true`. example: '+17208511190' default: '' enableCallForward: type: boolean description: "When enabled, if an inbound call can not be delivered to a SIP endpoint, calls will be forwarded to the configured `callForwardNumber`. To forward all calls without trying SIP, simply disable (or delete) all SIP endpoints on this trunk. Logs (and billing) will be created for 2 calls (inbound and outbound). \n**Note:** Since there is no SIP connection, PCAPs will not be generated." example: true default: false createTime: type: string readOnly: true description: The date and time that the SIP trunk was created. format: date-time example: '2022-01-01T00:00:00Z' updateTime: type: string description: The date and time that the SIP trunk was last modified. format: date-time readOnly: true example: '2022-01-01T00:00:00Z' projectId: type: string readOnly: true description: The ID of the account. example: 1bf62742-7b84-4666-9cbe-8e5734fd57d0 description: A created SIP trunk. Credential: type: object properties: password: type: string format: password description: The password for the credential. example: SecurePassword!234 CredentialListRequest: type: object properties: name: type: string description: The name of the credential list. example: My Credential List required: - name parameters: ProjectId: name: projectId in: path required: true description: The `projectId` is a required parameter you must include when making any API calls. You can find your project ID on your [Build dashboard](https://dashboard.sinch.com). schema: type: string example: 3acb7ae1-cf3d-4112-ba5e-3a9d8c71cd47 securitySchemes: Basic: type: http description: 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. scheme: basic OAuth2.0: type: oauth2 description: 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. flows: clientCredentials: tokenUrl: https://auth.sinch.com/oauth2/token scopes: {}