AI post-prompt callback

View as MarkdownOpen in Claude
Sent to your [`ai.post_prompt_url`](/docs/swml/reference/calling/ai) when the AI session ends. It carries the agent's answer to your [`post_prompt`](/docs/swml/reference/calling/ai) alongside the full record of the call: the conversation, the tool calls, the timings, and the token counts. This is the one report you get per call, so store the body verbatim and extract only the fields you query. Nothing you return in the response is read. Read `action` first. It is `post_conversation` on the end-of-call report described here. The same URL also receives `fetch_conversation` when the agent starts with a stored conversation ([`save_conversation`](/docs/swml/reference/calling/ai/params#paramssave_conversation) with a `conversation_id`), asking your endpoint to return that conversation; that request carries the call and session fields but none of the summary fields. Answer it with the stored `conversation_summary`. The conversation appears three times. `call_log` is the filtered view, with interrupted segments consolidated. `raw_call_log` is unfiltered and append-only, and is the only place barge-in detail survives. `call_timeline` is a flat stream of typed events aligned to `raw_call_log`. [`amazon_bedrock`](/docs/swml/reference/calling/amazon-bedrock) agents send a different report. Write your handler against the [Bedrock post-prompt callback](#tag/calls/webhook/bedrockPostPromptCallback) instead.