Calls
AI SWAIG tool webhook
Sent to a tool's web_hook_url (or the SWAIG defaults.web_hook_url) when an ai agent calls one of your functions. Your endpoint runs the function and returns a JSON object with a response string (the result the AI reads next) and, optionally, an action — a single object or an array — telling the agent what to do.
postWebhookaiSwaigToolWebhook
Payload
Example payload
{
"function": "get_weather",
"argument": {
"parsed": [
{
"city": "San Francisco"
}
],
"raw": "{\"city\":\"San Francisco\"}",
"substituted": "{\"city\":\"San Francisco\"}"
},
"description": "Look up the current weather for a city.",
"call_id": "2e1e66e5-5d07-413d-9668-55542992eec0",
"ai_session_id": "a0d4e6e5-5d07-413d-9668-55542992eec0",
"app_name": "ai",
"meta_data_token": "my-token",
"caller_id_name": "Jane Doe",
"caller_id_num": "+15555550100",
"channel_active": true,
"channel_offhook": true,
"channel_ready": true,
"content_type": "text/swaig",
"version": "2.0",
"content_disposition": "SWAIG Function"
}Response
Webhook received