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

# 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 replies with a JSON object. Both fields are optional, so `{}`
is a valid reply:

- `response` — the result the model reads next. A plain string only; the
  `{tool_result, tool_prompt}` object form that [`ai`](/docs/swml/reference/calling/ai) agents
  accept is not read. Omit it and the model reads a default result.
- `action` — a single action object or an array of them. See
  [Supported SWAIG actions](/docs/swml/reference/calling/ai-sidecar#supported-swaig-actions) for
  what you can return.

There is no `post_process` on a sidecar reply.

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

- WebhooksAIAISidecarSwaigToolWebhookPayload
  - `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 — Any text that surrounded the JSON, with the JSON itself removed. Omitted when the whole argument was JSON, which is the usual case.
  - `call_id` string — 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` WebhooksAIAISidecarChannelData, required — Identifies the call a sidecar callback came from. Each field is included when the call has it.
    - `call_id` string — ID of the call the sidecar is attached to.
    - `caller_id_name` string — The caller's name.
    - `caller_id_number` string — The caller's number.
    - `destination_number` string — The number that was called.

## 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/a884f7dcbfc3/schema)
