Sinch Numbers Callbacks API

You can set up callback URLs to receive event notifications when your numbers are updated. When delivering events the order is not guaranteed (for example, a failed event scheduled for retry will not block other events that were queued). The client's callback handler must implement the state machine that can decide what to do with _unexpected_ events, for example, "old" events or invalid state transitions. In these cases the handler could use the API to GET the latest state for the resource. The callback handler is expected to "ingest" the event and respond with 200 OK. The domain-specific business logic and processes should be executed outside of the callback request, as internal asynchronous jobs. Callbacks for all eventTypes - except NUMBER_ORDER_PROCESSING - will use 2 values for the status field: SUCCEEDED or FAILED. For NUMBER_ORDER_PROCESSING eventsTypes, the status field will reflect the Number Order state transition that happened, ex: IN_REVIEW, BLOCKED, COMPLETED, REJECTED, EXPIRED. To use callbacks, add the following IP addresses to your allowlist: - 54.76.19.159 - 54.78.194.39 - 54.155.83.128 ### Secure Webhook Endpoints with HMAC Implementing HMAC (Hash-based Message Authentication Code) on your webhook endpoints will ensure the integrity of data, preventing tampering during transmission. An HMAC used in webhooks is a common approach in the industry and in a nutshell it is just special code that can be used to check if a message hasn't been tempered with during the transmission. We recommend to configure an HMAC secret for your project using the [callback configuration](https://developers.sinch.com/docs/numbers/api-reference/numbers/numbers-callbacks/updatecallbackconfiguration). Then, when sending the number events, the HTTP POST requests will include the header `X-Sinch-Signature` with the computed HMAC. **NOTE:** The HMAC secret is configured per project; if you are using the Numbers API with multiple projects, make sure you configure the HMAC secret in each project, and fetch it for either imported or purchased numbers from the dedicated endpoints. ### HMAC verification We recommend to verify the HMAC code received with every event in your event handler. When receiving a new event on your endpoint URL, compute the HMAC of the payload using the secret (configured [here](https://developers.sinch.com/docs/numbers/api-reference/numbers/numbers-callbacks/updatecallbackconfiguration)) and compare it with one received in the `X-Sinch-Signature` header. **NOTE:** Compute the HMAC on the plain text value before parsing the JSON payload.

Operations 2

GET /v1/projects/{projectId}/callbackConfiguration Get callbacks configuration #
PATCH /v1/projects/{projectId}/callbackConfiguration Update callback configuration #

Documentation

📖
Documentation
https://developers.sinch.com/docs/conversation
📖
APIReference
https://developers.sinch.com/docs/conversation/api-reference/template
📖
Documentation
https://developers.sinch.com/docs/est
📖
APIReference
https://developers.sinch.com/docs/est/api-reference/est
📖
Documentation
https://developers.sinch.com/docs/fax
📖
APIReference
https://developers.sinch.com/docs/fax/api-reference/fax
📖
Documentation
https://developers.sinch.com/docs/number-lookup-api-v2
📖
APIReference
https://developers.sinch.com/docs/number-lookup-api-v2/api-reference/number-lookup-v2
📖
Documentation
https://developers.sinch.com/docs/numbers
📖
APIReference
https://developers.sinch.com/docs/numbers/api-reference/imported-hosting
📖
APIReference
https://developers.sinch.com/docs/numbers/api-reference/numbers
📖
APIReference
https://developers.sinch.com/docs/numbers/api-reference/porting
📖
Documentation
https://developers.sinch.com/docs/provisioning-api
📖
APIReference
https://developers.sinch.com/docs/provisioning-api/api-reference/provisioning-api-1
📖
Documentation
https://developers.sinch.com/docs/verification
📖
APIReference
https://developers.sinch.com/docs/verification/api-reference/verification
📖
Documentation
https://developers.sinch.com/docs/voice-2.0
📖
APIReference
https://developers.sinch.com/docs/voice-2.0/api-reference/voice
📖
Documentation
https://developers.sinch.com/docs/10dlc-registration
📖
APIReference
https://developers.sinch.com/docs/10dlc-registration/api-reference/10dlc-registration
📖
Documentation
https://developers.sinch.com/docs/accesskeys
📖
APIReference
https://developers.sinch.com/docs/accesskeys/api-reference/oldaccesskeys
📖
APIReference
https://developers.sinch.com/docs/accesskeys/api-reference/accesskeys
📖
Documentation
https://developers.sinch.com/docs/campaigns
📖
APIReference
https://developers.sinch.com/docs/campaigns/api-reference/campaigns
📖
Documentation
https://developers.sinch.com/docs/chatlayer-analytics
📖
APIReference
https://developers.sinch.com/docs/chatlayer-analytics/api-reference/chatlayer-analytics
📖
Documentation
https://developers.sinch.com/docs/compliance-center
📖
APIReference
https://developers.sinch.com/docs/compliance-center/api-reference/compliance-brands
📖
Documentation
https://developers.sinch.com/docs/subprojects
📖
APIReference
https://developers.sinch.com/docs/subprojects/api-reference/subprojects

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-v2-template-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-v2-list-translations-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-v2-list-templates-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-call-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-sip-trunk-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-sip-endpoint-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-ip-range-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-access-control-list-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-fax-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-service-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-template-by-name-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-update-template-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-service-phone-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-cover-page-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-lookup-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-lookup-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-hosting-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-qualified-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-text-enable-numbers-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-hosting-order-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-imported-number-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-imported-numbers-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-active-number-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-rent-any-number-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-validate-address-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-number-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-number-order-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-registration-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-order-list-item-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-defaults-configuration-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-pagination-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-voice-configuration-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-order-document-base-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-port-in-order-group-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-account-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-sender-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-template-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-whatsapp-partial-template-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-webhook-webhook-input-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-webhook-update-webhook-input-dto-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-verification-report-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-batch-summary-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-session-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-call-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-service-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-validate-svaml-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-tcr-campaign-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-access-key-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-access-key-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-access-keys-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-access-key-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-update-access-key-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-campaign-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-carrier-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-note-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-campaign-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-campaign-attachment-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-campaign-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-get-flow-step-details-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-get-conversation-flow-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-funnel-step-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-funnel-step-filter-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-get-intents-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-event-definitions-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-brand-order-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-brand-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-attachment-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-import-brand-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-create-brand-request-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-callback-config-response-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-subproject-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/sinch/refs/heads/main/json-schema/sinch-list-subprojects-response-schema.json

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sinch:sinch-numbers-callbacks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sinch-numbers-callbacks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Numbers | Sinch Numbers Callbacks 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: Numbers Callbacks
  description: You can set up callback URLs to receive event notifications when your numbers are updated.
paths:
  /v1/projects/{projectId}/callbackConfiguration:
    get:
      summary: Get callbacks configuration
      description: Returns the callbacks configuration for the specified project
      operationId: GetCallbackConfiguration
      responses:
        '200':
          description: Callbacks configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallbackConfiguration'
        '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'
      parameters:
      - $ref: '#/components/parameters/projectId'
      tags:
      - Numbers Callbacks
      x-codeSamples:
      - lang: Java
        source: "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers.eventdestinations;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.EventDestinationsService;\nimport com.sinch.sdk.domains.numbers.models.v1.eventdestinations.response.EventDestinationResponse;\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    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    EventDestinationsService eventDestinationsService = client.numbers().v1().eventDestinations();\n\n    LOGGER.info(\"Get\");\n\n    EventDestinationResponse value = eventDestinationsService.get();\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  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try{\n    const response = await sinch.numbers.callbacks.get({});\n    console.log('✅ Successfully retrieved the callback configuration.');\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error('❌ Failed to retrieve the callback configuration:');\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\nresponse = sinch_client.numbers.event_destinations.get()\n\nprint(\"Event Destination Configuration:\\n\", response)\n"
    patch:
      summary: Update callback configuration
      description: Updates the callbacks configuration for the specified project
      operationId: UpdateCallbackConfiguration
      requestBody:
        description: The callback configuration details to be updated.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallbackConfigurationUpdate'
      responses:
        '200':
          description: Callback configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallbackConfiguration'
        '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'
      parameters:
      - $ref: '#/components/parameters/projectId'
      tags:
      - Numbers Callbacks
      x-codeSamples:
      - lang: Java
        source: "/**\n * Sinch Java Snippet\n *\n * <p>This snippet is available at https://github.com/sinch/sinch-sdk-java\n *\n * <p>See https://github.com/sinch/sinch-sdk-java/blob/main/examples/snippets/README.md for details\n */\npackage numbers.eventdestinations;\n\nimport com.sinch.sdk.SinchClient;\nimport com.sinch.sdk.domains.numbers.api.v1.EventDestinationsService;\nimport com.sinch.sdk.domains.numbers.models.v1.eventdestinations.request.EventDestinationUpdateRequest;\nimport com.sinch.sdk.domains.numbers.models.v1.eventdestinations.response.EventDestinationResponse;\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 hmac = \"NEW_HMAC_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    EventDestinationsService eventDestinationsService = client.numbers().v1().eventDestinations();\n\n    LOGGER.info(\"Update callback HMAC secret\");\n\n    EventDestinationUpdateRequest parameters =\n        EventDestinationUpdateRequest.builder().setHmacSecret(hmac).build();\n\n    EventDestinationResponse value = eventDestinationsService.update(parameters);\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 new HMAC secret to configure for the callback\n  const hmacSecret = 'NEW_HMAC_SECRET';\n\n  const sinch = new SinchClient({ projectId, keyId, keySecret });\n\n  try{\n    const response = await sinch.numbers.callbacks.update({\n      updateCallbackConfigurationRequestBody: {\n        hmacSecret,\n      },\n    });\n    console.log('✅ Successfully updated the callback configuration.');\n    console.log(JSON.stringify(response, null, 2));\n  } catch (err) {\n    console.error('❌ Failed to update the callback configuration:');\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 HMAC secret for signing webhook requests to your event destination\nhmac_secret = \"NEW_HMAC_SECRET\"\n\nresponse = sinch_client.numbers.event_destinations.update(\n    hmac_secret=hmac_secret\n)\n\nprint(\"Updated event destination configuration:\\n\", response)\n"
webhooks:
  EventsCallback:
    post:
      tags:
      - Numbers Callbacks
      summary: Event notification
      description: A notification of an event sent to your configured callback URL.
      operationId: NumberService_EventsCallback
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallbackPayload'
      responses:
        default:
          description: 200 OK
components:
  schemas:
    FieldViolation:
      type: object
      properties:
        field:
          type: string
        description:
          type: string
    ResourceType:
      type: string
      description: The type of the resource.
      x-enumDescriptions:
        ACTIVE_NUMBER: Numbers which are already active and updated with new campaign IDs or service plan IDs.
        NUMBER_ORDER: Number orders created for buying one or more phone numbers.
      example: ACTIVE_NUMBER
      enum:
      - ACTIVE_NUMBER
      - NUMBER_ORDER
    CallbackPayloadActiveNumber:
      type: object
      allOf:
      - $ref: '#/components/schemas/CallbackPayloadCommon'
      properties:
        eventType:
          type: string
          description: The type of the event.
          enum:
          - PROVISIONING_TO_SMS_PLATFORM
          - DEPROVISIONING_FROM_SMS_PLATFORM
          - PROVISIONING_TO_CAMPAIGN
          - DEPROVISIONING_FROM_CAMPAIGN
          - PROVISIONING_TO_VOICE_PLATFORM
          - DEPROVISIONING_FROM_VOICE_PLATFORM
          x-enumDescriptions:
            PROVISIONING_TO_SMS_PLATFORM: An event that occurs when a number is linked to a Service Plan ID.
            DEPROVISIONING_FROM_SMS_PLATFORM: An event that occurs when a number is unlinked from a Service Plan ID.
            PROVISIONING_TO_CAMPAIGN: An event that occurs when a number is linked to a Campaign.
            DEPROVISIONING_FROM_CAMPAIGN: An event that occurs when a number is unlinked from a Campaign.
            PROVISIONING_TO_VOICE_PLATFORM: An event that occurs when a number is enabled for Voice operations.
            DEPROVISIONING_FROM_VOICE_PLATFORM: An event that occurs when a number is disabled for Voice operations.
          example: PROVISIONING_TO_CAMPAIGN
        status:
          type: string
          description: The status of the event or the state transition it represents.
          x-enumDescriptions:
            SUCCEEDED: The event has succeeded.
            FAILED: The event has failed.
          enum:
          - SUCCEEDED
          - FAILED
          example: FAILED
        failureCode:
          type: string
          description: If the status is FAILED, a failure code will be provided. For numbers provisioning to SMS platform, there won't be any extra `failureCode`, as the result is binary. For campaign provisioning-related failures, refer to the list for the possible values.
          example: CAMPAIGN_NOT_AVAILABLE
          enum:
          - CAMPAIGN_NOT_AVAILABLE
          - EXCEEDED_10DLC_LIMIT
          - NUMBER_PROVISIONING_FAILED
          - PARTNER_SERVICE_UNAVAILABLE
          - CAMPAIGN_PENDING_ACCEPTANCE
          - MNO_SHARING_ERROR
          - CAMPAIGN_PROVISIONING_FAILED
          - CAMPAIGN_EXPIRED
          - CAMPAIGN_MNO_REJECTED
          - CAMPAIGN_MNO_SUSPENDED
          - CAMPAIGN_MNO_REVIEW
          - INSUFFICIENT_BALANCE
          - MOCK_CAMPAIGN_NOT_ALLOWED
          - TFN_NOT_ALLOWED
          - INVALID_NNID
          x-enumDescriptions:
            CAMPAIGN_NOT_AVAILABLE: The specified campaign is not available.
            EXCEEDED_10DLC_LIMIT: Exceeded the limit for 10DLC.
            NUMBER_PROVISIONING_FAILED: Provisioning the number failed.
            PARTNER_SERVICE_UNAVAILABLE: The third party service is unavailable.
            CAMPAIGN_PENDING_ACCEPTANCE: The campaign is not yet accepted.
            MNO_SHARING_ERROR: Error with MNO.
            CAMPAIGN_PROVISIONING_FAILED: The campaign failed to provision.
            CAMPAIGN_EXPIRED: The campaign expired.
            CAMPAIGN_MNO_REJECTED: The campaign MNO was rejected.
            CAMPAIGN_MNO_SUSPENDED: The campaign MNO was suspended.
            CAMPAIGN_MNO_REVIEW: The campaign MNO is under review.
            INSUFFICIENT_BALANCE: Not enough credit in the account.
            MOCK_CAMPAIGN_NOT_ALLOWED: Provisioning not allowed for mock campaigns.
            TFN_NOT_ALLOWED: Toll free numbers not allowed.
            INVALID_NNID: Invalid NNID.
        internalFailureCode:
          type: string
          description: If the status is FAILED, certain processes (eg. number to campaign provisioning) will have an internalFailureCode in the payload. The details of these codes can be found in our dedicated [Provisioning errors](https://developers.sinch.com/docs/numbers/api-reference/error-codes/provisioning-errors) documentation.
          example: CRS0018
        resourceId:
          type: string
          description: The unique identifier of the resource, depending on the resource type. For example, a phone number.
          example: '+12345612345'
    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'
    CallbackPayloadNumberOrder:
      type: object
      allOf:
      - $ref: '#/components/schemas/CallbackPayloadCommon'
      properties:
        eventType:
          type: string
          description: The type of the event.
          enum:
          - NUMBER_ORDER_PROCESSING
          x-enumDescriptions:
            NUMBER_ORDER_PROCESSING: An event that occurs when a Number Order transitions to a new state.
          example: NUMBER_ORDER_PROCESSING
        status:
          type: string
          description: The status of the event or the state transition it represents.
          x-enumDescriptions:
            IN_REVIEW: The Number Order transitioned to the IN_REVIEW state.
            BLOCKED: The Number Order transitioned to the BLOCKED state. The number order was blocked. To view any reasons associated with the BLOCKED status, use the [get number order registration operation](https://developers.sinch.com/docs/numbers/api-reference/numbers/number-order/getnumberorderregistration).
            COMPLETED: The Number Order transitioned to the COMPLETED state. This is a final state and indicates the number order was successful.
            REJECTED: The Number Order transitioned to the REJECTED state. This is a final state and indicates the number order was rejected.
            EXPIRED: The Number Order transitioned to the EXPIRED state. This is a final state and indicates the number order expired.
          enum:
          - IN_REVIEW
          - BLOCKED
          - COMPLETED
          - REJECTED
          - EXPIRED
          example: IN_REVIEW
        resourceId:
          type: string
          description: The unique identifier of the resource, depending on the resource type. For example, a number order ID.
          example: 01jgkbb8xywmz3hhahd76menqf
    CallbackPayload:
      type: object
      oneOf:
      - $ref: '#/components/schemas/CallbackPayloadActiveNumber'
      - $ref: '#/components/schemas/CallbackPayloadNumberOrder'
      discriminator:
        propertyName: resourceType
        mapping:
          ACTIVE_NUMBER: '#/components/schemas/CallbackPayloadActiveNumber'
          NUMBER_ORDER: '#/components/schemas/CallbackPayloadNumberOrder'
    CallbackConfigurationUpdate:
      title: CallbackConfigurationUpdate
      type: object
      properties:
        hmacSecret:
          type: string
          description: 'The HMAC secret to be updated for the specified project. It must be between 32 and 64 characters, alphanumeric (A-Z, a-z, 0-9) and hyphens (-) only. Regex pattern: ^[a-zA-Z0-9-]{32,64}$'
      description: The request to update the callbacks configuration for the current project.
    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
    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'
    CallbackPayloadCommon:
      type: object
      required:
      - resourceType
      properties:
        eventId:
          type: string
          description: The ID of the event.
          example: abcd1234efghijklmnop567890
        timestamp:
          type: string
          description: The date and time when the callback was created and added to the callbacks queue.
          example: '2023-06-06T07:45:27.785357'
        projectId:
          type: string
          description: The ID of the project to which the event belongs.
          example: abcd12ef-ab12-ab12-bc34-abcdef123456
        resourceType:
          $ref: '#/components/schemas/ResourceType'
    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'
    CallbackConfiguration:
      description: Response message containing the callbacks configuration for a specific project.
      type: object
      properties:
        projectId:
          type: string
          description: ID of the project the configuration belongs to.
          example: a99aa9aa-b888-777c-dd6d-ee55e5555555
        hmacSecret:
          type: string
          description: The HMAC secret used for hashing the callback body using the HMAC-SHA1 algorithm - and for creating the `X-Sinch-Signature` header.
          example: YOUR_hmac_secret
    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.
  responses:
    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: []
  parameters:
    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
  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