Calls
Amazon Bedrock SWAIG tool webhook
Sent to a tool's web_hook_url (or the SWAIG defaults.web_hook_url) when an amazon_bedrock agent calls one of your functions. Your endpoint runs the function and returns a JSON object with a response string (the result the agent reads next) and, optionally, an action — a single object or an array — telling the agent what to do.
Bedrock agents send a different payload from ai agents. Notably content_type is text/json rather than text/swaig, argument carries no substituted value, there is no version, description, or argument_desc, and the call's timing and caller fields are named differently. Write your handler against this payload, not the AI SWAIG tool webhook.
postWebhookbedrockSwaigToolWebhook
Payload
Example payload
{
"function": "get_weather",
"argument": {
"parsed": [
{
"city": "San Francisco"
}
],
"raw": "{\"city\":\"San Francisco\"}"
},
"call_id": "2e1e66e5-5d07-413d-9668-55542992eec0",
"ai_session_id": "2e1e66e5-5d07-413d-9668-55542992eec0",
"app_name": "bedrock",
"caller_id": "+15555550100",
"global_data": {
"customer_tier": "premium",
"pickup_address": "123 Main St, Springfield"
},
"content_type": "text/json",
"content_disposition": "agent.function",
"conversation_type": "voice",
"action": "fetch_conversation",
"project_id": "4d0d6f16-5881-4fcc-92a4-02c51a91954d",
"space_id": "451ed9ff-e568-4222-8af9-4f9ab7428d09",
"caller_id_name": "Jane Doe",
"caller_id_number": "+15555550100",
"meta_data_token": "d742c5d1d969d9fdbbd9bd1c52499f2d",
"meta_data": {
"order_number": "12345"
}
}Response
Webhook received