AI post-prompt callback
AI post-prompt callback
AI post-prompt callback
Sent to your ai.post_prompt_url when the AI session ends. It
carries the agent’s answer to your post_prompt
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 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 agents send a different report.
Write your handler against the
Bedrock post-prompt callback instead.
The content type of the request body. Always text/json.
How the body is delivered. agent.summary on the end-of-call report, agent.load_conversation
on a request for a stored conversation.
The kind of conversation the agent ran. Always voice.
What the request is asking of you. post_conversation is the end-of-call report;
fetch_conversation asks your endpoint to return a stored conversation.
The conversation, filtered: interrupted segments are consolidated and evicted entries dropped.
Included when action is post_conversation.
The conversation, unfiltered and append-only. Interruption detail appears here and nowhere else.
Included when action is post_conversation.
A flat stream of typed events aligned to raw_call_log, for replaying the call in order.
Included when the session produced any.
Always true when present, meaning the session ended because it hit its configured time limit
rather than finishing on its own. Omitted otherwise.
When the call was answered, as a Unix timestamp in microseconds. 0 when it never was.
Per-response performance metrics, one entry per generated reply. Included once the session has any.
The agent’s answer to your post_prompt. Included when action is post_conversation.
The session’s final global_data. Alongside anything you seeded, the session adds
caller_id_name and caller_id_number when the call carries them. Included when action is
post_conversation.
Every tool call the agent made, in order. Included when action is post_conversation.
The number of billable minutes, rounded up to at least one. Included when you enable
enable_accounting.
Input tokens the session consumed. Included when you enable enable_accounting.
Output tokens the session produced. Included when you enable enable_accounting.
Input tokens counted against the model, which differs from total_input_tokens when the
conversation was trimmed. Included when you enable enable_accounting.
total_wire_input_tokens divided by total_minutes. Included when you enable enable_accounting.
Output tokens counted against the model. Included when you enable enable_accounting.
total_wire_output_tokens divided by total_minutes. Included when you enable enable_accounting.
Characters sent to text-to-speech. Included when you enable enable_accounting.
total_tts_chars divided by total_minutes. Included when you enable enable_accounting.
Minutes of audio sent to speech recognition. Included when you enable enable_accounting.
total_asr_minutes divided by total_minutes. Included when you enable enable_accounting.
A plain-language summary of the conversation, for storing against conversation_id and handing
back on the next fetch_conversation. Included when you enable
save_conversation and set
a conversation_id.