---
title: "Amazon Bedrock post-prompt callback"
method: POST
path: "bedrockPostPromptCallback"
tags: ["AI Webhooks"]
---

# Amazon Bedrock post-prompt callback

`POST bedrockPostPromptCallback` (webhook)

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).

## Payload

- WebhooksAIBedrockPostPromptCallbackPayload
  - `project_id` string — Your project ID, when available.
  - `space_id` string — Your Space ID, when available.
  - `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.
  - `conversation_id` string — The conversation ID, when the agent was configured with one.
  - `action` string, required — What the request is asking of you. Always `post_conversation` for the end-of-call report.
  - `call_log` WebhooksAIAICallLogEntry[], 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` integer — When the entry was added, as a Unix timestamp in microseconds. Omitted on entries without one.
    - `tool_calls` object[] — The tool calls the agent made on this turn. Present only on a turn that made any.
  - `raw_call_log` WebhooksAIAICallLogEntry[], 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` integer — When the entry was added, as a Unix timestamp in microseconds. Omitted on entries without one.
    - `tool_calls` object[] — The tool calls the agent made on this turn. Present only on a turn that made any.
  - `call_start_date` integer — When the call was created, as a Unix timestamp in microseconds.
  - `call_answer_date` integer — When the call was answered, as a Unix timestamp in microseconds. `0` when it never was.
  - `call_end_date` integer — When the call ended, as a Unix timestamp in microseconds. `0` while the call is still up.
  - `ai_start_date` integer — When the agent started, as a Unix timestamp in microseconds.
  - `ai_end_date` integer — When the agent stopped, as a Unix timestamp in microseconds. Omitted while it is still running.
  - `caller_id_name` string — The caller's name, when available.
  - `caller_id_number` string — The caller's number, when available.
  - `times` WebhooksAIAIResponseTiming[] — 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` number, required — How long the reply took to produce, in seconds.
    - `token_time` number, 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` number, required — Average tokens per second across the reply.
    - `tps` number, required — Tokens per second for this reply.
  - `total_minutes` number — 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 — Input tokens the session consumed. Included once the agent has stopped.
  - `total_output_tokens` integer — Output tokens the session produced. Included once the agent has stopped.
  - `total_wire_input_tokens` integer — A copy of `total_input_tokens`. Included once the agent has stopped.
  - `total_wire_input_tokens_per_minute` number — `total_input_tokens` divided by `total_minutes`. Included once the agent has stopped.
  - `total_wire_output_tokens` integer — A copy of `total_output_tokens`. Included once the agent has stopped.
  - `total_wire_output_tokens_per_minute` number — `total_output_tokens` divided by `total_minutes`. Included once the agent has stopped.
  - `total_tts_chars` integer — Characters sent to text-to-speech. Included once the agent has stopped.
  - `total_tts_chars_per_min` number — `total_tts_chars` divided by `total_minutes`. Included once the agent has stopped.
  - `total_asr_minutes` number — Minutes of audio sent to speech recognition. Included once the agent has stopped.
  - `total_asr_cost_factor` number — Always `1`. Bedrock agents do not vary the factor. Included once the agent has stopped.
  - `SWMLVars` object — SWML variables for the call. Included when the call carries SWML state.
  - `SWMLCall` object — SWML call state. Included when the call carries SWML state.
  - `post_prompt_data` WebhooksAIAIPostPromptData, required — The answer an AI agent gave to your [`post_prompt`](/docs/swml/reference/calling/ai), in three forms.
    - `parsed` 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 — 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` WebhooksAIAISwaigLogEntry[], 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 — Always `true` when present, meaning the function ran inside the platform rather than on your server.
    - `active_count` union — How many times the function may still be called, or `endless` when it has no limit. Present only on a function you limited.
      - integer
      - string
    - `url` string — The URL the function was served from. Present when the call reached your server.
    - `post_data` object — The body sent to your server. Present when the call reached it.
    - `post_response` object — The response your server returned. Present when the call reached it and got a reply.
    - `delayed_post_response` object — A response that arrived after the agent had already moved on. Present only when that happened.
    - `mcp_url` string — The MCP server the tool was served from. Present only for an MCP-backed tool.
    - `mcp_tool` string — The tool name on that MCP server. Present only for an MCP-backed tool.
    - `mcp_response` string — What the MCP server returned. Present only for an MCP-backed tool.
    - `mcp_error` boolean — Always `true` when present, meaning the MCP call failed.
  - `conversation_summary` string, required — The agent's answer to your `post_prompt`, as plain text.

## Acknowledgement `200`

Webhook received

---

[API](https://skmtc.net/signalwire/apis/signalwire-rest-api.md) · [All operations](https://skmtc.net/signalwire/apis/signalwire-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/signalwire/signalwire-rest-api/revisions/a884f7dcbfc3/schema)
