> This page is for APIs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# AI sidecar callback

POST 

Sent to the sidecar's `url` as an HTTP `POST` whenever you set one. The same event is always
published in real time on the SignalWire Relay event channel (`calling.ai.sidecar`), so the
webhook is optional. Each event is wrapped under `sidecar_event` — read that before checking its
`type` and fields.

This payload covers the envelope shared by every callback. For the fields specific to each `type`
(such as `insight.raw`, `turn.transcript_delta`, or `final.summary`), see the
[SWML ai_sidecar reference](/docs/swml/reference/calling/ai-sidecar#callback-types).

Reference: https://signalwire.com/docs/apis/rest/webhooks/ai-sidecar-callback

## Request

### Payload

- `call_info` (Webhooks.AI.AICallInfo, required) — Envelope describing the call. `project_id` and `space_id` are included when available.
- `sidecar_event` (Webhooks.AI.AISidecarEvent, required) — The sidecar callback.

## Types

### Webhooks.AI.AICallInfo

Identifies the call an AI callback came from. `project_id` and `space_id` are included when available.

- `call_id` (string, required) — ID of the call.
- `content_type` (string, required) — The content type of the POST body. Always `text/json`.
- `content_disposition` (string, required) — How the body is delivered. Always `post_data`.
- `conversation_type` (string, required) — The conversation type. Always `voice`.
- `project_id` (string, optional) — Your project ID.
- `space_id` (string, optional) — Your Space ID.

### Webhooks.AI.AISidecarEvent

One sidecar callback. Every event carries the four fields below; `type` decides what else comes with it, so read `type` first and expect properties beyond these.

- `type` (enum, required) — The callback type.
  - Allowed values: `start`, `turn`, `request`, `thought`, `insight`, `skip`, `tool_call`, `tool_result`, `action`, `global_data_change`, `history_pruned`, `error`, `ask_request`, `ask_answer`, `stop`, `final`
- `ts` (long, required) — When the event was produced, as a Unix timestamp in microseconds.
- `tick_id` (long, required) — Identifies the evaluation this callback came from. Callbacks produced in the same evaluation share a `tick_id`.
- `channel_data` (Webhooks.AI.AISidecarChannelData, required) — Identifies the call the event came from.

### Webhooks.AI.AISidecarChannelData

Identifies the call a sidecar callback came from. Each field is included when the call has it.

- `call_id` (string, optional) — ID of the call the sidecar is attached to.
- `caller_id_name` (string, optional) — The caller's name.
- `caller_id_number` (string, optional) — The caller's number.
- `destination_number` (string, optional) — The number that was called.