openapi: 3.2.0 info: title: Numbers | Sinch Active Number API description: '# Overview The Numbers API enables you to search for, buy, view, and manage numbers.' version: 1.0.3 contact: name: Support url: https://www.sinch.com email: Support@sinch.com license: name: MIT url: https://www.sinch.com/toc servers: - url: https://numbers.api.sinch.com description: Global API security: - Basic: [] - OAuth2.0: [] tags: - name: Active Number description: You can use the Active Number API to manage numbers you own. Release numbers from projects or list all numbers assigned to a project. x-displayName: Active Numbers paths: /v1/projects/{projectId}/activeNumbers: parameters: - $ref: '#/components/parameters/projectId' - $ref: '#/components/parameters/regionCodeOptional' - $ref: '#/components/parameters/numberPattern.pattern' - $ref: '#/components/parameters/numberPattern.searchPattern' - $ref: '#/components/parameters/typeOptional' - $ref: '#/components/parameters/capability' - $ref: '#/components/parameters/pageSize' - $ref: '#/components/parameters/pageToken' - $ref: '#/components/parameters/orderBy' get: summary: Lists active numbers for a project description: Lists all active numbers for a project. operationId: NumberService_ListActiveNumbers responses: '200': $ref: '#/components/responses/ListActiveNumbersResponse' '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '403': $ref: '#/components/responses/PermissionDenied' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.domains.numbers.models.v1.response.ActiveNumbersListResponse;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class List {\n\n private static final Logger LOGGER = Logger.getLogger(List.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n LOGGER.info(\"Listing active numbers\");\n\n ActiveNumbersListResponse response = numbersService.list();\n\n LOGGER.info(\"Response\");\n\n response\n .iterator()\n .forEachRemaining(f -> LOGGER.info(String.format(\"%s: %s\", f.getPhoneNumber(), f)));\n }\n}\n" - 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 const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n const response = await sinch.numbers.list({\n regionCode: 'US',\n type: 'LOCAL',\n });\n if (response.data.length === 0) {\n console.log('No rented phone numbers found.');\n return;\n }\n console.log(`✅ Found ${response.data.length} rented phone numbers.`);\n response.data.forEach((phoneNumber) => {\n console.log(phoneNumber);\n });\n } catch (err) {\n console.error('❌ Failed to list the rented phone numbers:');\n console.error(err);\n }\n}\n\nmain();\n" - lang: Python source: "\"\"\"\nSinch Python Snippet\n\nThis snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets\n\"\"\"\n\nimport os\nfrom dotenv import load_dotenv\nfrom sinch import SinchClient\n\nload_dotenv()\n\nsinch_client = SinchClient(\n project_id=os.environ.get(\"SINCH_PROJECT_ID\") or \"MY_PROJECT_ID\",\n key_id=os.environ.get(\"SINCH_KEY_ID\") or \"MY_KEY_ID\",\n key_secret=os.environ.get(\"SINCH_KEY_SECRET\") or \"MY_KEY_SECRET\"\n)\n\nactive_numbers = sinch_client.numbers.list(\n region_code=\"US\",\n number_type=\"LOCAL\"\n)\n\npage_counter = 1\nwhile True:\n print(f\"Page {page_counter} List of Numbers: {active_numbers}\")\n\n if not active_numbers.has_next_page:\n break\n\n active_numbers = active_numbers.next_page()\n page_counter += 1\n" /v1/projects/{projectId}/activeNumbers/{phoneNumber}: parameters: - $ref: '#/components/parameters/projectId' - $ref: '#/components/parameters/phoneNumber' patch: summary: Update an active phone number description: 'Update an active phone number. You can perform the following updates: * Update the name that displays for a customer by modifying the `displayName` parameter. * Unlink the number from an SMS service or campaign by updating the `smsConfiguration` configuration 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. * Update the Voice app to which the number is assigned by using the voiceConfiguration object. You can update both SMS and Voice in the same object by including both configuration objects. If you only need to update either Voice or SMS, simply omit the other object. If you pass an empty configuration object, the request will fail.' operationId: NumberService_UpdateActiveNumber requestBody: $ref: '#/components/requestBodies/ActiveNumberRequest' responses: '200': $ref: '#/components/responses/ActiveNumberResponse' '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '403': $ref: '#/components/responses/PermissionDenied' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.domains.numbers.models.v1.ActiveNumber;\nimport com.sinch.sdk.domains.numbers.models.v1.request.ActiveNumberUpdateRequest;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class Update {\n\n private static final Logger LOGGER = Logger.getLogger(Update.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n String phoneNumber = Settings.getPhoneNumber().orElse(\"MY_SINCH_PHONE_NUMBER\");\n\n String displayName = \"Updated with Sinch Java SDK\";\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n ActiveNumberUpdateRequest updateRequest =\n ActiveNumberUpdateRequest.builder().setDisplayName(displayName).build();\n\n ActiveNumber response = numbersService.update(phoneNumber, updateRequest);\n\n LOGGER.info(String.format(\"Updated number: %s\", response));\n }\n}\n" - 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 phone number to update\n const phoneNumber = process.env.SINCH_PHONE_NUMBER ?? 'MY_SINCH_PHONE_NUMBER';\n const updatedDisplayName = 'Updated name with Sinch Node.js SDK';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n const response = await sinch.numbers.update({\n phoneNumber,\n updateActiveNumberRequestBody: {\n displayName: updatedDisplayName,\n },\n });\n console.log('✅ Successfully updated the phone number.');\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to update the phone number ${phoneNumber}:`);\n console.error(err);\n }\n}\n\nmain();\n" - lang: Python source: "\"\"\"\nSinch Python Snippet\n\nThis snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets\n\"\"\"\n\nimport os\nfrom dotenv import load_dotenv\nfrom sinch import SinchClient\n\nload_dotenv()\n\nsinch_client = SinchClient(\n project_id=os.environ.get(\"SINCH_PROJECT_ID\") or \"MY_PROJECT_ID\",\n key_id=os.environ.get(\"SINCH_KEY_ID\") or \"MY_KEY_ID\",\n key_secret=os.environ.get(\"SINCH_KEY_SECRET\") or \"MY_KEY_SECRET\"\n)\n\n# The phone number to update in E.164 format\nphone_number = os.environ.get(\"SINCH_PHONE_NUMBER\") or \"MY_PHONE_NUMBER\"\n# The display name to set for the number\ndisplay_name = \"Updated DISPLAY_NAME\"\n\nresponse = sinch_client.numbers.update(\n phone_number=phone_number,\n display_name=display_name,\n)\n\nprint(\"Updated Number:\\n\", response)\n" get: summary: Retrieve an active phone number description: Retrieve a specific active phone number. operationId: NumberService_GetActiveNumber responses: '200': $ref: '#/components/responses/ActiveNumberResponse' '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.domains.numbers.models.v1.ActiveNumber;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class Get {\n\n private static final Logger LOGGER = Logger.getLogger(Get.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n String phoneNumber = Settings.getPhoneNumber().orElse(\"MY_SINCH_PHONE_NUMBER\");\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n LOGGER.info(\"Get for: \" + phoneNumber);\n ActiveNumber value = numbersService.get(phoneNumber);\n\n LOGGER.info(\"Response: \" + value);\n }\n}\n" - 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 phone number you want to retrieve details for\n const phoneNumber = process.env.SINCH_PHONE_NUMBER ?? 'MY_SINCH_PHONE_NUMBER';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try{\n const response = await sinch.numbers.get({ phoneNumber });\n console.log('✅ Successfully retrieved the phone number details.');\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to retrieve the details for the phone number ${phoneNumber}:`);\n console.error(err);\n }\n}\n\nmain();\n" - lang: Python source: "\"\"\"\nSinch Python Snippet\n\nThis snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets\n\"\"\"\n\nimport os\nfrom dotenv import load_dotenv\nfrom sinch import SinchClient\n\nload_dotenv()\n\nsinch_client = SinchClient(\n project_id=os.environ.get(\"SINCH_PROJECT_ID\") or \"MY_PROJECT_ID\",\n key_id=os.environ.get(\"SINCH_KEY_ID\") or \"MY_KEY_ID\",\n key_secret=os.environ.get(\"SINCH_KEY_SECRET\") or \"MY_KEY_SECRET\"\n)\n\n# The active phone number to retrieve details for in E.164 format\nphone_number = os.environ.get(\"SINCH_PHONE_NUMBER\") or \"MY_PHONE_NUMBER\"\n\nresponse = sinch_client.numbers.get(phone_number=phone_number)\n\nprint(f\"Rented number details:\\n{response}\")\n" /v1/projects/{projectId}/activeNumbers/{phoneNumber}:release: parameters: - $ref: '#/components/parameters/projectId' - $ref: '#/components/parameters/phoneNumber' post: summary: Release an active number from the project description: With this endpoint, you can cancel your subscription for a specific phone number. operationId: NumberService_ReleaseNumber responses: '200': $ref: '#/components/responses/ActiveNumberResponse' '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '403': $ref: '#/components/responses/PermissionDenied' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.domains.numbers.models.v1.ActiveNumber;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class Release {\n\n private static final Logger LOGGER = Logger.getLogger(Release.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n String phoneNumber = Settings.getPhoneNumber().orElse(\"MY_SINCH_PHONE_NUMBER\");\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n LOGGER.info(\"Release for: \" + phoneNumber);\n\n ActiveNumber value = numbersService.release(phoneNumber);\n\n LOGGER.info(\"Response: \" + value);\n }\n}\n" - 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 phone number to release\n const phoneNumber = process.env.SINCH_PHONE_NUMBER ?? 'MY_SINCH_PHONE_NUMBER';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try {\n const response = await sinch.numbers.release({ phoneNumber });\n console.log('✅ Successfully released the phone number.');\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to release the phone number ${phoneNumber}:`);\n console.error(err);\n }\n}\n\nmain();\n" - lang: Python source: "\"\"\"\nSinch Python Snippet\n\nThis snippet is available at https://github.com/sinch/sinch-sdk-python/tree/main/examples/snippets\n\"\"\"\n\nimport os\nfrom dotenv import load_dotenv\nfrom sinch import SinchClient\n\nload_dotenv()\n\nsinch_client = SinchClient(\n project_id=os.environ.get(\"SINCH_PROJECT_ID\") or \"MY_PROJECT_ID\",\n key_id=os.environ.get(\"SINCH_KEY_ID\") or \"MY_KEY_ID\",\n key_secret=os.environ.get(\"SINCH_KEY_SECRET\") or \"MY_KEY_SECRET\"\n)\n\n# The phone number to release in E.164 format\nphone_number = os.environ.get(\"SINCH_PHONE_NUMBER\") or \"MY_SINCH_PHONE_NUMBER\"\n\nreleased_number = sinch_client.numbers.release(\n phone_number=phone_number\n)\n\nprint(\"Released Number:\", released_number)\n" /v1/projects/{projectId}/activeNumbers/{phoneNumber}/emergencyAddress: parameters: - $ref: '#/components/parameters/projectId' - $ref: '#/components/parameters/phoneNumber' get: summary: Get the emergency address for a number description: With this endpoint, you can retrieve the emergency address associated with this number. operationId: NumberService_GetEmergencyAddress responses: '200': $ref: '#/components/responses/EmergencyAddressResponse' '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '403': $ref: '#/components/responses/PermissionDenied' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.domains.numbers.models.v1.EmergencyAddress;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class GetEmergencyAddress {\n private static final Logger LOGGER = Logger.getLogger(GetEmergencyAddress.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n String phoneNumber = Settings.getPhoneNumber().orElse(\"MY_SINCH_PHONE_NUMBER\");\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n LOGGER.info(\"Get EmergencyAddress for: \" + phoneNumber);\n\n EmergencyAddress response = numbersService.getEmergencyAddress(phoneNumber);\n\n LOGGER.info(\"Response: \" + response);\n }\n}\n" - 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 phone number for which you want to retrieve the emergency address\n const phoneNumber = process.env.SINCH_PHONE_NUMBER ?? 'MY_SINCH_PHONE_NUMBER';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try{\n const response = await sinch.numbers.getEmergencyAddress({ phoneNumber });\n console.log(`✅ Successfully retrieved the Emergency Address for the phone number ${phoneNumber}.`);\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to retrieve the Emergency Address for the phone number ${phoneNumber}:`);\n console.error(err);\n }\n}\n\nmain();\n" /v1/projects/{projectId}/activeNumbers/{phoneNumber}/emergencyAddress:provision: parameters: - $ref: '#/components/parameters/projectId' - $ref: '#/components/parameters/phoneNumber' post: summary: Add a emergency address for a number description: With this endpoint, you can provision an emergency address associated with this number. operationId: NumberService_ProvisionEmergencyAddress requestBody: $ref: '#/components/requestBodies/ProvisionEmergencyAddressRequest' responses: '200': $ref: '#/components/responses/EmergencyAddressResponse' '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '403': $ref: '#/components/responses/PermissionDenied' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.domains.numbers.models.v1.EmergencyAddress;\nimport com.sinch.sdk.domains.numbers.models.v1.request.EmergencyAddressRequest;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class ProvisionEmergencyAddress {\n\n private static final Logger LOGGER = Logger.getLogger(ProvisionEmergencyAddress.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n String phoneNumber = Settings.getPhoneNumber().orElse(\"MY_SINCH_PHONE_NUMBER\");\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n LOGGER.info(\"Provisioning EmergencyAddress for: \" + phoneNumber);\n\n EmergencyAddress emergencyAddress =\n EmergencyAddress.builder()\n .setStreetNumber(\"3500\")\n .setStreetInfo(\"Lenox Rd NE\")\n .setCity(\"Atlanta\")\n .setState(\"GA\")\n .setPostalCode(\"30326\")\n .build();\n\n EmergencyAddressRequest request =\n EmergencyAddressRequest.builder()\n .setDisplayName(\"Emergency Address Display Name\")\n .setAddress(emergencyAddress)\n .build();\n EmergencyAddress value = numbersService.provisionEmergencyAddress(phoneNumber, request);\n\n LOGGER.info(\"Response: \" + value);\n }\n}\n" - 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 phone number you want to provision an emergency address for\n const phoneNumber = process.env.SINCH_PHONE_NUMBER ?? 'MY_SINCH_PHONE_NUMBER';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try{\n const response = await sinch.numbers.provisionEmergencyAddress({\n phoneNumber,\n emergencyAddressRequestBody: {\n displayName: 'Emergency Address Display Name',\n address: {\n streetNumber: '3500',\n streetInfo: 'Lenox Rd NE',\n city: 'Atlanta',\n state: 'GA',\n postalCode: '30326',\n },\n },\n });\n console.log(`✅ Successfully provisioned an emergency address for the phone number ${phoneNumber}.`);\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to provision an emergency address for the phone number ${phoneNumber}:`);\n console.error(err);\n }\n}\n\nmain();\n" /v1/projects/{projectId}/activeNumbers/{phoneNumber}/emergencyAddress:deprovision: parameters: - $ref: '#/components/parameters/projectId' - $ref: '#/components/parameters/phoneNumber' post: summary: Remove the emergency address for a number description: With this endpoint, you can deprovision the emergency address associated with this number. operationId: NumberService_DeprovisionEmergencyAddress responses: '200': description: A successful response, or an [error](https://developers.sinch.com/docs/numbers/api-reference/error-codes/status-codes/) '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '403': $ref: '#/components/responses/PermissionDenied' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class DeprovisionEmergencyAddress {\n private static final Logger LOGGER =\n Logger.getLogger(DeprovisionEmergencyAddress.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n String phoneNumber = Settings.getPhoneNumber().orElse(\"MY_SINCH_PHONE_NUMBER\");\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n LOGGER.info(\"De-provisioning EmergencyAddress for: \" + phoneNumber);\n\n numbersService.deprovisionEmergencyAddress(phoneNumber);\n }\n}\n" - 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 phone number you want to remove the emergency address from\n const phoneNumber = process.env.SINCH_PHONE_NUMBER ?? 'MY_SINCH_PHONE_NUMBER';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try{\n await sinch.numbers.deprovisionEmergencyAddress({ phoneNumber });\n console.log(`✅ Successfully deprovisioned the emergency address from the phone number ${phoneNumber}.`);\n } catch (err) {\n console.error(`❌ Failed to deprovision the emergency address from the phone number ${phoneNumber}:`);\n console.error(err);\n }\n}\n\nmain();\n" /v1/projects/{projectId}/activeNumbers/{phoneNumber}/emergencyAddress:validate: parameters: - $ref: '#/components/parameters/projectId' - $ref: '#/components/parameters/phoneNumber' post: summary: Validate the emergency address for a number description: With this endpoint, you can validate the emergency address associated with this number. operationId: NumberService_ValidateEmergencyAddress requestBody: $ref: '#/components/requestBodies/ValidateEmergencyAddressRequest' responses: '200': description: A successful response, or an [error](https://developers.sinch.com/docs/numbers/api-reference/error-codes/status-codes/) content: application/json: schema: $ref: '#/components/schemas/ValidateAddressResponse' examples: perfectMatch: $ref: '#/components/examples/perfectMatch' nearMatch: $ref: '#/components/examples/nearMatch' noMatch: $ref: '#/components/examples/noMatch' '400': description: 400 Invalid Argument error content: application/json: schema: $ref: '#/components/schemas/InvalidArgument' '404': description: 404 Not Found error content: application/json: schema: $ref: '#/components/schemas/NotFound' '500': description: 500 Internal Server error content: application/json: schema: $ref: '#/components/schemas/InternalError' tags: - Active Number x-codeSamples: - lang: Java source: "/**\n * Sinch Java Snippet\n *\n *
This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n *
See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.NumbersService;\nimport com.sinch.sdk.domains.numbers.models.v1.EmergencyAddress;\nimport com.sinch.sdk.domains.numbers.models.v1.request.EmergencyAddressRequest;\nimport com.sinch.sdk.domains.numbers.models.v1.response.ValidateAddressResponse;\nimport com.sinch.sdk.models.Configuration;\nimport java.util.logging.Logger;\nimport utils.Settings;\n\npublic class ValidateEmergencyAddress {\n private static final Logger LOGGER = Logger.getLogger(ValidateEmergencyAddress.class.getName());\n\n public static void main(String[] args) {\n\n String projectId = Settings.getProjectId().orElse(\"MY_PROJECT_ID\");\n String keyId = Settings.getKeyId().orElse(\"MY_KEY_ID\");\n String keySecret = Settings.getKeySecret().orElse(\"MY_KEY_SECRET\");\n\n String phoneNumber = Settings.getPhoneNumber().orElse(\"MY_SINCH_PHONE_NUMBER\");\n\n Configuration configuration =\n Configuration.builder()\n .setProjectId(projectId)\n .setKeyId(keyId)\n .setKeySecret(keySecret)\n .build();\n\n SinchClient client = new SinchClient(configuration);\n\n NumbersService numbersService = client.numbers().v1();\n\n LOGGER.info(\"Validate EmergencyAddress for: \" + phoneNumber);\n\n EmergencyAddress emergencyAddress =\n EmergencyAddress.builder()\n .setStreetNumber(\"3500\")\n .setStreetInfo(\"Lenox Road NE\")\n .setCity(\"Atlanta\")\n .setState(\"GA\")\n .setPostalCode(\"30326\")\n .build();\n\n EmergencyAddressRequest request =\n EmergencyAddressRequest.builder()\n .setDisplayName(\"Emergency Address Display Name\")\n .setAddress(emergencyAddress)\n .build();\n ValidateAddressResponse value = numbersService.validateEmergencyAddress(phoneNumber, request);\n\n LOGGER.info(\"Response: \" + value);\n }\n}\n" - 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 phone number you want to validate an emergency address for\n const phoneNumber = process.env.SINCH_PHONE_NUMBER ?? 'MY_SINCH_PHONE_NUMBER';\n\n const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n try{\n const response = await sinch.numbers.validateEmergencyAddress({\n phoneNumber,\n emergencyAddressRequestBody: {\n displayName: 'Emergency Address Display Name',\n address: {\n streetNumber: '3500',\n streetInfo: 'Lenox Rd NE',\n city: 'Atlanta',\n state: 'GA',\n postalCode: '30326',\n },\n },\n });\n console.log('✅ Successfully submitted an emergency address validation.');\n console.log(JSON.stringify(response, null, 2));\n } catch (err) {\n console.error(`❌ Failed to submit an emergency address validation for the phone number ${phoneNumber}:`);\n console.error(err);\n }\n}\n\nmain();\n" components: schemas: FieldViolation: type: object properties: field: type: string description: type: string NumberType: type: string enum: - MOBILE - LOCAL - TOLL_FREE x-enumDescriptions: MOBILE: Numbers that belong to a specific range. LOCAL: Numbers that are assigned to a specific geographic region. TOLL_FREE: Numbers that are free of charge for the calling party but billed for all arriving calls. description: The number type. title: Type ListActiveNumbersResponse: type: object properties: activeNumbers: type: array items: $ref: '#/components/schemas/ActiveNumberResponse' description: List of numbers associated to the client project specified in `ListActiveNumbers`. nextPageToken: type: string title: The token to be used for listing the next page. totalSize: type: integer format: int32 title: The maximum number of results returned. description: Response message to list your active phone numbers. title: Active Numbers Response BadRequest: type: object properties: type: type: string enum: - BadRequest x-enumDescriptions: BadRequest: The request was malformed in some way. fieldViolations: type: array items: $ref: '#/components/schemas/FieldViolation' RegionCode: type: string example: US description: 'ISO 3166-1 alpha-2 country code of the phone number. Example: US, GB or SE.' title: Region Code ScheduledVoiceProvisioning: type: object readOnly: true description: Represents the ongoing or failed scheduled voice provisioning job. This field will be empty if the number was successfully provisioned provisioned for voice. required: - type oneOf: - $ref: '#/components/schemas/ScheduledVoiceProvisioningEST' - $ref: '#/components/schemas/ScheduledVoiceProvisioningFAX' - $ref: '#/components/schemas/ScheduledVoiceProvisioningRTC' discriminator: propertyName: type mapping: EST: '#/components/schemas/ScheduledVoiceProvisioningEST' FAX: '#/components/schemas/ScheduledVoiceProvisioningFAX' RTC: '#/components/schemas/ScheduledVoiceProvisioningRTC' title: Scheduled Voice Provisioning money: type: object description: An object giving details on currency code and the amount charged. properties: currencyCode: type: string example: USD description: The 3-letter currency code defined in [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html). amount: type: string example: '2.00' description: 'The amount in decimal form. For example `2.00`. There are no guarantees on the precision unless documented by the message origin. The amount cannot be updated and is read-only.' title: Money NumberPatternSearchPattern: type: string enum: - START - CONTAINS - END x-enumDescriptions: START: Numbers that start with the provided sequence of digits. CONTAINS: Numbers that contain the sequence of digits entered. END: Numbers that end with the sequence of digits entered. description: The pattern to apply to searches. title: Search Pattern NumberCapability: type: string enum: - SMS - VOICE x-enumDescriptions: SMS: The SMS product can use the number. VOICE: The Voice product can use the number. default: SMS description: 'The capabilities the phone number supports: SMS, Voice, or both' title: Capability ScheduledVoiceProvisioningEST: type: object allOf: - $ref: '#/components/schemas/ScheduledVoiceProvisioningCommon' - $ref: '#/components/schemas/VoiceTrunkId' ProvisioningStatus: default: WAITING description: The provisioning status. It will be either `WAITING`, `IN_PROGRESS` or `FAILED`. If the provisioning fails, a reason for the failure will be provided. [See a full list of provisioning error descriptions]<(https://developers.sinch.com/docs/numbers/api-reference/error-codes/provisioning-errors) and troubleshooting recommendations. enum: - PROVISIONING_STATUS_UNSPECIFIED - WAITING - IN_PROGRESS - FAILED x-enumDescriptions: PROVISIONING_STATUS_UNSPECIFIED: The status is currently unknown. WAITING: Waiting for provisioning IN_PROGRESS: Provisioning in progress FAILED: Provisioning failed. See [provisioning error descriptions](https://developers.sinch.com/docs/numbers/api-reference/error-codes/provisioning-errors) title: Provisioning Status VoiceConfigurationCommon: title: Common VoiceConfiguration fields type: object properties: type: $ref: '#/components/schemas/VoiceApplicationType' lastUpdatedTime: type: string description: Timestamp when the status was last updated. format: date-time readOnly: true scheduledVoiceProvisioning: readOnly: true allOf: - $ref: '#/components/schemas/ScheduledVoiceProvisioning' VoiceAppId: type: object properties: appId: type: string description: Your app ID for the Voice API. The `appId` can be found in your [Sinch Customer Dashboard](https://dashboard.sinch.com/voice/apps). EmergencyAddress: type: object description: Details of the emergency address. title: Emergency Address properties: streetNumber: type: string description: The street number for the emergency address. example: '12345' streetInfo: type: string description: The street name of the emergency location. example: Main St location: type: string description: The location for address. example: Apt 5 city: type: string description: The city of the emergency location. example: Springfield state: type: string description: The state or province of the emergency location. example: IL postalCode: type: string description: The postal code of the emergency location. example: '62701' postalCodePlusFour: type: string description: The postal code of the emergency location. example: '1234' VoiceConfigurationEST: title: EST VoiceConfiguration type: object required: - type allOf: - $ref: '#/components/schemas/VoiceConfigurationCommon' - $ref: '#/components/schemas/VoiceTrunkId' ScheduledVoiceProvisioningFAX: type: object allOf: - $ref: '#/components/schemas/ScheduledVoiceProvisioningCommon' - $ref: '#/components/schemas/VoiceServiceId' NotFound: type: object properties: error: type: object properties: code: type: integer enum: - 404 x-enumDescriptions: '404': The HTTP status code for a resource not found. message: type: string status: type: string enum: - NOT_FOUND x-enumDescriptions: NOT_FOUND: The request resource could not be found. details: type: array items: $ref: '#/components/schemas/NotFoundErrorDetails' EmergencyAddressRequest: type: object description: Request for emergency address. title: Emergency Address Request required: - displayName - address properties: displayName: type: string description: Name for emergency address. example: New emergency address address: required: - streetNumber - streetInfo - city - state - postalCode allOf: - $ref: '#/components/schemas/EmergencyAddress' VoiceTrunkId: type: object properties: trunkId: type: string description: The trunk ID if the type is EST. The `trunkId` can be found in your [Sinch Customer Dashboard](https://dashboard.sinch.com/trunks/your-trunks). VoiceConfiguration: title: VoiceConfiguration type: object oneOf: - $ref: '#/components/schemas/VoiceConfigurationRTC' - $ref: '#/components/schemas/VoiceConfigurationEST' - $ref: '#/components/schemas/VoiceConfigurationFAX' discriminator: propertyName: type mapping: RTC: '#/components/schemas/VoiceConfigurationRTC' EST: '#/components/schemas/VoiceConfigurationEST' FAX: '#/components/schemas/VoiceConfigurationFAX' description: The current voice configuration for this number. During scheduled provisioning, the app ID, service ID, or trunk ID value may be empty in a response if it is still processing or if it has failed. The status of scheduled provisioning will show under a `scheduledVoiceProvisioning` object if it's still running. Once processed successfully, the `appId`/`serviceId`/`trunkId` sent will appear directly under the `voiceConfiguration` object. VoiceApplicationType: type: string description: The voice application type. Examples are RTC, EST, FAX x-enumDescriptions: RTC: Voice [see documentation](https://developers.sinch.com/docs/voice) EST: Elastic SIP Trunking [see documentation](https://developers.sinch.com/docs/est) FAX: FAX application [see documentation](https://developers.sinch.com/docs/fax/overview) enum: - RTC - EST - FAX default: RTC AddressValidationResultCode: type: string enum: - ADDRESS_VALIDATION_RESULT_CODE_UNSPECIFIED - EXACT_MATCH - NEAR_MATCH - NO_MATCH description: Enum representing the result of address validation. x-enumDescriptions: ADDRESS_VALIDATION_RESULT_CODE_UNSPECIFIED: Undetermined Result EXACT_MATCH: The address is perfect as sent NEAR_MATCH: The result was a close enough match and has been corrected NO_MATCH: The result is not close enough InternalError: type: object properties: error: type: object properties: code: type: integer enum: - 500 x-enumDescriptions: '500': The HTTP status code for an internal server error. message: type: string status: type: string enum: - INTERNAL - UNKNOWN x-enumDescriptions: INTERNAL: An internal server error. UNKNOWN: Some unknown error. details: type: array items: type: object ValidateAddressResponse: type: object description: Response object containing details of the emergency address. title: Validate Emergency Address Response properties: phoneNumber: $ref: '#/components/schemas/PhoneNumber' displayName: type: string description: User supplied name for the phone number. example: User Name validatedAddress: $ref: '#/components/schemas/EmergencyAddress' validationResult: $ref: '#/components/schemas/AddressValidationResultCode' validationMessage: type: string description: Validation result message example: Corrected to valid address correctedAddress: $ref: '#/components/schemas/EmergencyAddress' candidateAddresses: type: array items: $ref: '#/components/schemas/EmergencyAddress' description: List of candidate addresses (only available if validationResult == NO_MATCH) VoiceServiceId: type: object properties: serviceId: type: string description: The service ID if the type is FAX. The `serviceId` can be found in your [Sinch Customer Dashboard](https://dashboard.sinch.com/fax/services). ActiveNumberRequest: type: object properties: displayName: type: string description: User supplied name for the phone number. smsConfiguration: $ref: '#/components/schemas/smsConfiguration' voiceConfiguration: $ref: '#/components/schemas/VoiceConfiguration' callbackUrl: type: string description: The callback URL to be called for a rented number's provisioning / deprovisioning operations. description: The phone number that has been rented by a customer and assigned to a project. title: Active Number Request ActiveNumberResponse: type: object properties: phoneNumber: $ref: '#/components/schemas/PhoneNumber' projectId: type: string example: 51bc3f40-f266-4ca8-8938-a1ed0ff32b9a description: Project ID. Your project ID can be found on your [Sinch Customer Dashboard](https://dashboard.sinch.com/settings/project-management). displayName: type: string description: User supplied name for the phone number. regionCode: $ref: '#/components/schemas/RegionCode' type: $ref: '#/components/schemas/NumberType' capability: description: The capability of the number. type: array example: - SMS items: $ref: '#/components/schemas/NumberCapability' money: $ref: '#/components/schemas/money' paymentIntervalMonths: type: integer format: int32 description: How often the recurring price is charged in months. readOnly: true nextChargeDate: type: string format: date-time description: The date of the next charge. readOnly: true expireAt: type: string format: date-time description: The timestamp when the subscription will expire if an expiration date has been set. readOnly: true smsConfiguration: $ref: '#/components/schemas/smsConfiguration' voiceConfiguration: $ref: '#/components/schemas/VoiceConfiguration' callbackUrl: type: string description: The callback URL to be called for a rented number's provisioning / deprovisioning operations. example: https://www.your-callback-server.com/callback description: The phone number that has been bought by a customer and assigned to a project. title: Active Number Response NotFoundErrorDetails: type: object properties: type: type: string resourceType: type: string description: The type of the resource that was not found. resourceName: type: string description: The name of the resource that was not found. owner: type: string description: The owner of the resource that was not found. description: type: string description: A description of the error. smsConfigurationBase: title: Base SMS Configuration type: object required: - servicePlanId properties: servicePlanId: type: string description: The `servicePlanId` can be found in the [Sinch Customer Dashboard](https://dashboard.sinch.com/sms/api/rest). The service plan ID is what ties this number to the configured SMS service. campaignId: type: string description: Only for US phone numbers. This `campaignId` is required to send SMS traffic to US; click [here](https://community.sinch.com/t5/10DLC/What-is-10DLC/ta-p/7845) to read more about 10DLC A2P messaging. So, it is the current campaign ID for this number. The `campaignId` is found on your TCR platform. smsConfiguration: type: object title: SMS Configuration description: 'The current SMS configuration for this number. Once the `servicePlanId` is sent, it enters scheduled provisioning. The status of scheduled provisioning will show under a `scheduledProvisioning` object if it''s still running. Once processed successfully, the `servicePlanId` sent will appear directly under the `smsConfiguration` object.' allOf: - $ref: '#/components/schemas/smsConfigurationBase' - type: object properties: scheduledProvisioning: readOnly: true allOf: - $ref: '#/components/schemas/scheduledProvisioning' VoiceConfigurationRTC: title: RTC VoiceConfiguration type: object allOf: - $ref: '#/components/schemas/VoiceConfigurationCommon' - $ref: '#/components/schemas/VoiceAppId' InvalidArgument: type: object properties: error: type: object properties: code: type: integer enum: - 400 x-enumDescriptions: '400': The HTTP status code for invalid arguments. message: type: string status: type: string enum: - INVALID_ARGUMENT x-enumDescriptions: INVALID_ARGUMENT: The request contained invalid arguments. details: type: array items: $ref: '#/components/schemas/BadRequest' ScheduledVoiceProvisioningCommon: type: object required: - type allOf: - type: object properties: type: $ref: '#/components/schemas/VoiceApplicationType' lastUpdatedTime: type: string description: Timestamp when the status was last updated. format: date-time readOnly: true status: $ref: '#/components/schemas/ProvisioningStatus' PhoneNumber: type: string example: '+12025550134' description: The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. Example `+12025550134`. title: Phone Number SmsErrorCode: type: string x-enumDescriptions: ERROR_CODE_UNSPECIFIED: Code not specified. INTERNAL_ERROR: Internal server error. SMS_PROVISIONING_FAILED: Provisioning for SMS failed. CAMPAIGN_PROVISIONING_FAILED: Provisioning for campaign failed. CAMPAIGN_NOT_AVAILABLE: The specified campaign is not available. EXCEEDED_10DLC_LIMIT: Exceeded the 10DLC limit. NUMBER_PROVISIONING_FAILED: Failed to provision the number. PARTNER_SERVICE_UNAVAILABLE: The third party service is unavailable. CAMPAIGN_PENDING_ACCEPTANCE: The campaign is awaiting acceptance. MNO_SHARING_ERROR: Sharing error. CAMPAIGN_EXPIRED: The specific campaign has expired. CAMPAIGN_MNO_REJECTED: The MNO for the campaign was rejected. CAMPAIGN_MNO_SUSPENDED: The MNO for the campaign was suspended. CAMPAIGN_MNO_REVIEW: The MNO for the campaign is under review. INSUFFICIENT_BALANCE: The credit balance for the account is insufficient to cover the fees. MOCK_CAMPAIGN_NOT_ALLOWED: Mock campaign is not permitted. TFN_NOT_ALLOWED: The Toll-Free number is not allowed. INVALID_NNID: The specified NNID is invalid. enum: - ERROR_CODE_UNSPECIFIED - INTERNAL_ERROR - SMS_PROVISIONING_FAILED - CAMPAIGN_PROVISIONING_FAILED - CAMPAIGN_NOT_AVAILABLE - EXCEEDED_10DLC_LIMIT - NUMBER_PROVISIONING_FAILED - PARTNER_SERVICE_UNAVAILABLE - CAMPAIGN_PENDING_ACCEPTANCE - MNO_SHARING_ERROR - CAMPAIGN_EXPIRED - CAMPAIGN_MNO_REJECTED - CAMPAIGN_MNO_SUSPENDED - CAMPAIGN_MNO_REVIEW - INSUFFICIENT_BALANCE - MOCK_CAMPAIGN_NOT_ALLOWED - TFN_NOT_ALLOWED - INVALID_NNID description: The error codes that show the reason of failure of a scheduled provisioning title: SMS Error Code scheduledProvisioning: type: object description: Represents the ongoing or failed scheduled provisioning job. This field will be empty if the number was both successfully provisioned to the SMS platform and linked to the 10DLC campaign. properties: servicePlanId: type: string description: The SMS service plan that the scheduled provisioning job will configure with the number. readOnly: true campaignId: type: string description: TCR campaign ID that the scheduled provisioning job will configure with the number. readOnly: true status: $ref: '#/components/schemas/ProvisioningStatus' lastUpdatedTime: type: string format: date-time description: Timestamp when the status was last updated. readOnly: true errorCodes: type: array items: $ref: '#/components/schemas/SmsErrorCode' readOnly: true title: Scheduled Provisioning VoiceConfigurationFAX: title: FAX VoiceConfiguration type: object required: - type allOf: - $ref: '#/components/schemas/VoiceConfigurationCommon' - $ref: '#/components/schemas/VoiceServiceId' ScheduledVoiceProvisioningRTC: type: object allOf: - $ref: '#/components/schemas/ScheduledVoiceProvisioningCommon' - $ref: '#/components/schemas/VoiceAppId' requestBodies: ProvisionEmergencyAddressRequest: description: Request to provision an emergency address for a number. content: application/json: schema: $ref: '#/components/schemas/EmergencyAddressRequest' example: displayName: New Emergency Address address: streetNumber: '12345' streetInfo: Main St city: Springfield state: IL postalCode: '62701' ValidateEmergencyAddressRequest: description: Request to validate an emergency address for a number. content: application/json: schema: $ref: '#/components/schemas/EmergencyAddressRequest' example: displayName: New Emergency Address address: streetNumber: '12345' streetInfo: Main St city: Springfield state: IL postalCode: '62701' ActiveNumberRequest: description: The number body to be updated. content: application/json: schema: $ref: '#/components/schemas/ActiveNumberRequest' examples: updateSMSandVoiceNumber: $ref: '#/components/examples/updateSMSandVoiceNumber' updateSMSNumber: $ref: '#/components/examples/updateSMSNumber' updateVoiceNumber: $ref: '#/components/examples/updateVoiceNumber' responses: ActiveNumberResponse: description: A successful response, or an [Error](https://developers.sinch.com/docs/numbers/api-reference/error-codes/status-codes/). content: application/json: schema: $ref: '#/components/schemas/ActiveNumberResponse' examples: activateBothSMSandVoiceNumber: $ref: '#/components/examples/activateBothSMSandVoiceNumberRes' activateSMSNumber: $ref: '#/components/examples/activateSMSNumberRes' activateVoiceNumber: $ref: '#/components/examples/activateVoiceNumberRes' activateESTNumber: $ref: '#/components/examples/activateESTNumberRes' activateFaxNumber: $ref: '#/components/examples/activateFaxNumberRes' PermissionDenied: description: 'PERMISSION_DENIED: improper credentials. Be sure your projectId, username and password are correct.' content: application/json: schema: {} example: error: code: 403 message: '' status: PERMISSION_DENIED details: [] EmergencyAddressResponse: description: A successful response, or an [error](https://developers.sinch.com/docs/numbers/api-reference/error-codes/status-codes/) content: application/json: schema: $ref: '#/components/schemas/EmergencyAddress' ListActiveNumbersResponse: description: A successful response, or an [Error](https://developers.sinch.com/docs/numbers/api-reference/error-codes/status-codes/). content: application/json: schema: $ref: '#/components/schemas/ListActiveNumbersResponse' parameters: pageSize: name: pageSize description: The maximum number of items to return. in: query required: false schema: type: integer format: int32 regionCodeOptional: name: regionCode description: 'Region code to filter by. ISO 3166-1 alpha-2 country code of the phone number. Example: US, GB or SE.' in: query required: false schema: type: string example: US orderBy: name: orderBy description: Supported fields for ordering by `phoneNumber` or `displayName`. in: query required: false schema: type: string enum: - phoneNumber - displayName x-enumDescriptions: phoneNumber: Ordered by phone number displayName: Ordered by display name description: The ordering the request is supporting capability: name: capability description: Number capabilities to filter by SMS and/or VOICE. in: query required: false schema: type: array items: $ref: '#/components/schemas/NumberCapability' numberPattern.searchPattern: name: numberPattern.searchPattern description: Search pattern to apply. The options are, `START`, `CONTAINS`, and `END`. in: query required: false schema: $ref: '#/components/schemas/NumberPatternSearchPattern' typeOptional: name: type description: Number type to filter by. Options include, `MOBILE`, `LOCAL` or `TOLL_FREE`. in: query required: false schema: $ref: '#/components/schemas/NumberType' phoneNumber: name: phoneNumber description: Output only. The phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format with leading `+`. in: path required: true schema: type: string example: '+12025550134' default: YOUR_selected_phoneNumber_from_search pageToken: name: pageToken description: The next page token value returned from a previous List request, if any. in: query required: false schema: type: string projectId: name: projectId description: Found on your [Sinch Customer Dashboard](https://dashboard.sinch.com/settings/project-management). Settings > Projects. in: path required: true schema: type: string example: YOUR_projectId numberPattern.pattern: name: numberPattern.pattern description: Sequence of digits to search for. If you prefer or need certain digits in sequential order, you can enter the sequence of numbers here. For example, `2020`. in: query required: false schema: type: string example: '%2B120' examples: updateSMSNumber: summary: Update number with SMS configuration value: displayName: MyPhoneNumber smsConfiguration: servicePlanId: YOUR_servicePlanId campaignId: YOUR_campaignId_from_TCR callbackUrl: https://www.your-callback-server.com/callback activateFaxNumberRes: summary: Response for activing a number with Fax configuration value: phoneNumber: '+12025550134' projectId: 51bc3f40-f266-4ca8-8938-a1ed0ff32b9a displayName: MyPhoneNumber regionCode: US type: LOCAL capability: - VOICE money: currencyCode: USD amount: '2.00' paymentIntervalMonths: 0 nextChargeDate: '2024-08-24T14:15:22Z' expireAt: '2024-09-24T14:15:22Z' voiceConfiguration: type: FAX lastUpdatedTime: '2024-09-24T14:15:22Z' scheduledVoiceProvisioning: type: FAX lastUpdatedTime: '2024-09-24T14:15:22Z' status: WAITING serviceId: YOUR_service_id serviceId: YOUR_service_id updateSMSandVoiceNumber: summary: Update number with SMS and Voice configuration value: displayName: MyPhoneNumber smsConfiguration: servicePlanId: string campaignId: YOUR_campaignId_from_TCR voiceConfiguration: type: RTC appId: YOUR_Voice_appId callbackUrl: https://www.your-callback-server.com/callback noMatch: summary: Address validation doesn't match any known address value: phoneNumber: '+12025550134' displayName: User Name validatedAddress: streetNumber: '12345' streetInfo: Main St location: Apt 5 city: Springfield state: IL postalCode: '62701' postalCodePlusFour: '1234' validationResult: NO_MATCH validationMessage: Address doesn't match any known address correctedAddress: {} candidateAddresses: - streetNumber: '67890' streetInfo: Elm St location: Apt 10 city: Springfield state: IL postalCode: '62702' postalCodePlusFour: '5678' - streetNumber: '54321' streetInfo: Oak St location: Apt 20 city: Springfield state: IL postalCode: '62703' postalCodePlusFour: '9876' perfectMatch: summary: Address validation is a perfect match value: phoneNumber: '+12025550134' displayName: User Name validatedAddress: streetNumber: '12345' streetInfo: Main St location: Apt 5 city: Springfield state: IL postalCode: '62701' postalCodePlusFour: '1234' validationResult: EXACT_MATCH validationMessage: Address is a perfect match correctedAddress: {} candidateAddresses: [] activateSMSNumberRes: summary: Response for activing a number with SMS configuration value: phoneNumber: '+12025550134' projectId: 51bc3f40-f266-4ca8-8938-a1ed0ff32b9a displayName: MyPhoneNumber regionCode: US type: MOBILE capability: - SMS money: currencyCode: USD amount: '2.00' paymentIntervalMonths: 0 nextChargeDate: '2024-08-24T14:15:22Z' expireAt: '2024-09-24T14:15:22Z' smsConfiguration: servicePlanId: YOUR_service_plan_id scheduledProvisioning: servicePlanId: YOUR_service_plan_id status: WAITING lastUpdatedTime: '2024-08-04T14:15:22Z' campaignId: YOUR_campaign_id campaignId: YOUR_campaign_id nearMatch: summary: Address validation is a near match to another known address value: phoneNumber: '+12025550134' displayName: User Name validatedAddress: streetNumber: '12345' streetInfo: Main Street location: Apt 5 city: Springfield state: IL postalCode: '62701' postalCodePlusFour: '1234' validationResult: NEAR_MATCH validationMessage: Address is a near match correctedAddress: streetNumber: '12345' streetInfo: Main St location: Apt 5 city: Springfield state: IL postalCode: '62701' postalCodePlusFour: '1234' candidateAddresses: [] activateVoiceNumberRes: summary: Response for activing a number with Voice configuration value: phoneNumber: '+12025550134' projectId: 51bc3f40-f266-4ca8-8938-a1ed0ff32b9a displayName: MyPhoneNumber regionCode: US type: MOBILE capability: - VOICE money: currencyCode: USD amount: '2.00' paymentIntervalMonths: 0 nextChargeDate: '2024-08-24T14:15:22Z' expireAt: '2024-09-24T14:15:22Z' voiceConfiguration: type: RTC lastUpdatedTime: '2024-09-24T14:15:22Z' scheduledVoiceProvisioning: type: RTC lastUpdatedTime: '2024-09-24T14:15:22Z' status: WAITING appId: YOUR_app_id appId: YOUR_app_id activateESTNumberRes: summary: Response for activing a number with Elastic SIP Trunking configuration value: phoneNumber: '+12025550134' projectId: 51bc3f40-f266-4ca8-8938-a1ed0ff32b9a displayName: MyPhoneNumber regionCode: US type: LOCAL capability: - VOICE money: currencyCode: USD amount: '2.00' paymentIntervalMonths: 0 nextChargeDate: '2024-08-24T14:15:22Z' expireAt: '2024-09-24T14:15:22Z' voiceConfiguration: type: EST lastUpdatedTime: '2024-09-24T14:15:22Z' scheduledVoiceProvisioning: type: EST lastUpdatedTime: '2024-09-24T14:15:22Z' status: WAITING trunkId: YOUR_trunk_id trunkId: YOUR_trunk_id updateVoiceNumber: summary: Update number with Voice configuration value: displayName: MyPhoneNumber voiceConfiguration: type: RTC appId: YOUR_Voice_appId callbackUrl: https://www.your-callback-server.com/callback activateBothSMSandVoiceNumberRes: summary: Response for activing a number with both SMS and Voice configuration value: phoneNumber: '+12025550134' projectId: 51bc3f40-f266-4ca8-8938-a1ed0ff32b9a displayName: MyPhoneNumber regionCode: US type: MOBILE capability: - SMS - VOICE money: currencyCode: USD amount: '2.00' paymentIntervalMonths: 0 nextChargeDate: '2024-08-24T14:15:22Z' expireAt: '2024-09-24T14:15:22Z' smsConfiguration: servicePlanId: YOUR_service_plan_id scheduledProvisioning: servicePlanId: '' status: WAITING lastUpdatedTime: '2024-08-04T14:15:22Z' campaignId: YOUR_campaign_id campaignId: YOUR_campaign_id voiceConfiguration: type: RTC lastUpdatedTime: '2024-09-24T14:15:22Z' scheduledVoiceProvisioning: type: RTC lastUpdatedTime: '2024-09-24T14:15:22Z' status: WAITING appId: YOUR_app_id appId: YOUR_app_id securitySchemes: Basic: type: http scheme: basic description: Your key ID and Key secret serve as the username and password, respectively. Both can be found in the [Sinch Customer Dashboard](https://dashboard.sinch.com/settings/access-keys). For more information about basic authentication in the Numbers API, click [here](https://developers.sinch.com/docs/numbers/api-reference/authentication/basic). OAuth2.0: type: oauth2 description: The username and password are your Key ID and Key Secret from the [Access keys section](https://dashboard.sinch.com/settings/access-keys) in the Sinch Customer Dashboard. Exchange these for a bearer token (access token). Learn how [here](https://developers.sinch.com/docs/numbers/api-reference/authentication/oauth). flows: clientCredentials: tokenUrl: https://auth.sinch.com/oauth2/token scopes: {} x-explorer-enabled: false x-samples-languages: - curl - java - csharp - node - php