CTRLK

Shared components

CML webhooks

|

View as Markdown

Webhooks enable your application to receive call event data and return CML actions. Calls Markup Language uses two types of webhooks: synchronous and asynchronous.

Synchronous webhooks

With synchronous webhooks, the Infobip platform sends a request to your webhook URL. Your webhook must respond with a 200 OK status code and a response payload that includes the next CML actions to run.

Every synchronous webhook request includes a base payload with the following fields: callId, from, to, direction, endpoint, and startTime. Depending on the CML action that triggered the webhook request, additional data is included with the base payload.

The following synchronous webhook callbacks are available:

  • Error callback: Triggered when any synchronous callback URL is not reachable or returns malformed CML actions. Adds the error code and error details to the base payload. See the error callback API reference.
  • Record callback: Triggered when the Infobip platform stops a call recording produced by a record action. Adds the recording file ID and recording status to the base payload. See the record callback API reference.
  • Capture DTMF callback: Triggered by the captureDtmf action. Adds the captured DTMF digits to the base payload. See the capture DTMF callback API reference.
  • Fetch callback: Triggered by the fetch action. Does not add data to the base payload. See the fetch callback API reference.
  • Machine detection callback: Triggered when creating an outbound call that uses synchronous machine detection. Adds a simplified detection result (machine or human) and a detailed detection result (array of confidence scores per detection class) to the base payload. See the machine detection callback API reference.
  • Dial callback: Triggered when using the dial action. Adds data related to the dial instruction to the base payload. See the dial callback API reference.

Asynchronous webhooks

Asynchronous webhooks are informational only. The Infobip platform sends a request to your webhook URL, and your webhook must respond with a 200 OK status code without any response payload. Do not return CML actions in the response.

Every asynchronous webhook request includes the same base payload as synchronous webhooks: callId, from, to, direction, endpoint, and startTime. Depending on the event, additional data is included with the base payload.

The following asynchronous webhook callbacks are available:

  • Machine detection async callback: Triggered when creating an outbound call that uses asynchronous machine detection. Adds a simplified detection result (machine or human) and a detailed detection result (array of confidence scores per detection class) to the base payload. See the machine detection async callback API reference.
  • Machine message detection async callback: Triggered when creating an outbound call that uses asynchronous machine detection with end of message detection enabled. Adds information about what triggered the end of message detection to the base payload. See the machine message detection async callback API reference.
  • Recording status callback: Triggered when using the startRecording action. Adds the recording file ID and recording status to the base payload. See the recording status callback API reference.

Was this page helpful?