---
title: "AI sidecar SWAIG tool webhook"
method: POST
path: "aiSidecarSwaigToolWebhook"
tags: ["Calls"]
---

# AI sidecar SWAIG tool webhook

`POST aiSidecarSwaigToolWebhook` (webhook)

Sent to a sidecar tool's `web_hook_url` (or the SWAIG `defaults.web_hook_url`) when the sidecar
calls one of your functions. Your endpoint runs the function and returns a JSON object with a
`response` string (the result the model reads next) and, optionally, an `action` — a single object
or an array — telling the sidecar what to do. See
[Supported SWAIG actions](/docs/swml/reference/calling/ai-sidecar#supported-swaig-actions) for what
you can return.

The sidecar only listens to the call and never speaks on it, so a `say` action is reported back to
you as a callback rather than being spoken aloud.

## Payload

- object — Sent to a sidecar tool's `web_hook_url` (or the SWAIG `defaults.web_hook_url`) when the sidecar calls one of your functions. Your endpoint runs the function and returns a JSON object with a `response` string (the result the model reads next) and, optionally, an `action` — a single object or an array — telling the sidecar what to do. See [Supported SWAIG actions](/docs/swml/reference/calling/ai-sidecar#supported-swaig-actions) for what you can return. The sidecar only listens to the call and never speaks on it, so a `say` action is reported back to you as a callback rather than being spoken aloud.
  - `function` string, required — The name of the function the model is calling.
  - `argument` object, required — The arguments the model passed to your function.
    - `parsed` object[], required — The arguments parsed into objects. Usually a single-element array.
    - `raw` string, required — The raw argument string, exactly as the model produced it.
    - `substituted` string, required — The raw argument string after any variable substitution.
  - `call_id` string, required — The ID of the call the sidecar is attached to.
  - `global_data` object — The sidecar's current `global_data`. Present when the sidecar has any.
  - `channel_data` object, required — Call/channel context.
    - `call_id` string, required — ID of the call.
    - `caller_id_name` string — Caller ID name. Present when available.
    - `caller_id_number` string — Caller ID number. Present when available.
    - `destination_number` string — Destination number. Present when available.

## Acknowledgement `200`

Webhook received

---

[API](https://skmtc.net/signalwire/apis/signalwire-rest-api.md) · [All operations](https://skmtc.net/signalwire/apis/signalwire-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/signalwire/signalwire-rest-api/revisions/ad46a79d07e4/schema)
