> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# Amazon Bedrock post-prompt callback

POST 

Sent to your [`amazon_bedrock.post_prompt_url`](/docs/swml/reference/calling/amazon-bedrock) when
the agent's session ends, carrying its answer to your `post_prompt` alongside the record of the
call. Nothing you return in the response is read.

Bedrock agents send a different report from [`ai`](/docs/swml/reference/calling/ai) agents. There
is no `call_timeline`, `previous_contexts`, `hard_timeout`, `call_ended_by`, or `ai_id_tag`;
`raw_call_log` is a copy of `call_log` rather than a separate unfiltered view; `swaig_log` is
always empty; `conversation_summary` is always present; and the `total_*` fields arrive without
your having to enable accounting. `post_prompt_url` also takes no separate credentials here — put
them in the URL as `username:password@url`. Write your handler against this payload, not the
[AI post-prompt callback](#tag/calls/webhook/aiPostPromptCallback).

Reference: https://signalwire.com/docs/apis/rest/webhooks/bedrock-post-prompt-callback

## Request

### Payload

- `content_type` (string, required) — The content type of the request body. Always `text/json`.
- `content_disposition` (string, required) — How the body is delivered. Always `agent.summary` for the end-of-call report.
- `conversation_type` (string, required) — The kind of conversation the agent ran. Always `voice`.
- `call_id` (string, required) — The ID of the call.
- `app_name` (string, required) — The name of your Bedrock application. Defaults to `bedrock`.
- `ai_session_id` (string, required) — The ID of the AI session on the call. Matches `call_id` for Bedrock agents.
- `action` (string, required) — What the request is asking of you. Always `post_conversation` for the end-of-call report.
- `call_log` (list of object, required) — The conversation. Each entry carries a `role` of `system`, `user`, or `assistant` and its `content`.
  - `role` (string, required) — Who produced the entry: `system`, `user`, `assistant`, or `tool`.
  - `content` (string, required) — The text of the entry.
  - `timestamp` (long, optional) — When the entry was added, as a Unix timestamp in microseconds. Omitted on entries without one.
  - `tool_calls` (list of object, optional) — The tool calls the agent made on this turn. Present only on a turn that made any.
- `raw_call_log` (list of object, required) — A copy of `call_log`. Bedrock agents do not keep a separate unfiltered log.
  - `role` (string, required) — Who produced the entry: `system`, `user`, `assistant`, or `tool`.
  - `content` (string, required) — The text of the entry.
  - `timestamp` (long, optional) — When the entry was added, as a Unix timestamp in microseconds. Omitted on entries without one.
  - `tool_calls` (list of object, optional) — The tool calls the agent made on this turn. Present only on a turn that made any.
- `post_prompt_data` (object, required) — The agent's answer to your `post_prompt`.
  - `parsed` (list of object, required) — Every JSON object found in the answer, parsed. An empty array when the agent answered in prose. Ask the post-prompt for named JSON keys when you want to count outcomes.
  - `raw` (string, required) — The answer exactly as the agent produced it.
  - `substituted` (string, optional) — The answer with the JSON removed, leaving only the surrounding prose. Omitted when the answer was JSON and nothing followed it.
- `global_data` (object, required) — The session's final `global_data`. An empty object when you seeded none.
- `swaig_log` (list of object, required) — Always an empty array. Bedrock agents do not report a tool-call log.
  - `command_name` (string, required) — The name of the function the agent called.
  - `command_arg` (string, required) — The arguments it passed, as the raw string the model produced.
  - `epoch_time` (integer, required) — When the call was made, as a Unix timestamp in seconds.
  - `native` (boolean, optional) — Always `true` when present, meaning the function ran inside the platform rather than on your server.
  - `active_count` (integer or string, optional) — How many times the function may still be called, or `endless` when it has no limit. Present only on a function you limited.
  - `url` (string, optional) — The URL the function was served from. Present when the call reached your server.
  - `post_data` (object, optional) — The body sent to your server. Present when the call reached it.
  - `post_response` (object, optional) — The response your server returned. Present when the call reached it and got a reply.
  - `delayed_post_response` (object, optional) — A response that arrived after the agent had already moved on. Present only when that happened.
  - `mcp_url` (string, optional) — The MCP server the tool was served from. Present only for an MCP-backed tool.
  - `mcp_tool` (string, optional) — The tool name on that MCP server. Present only for an MCP-backed tool.
  - `mcp_response` (string, optional) — What the MCP server returned. Present only for an MCP-backed tool.
  - `mcp_error` (boolean, optional) — Always `true` when present, meaning the MCP call failed.
- `conversation_summary` (string, required) — The agent's answer to your `post_prompt`, as plain text.
- `project_id` (string, optional) — Your project ID, when available.
- `space_id` (string, optional) — Your Space ID, when available.
- `conversation_id` (string, optional) — The conversation ID, when the agent was configured with one.
- `call_start_date` (long, optional) — When the call was created, as a Unix timestamp in microseconds.
- `call_answer_date` (long, optional) — When the call was answered, as a Unix timestamp in microseconds. `0` when it never was.
- `call_end_date` (long, optional) — When the call ended, as a Unix timestamp in microseconds. `0` while the call is still up.
- `ai_start_date` (long, optional) — When the agent started, as a Unix timestamp in microseconds.
- `ai_end_date` (long, optional) — When the agent stopped, as a Unix timestamp in microseconds. Omitted while it is still running.
- `caller_id_name` (string, optional) — The caller's name, when available.
- `caller_id_number` (string, optional) — The caller's number, when available.
- `times` (list of object, optional) — Per-response performance metrics, one entry per generated reply. Included once the agent has any.
  - `response` (string, required) — The reply text. Redacted when you enable `redact_prompt`.
  - `response_word_count` (integer, required) — How many words the reply contained.
  - `answer_time` (double, required) — How long the reply took to produce, in seconds.
  - `token_time` (double, required) — How long the model spent generating, in seconds. For an [`ai`](/docs/swml/reference/calling/ai) agent this is the span from the first token to the last; for an [`amazon_bedrock`](/docs/swml/reference/calling/amazon-bedrock) agent it is `answer_time` less a fixed startup estimate, so treat it as approximate there.
  - `tokens` (integer, required) — How many tokens the reply used.
  - `avg_tps` (double, required) — Average tokens per second across the reply.
  - `tps` (double, required) — Tokens per second for this reply.
- `total_minutes` (double, optional) — The number of billable minutes, with a minimum of one. Fractional durations are kept as they are; only a call under a minute is raised to `1`. Included once the agent has stopped.
- `total_input_tokens` (integer, optional) — Input tokens the session consumed. Included once the agent has stopped.
- `total_output_tokens` (integer, optional) — Output tokens the session produced. Included once the agent has stopped.
- `total_wire_input_tokens` (integer, optional) — A copy of `total_input_tokens`. Included once the agent has stopped.
- `total_wire_input_tokens_per_minute` (double, optional) — `total_input_tokens` divided by `total_minutes`. Included once the agent has stopped.
- `total_wire_output_tokens` (integer, optional) — A copy of `total_output_tokens`. Included once the agent has stopped.
- `total_wire_output_tokens_per_minute` (double, optional) — `total_output_tokens` divided by `total_minutes`. Included once the agent has stopped.
- `total_tts_chars` (integer, optional) — Characters sent to text-to-speech. Included once the agent has stopped.
- `total_tts_chars_per_min` (double, optional) — `total_tts_chars` divided by `total_minutes`. Included once the agent has stopped.
- `total_asr_minutes` (double, optional) — Minutes of audio sent to speech recognition. Included once the agent has stopped.
- `total_asr_cost_factor` (double, optional) — Always `1`. Bedrock agents do not vary the factor. Included once the agent has stopped.
- `SWMLVars` (object, optional) — SWML variables for the call. Included when the call carries SWML state.
- `SWMLCall` (object, optional) — SWML call state. Included when the call carries SWML state.