---
title: "PUT /rerun-chat-analysis/{chat_id}"
method: PUT
path: "/rerun-chat-analysis/{chat_id}"
---

# PUT /rerun-chat-analysis/{chat_id}

`PUT /rerun-chat-analysis/{chat_id}`

## Request

- Base URL: `https://api.retellai.com`
- URL: `https://api.retellai.com/rerun-chat-analysis/{chat_id}`
- Auth: HTTP bearer

Rerun post-chat analysis for a specific chat. This operation incurs charges.

## Path parameters

- `chat_id` string, required

## Response `201`

Chat analysis rerun successfully.

- ChatResponse
  - `chat_id` string, required: Unique id of the chat.
  - `agent_id` string, required: Corresponding chat agent id of this chat.
  - `version` integer, nullable: The version of the agent
  - `agent_tag` string, nullable: Tag pointing at the agent version used for this chat
  - `retell_llm_dynamic_variables` object: Add optional dynamic variables in key value pairs of string that injects into your Response Engine prompt and tool description. Only applicable for Response Engine.
  - `collected_dynamic_variables` object: Dynamic variables collected from the chat. Only available after the chat ends.
  - `chat_status` 'ongoing' | 'ended' | 'error', required: Status of chat. - `ongoing`: Chat session is ongoing, chat agent can receive new message and generate response. - `ended`: Chat session has ended, and no longer can generate new response. - `error`: Chat encountered error.
  - `chat_type` 'api_chat' | 'sms_chat': Type of the chat
  - `custom_attributes` object: Custom attributes for the chat
  - `start_timestamp` integer: Begin timestamp (milliseconds since epoch) of the chat. Available after chat starts.
  - `end_timestamp` integer, nullable: End timestamp (milliseconds since epoch) of the chat. Available after chat ends.
  - `transcript` string: Transcription of the chat.
  - `message_with_tool_calls` MessageOrToolCall[]: Transcript of the chat weaved with tool call invocation and results.
    - union
      - Message
        - `message_id` string, required: Unique id of the message
        - `role` 'agent' | 'user', required: Documents whether this message is sent by agent or user.
        - `content` string, required: Content of the message
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments received with this message (MMS). Display only; a textual summary of each attachment is already included in content. Response only — supplying it in a request has no effect and is silently ignored. Omitted from PII-scrubbed messages.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallInvocationMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_invocation', required: This is a tool call invocation.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `name` string, required: Name of the tool. This is the configured tool name, or the node name for a built-in conversation flow node, so it can contain spaces and non-ASCII characters. To identify the kind of tool, use `type`.
        - `type` string: Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, `book_appointment_cal`, and `check_availability_cal`. New values can be added. Absent on tool calls sent by a custom LLM, and on some older calls and chats.
        - `arguments` string, required: Arguments for this tool call, it's a stringified JSON object.
        - `thought_signature` string: Optional thought signature from Google Gemini thinking models. This is used internally to maintain reasoning chain in multi-turn function calling.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallResultMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_result', required: This is the result of a tool call.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `content` string, required: Result of the tool call, can be a string, a stringified json, etc.
        - `successful` boolean: Whether the tool call was successful.
        - `created_timestamp` integer, required: Create timestamp of the message
      - NodeTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'node_transition', required: This is a node transition.
        - `former_node_id` string: Former node id
        - `former_node_name` string: Former node name
        - `new_node_id` string: New node id
        - `new_node_name` string: New node name
        - `transition_type` 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal': How this node was reached. "global" means a global node transition, "global_go_back" means returning from a global node, "interrupt_go_back" means going back due to user interruption, and "normal" means a regular edge transition.
        - `created_timestamp` integer, required: Create timestamp of the message
      - StateTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'state_transition', required: This is a state transition.
        - `former_state_name` string: Former state name
        - `new_state_name` string: New state name
        - `created_timestamp` integer, required: Create timestamp of the message
      - InjectedMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'injected', required: External context injected into the conversation via the update-live-call API. Not spoken by either party.
        - `content` string, required: The injected context text.
        - `created_timestamp` integer, required: Create timestamp of the message
      - SmsMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'sms', required: SMS message exchanged during the call (for example received from the user). Woven into the transcript and shown to the agent, but not part of the spoken conversation.
        - `content` string, required: Text content of the SMS message.
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments (MMS). Display only; not relayed into the spoken conversation.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
  - `pre_session_message_with_tool_calls` MessageOrToolCall[]: Tool call invocations and results of integration tools run before the chat's first message (pre-session). Stored separately from the main transcript. Available once pre-session integration tools have run (from the chat's first turn).
    - union
      - Message
        - `message_id` string, required: Unique id of the message
        - `role` 'agent' | 'user', required: Documents whether this message is sent by agent or user.
        - `content` string, required: Content of the message
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments received with this message (MMS). Display only; a textual summary of each attachment is already included in content. Response only — supplying it in a request has no effect and is silently ignored. Omitted from PII-scrubbed messages.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallInvocationMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_invocation', required: This is a tool call invocation.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `name` string, required: Name of the tool. This is the configured tool name, or the node name for a built-in conversation flow node, so it can contain spaces and non-ASCII characters. To identify the kind of tool, use `type`.
        - `type` string: Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, `book_appointment_cal`, and `check_availability_cal`. New values can be added. Absent on tool calls sent by a custom LLM, and on some older calls and chats.
        - `arguments` string, required: Arguments for this tool call, it's a stringified JSON object.
        - `thought_signature` string: Optional thought signature from Google Gemini thinking models. This is used internally to maintain reasoning chain in multi-turn function calling.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallResultMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_result', required: This is the result of a tool call.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `content` string, required: Result of the tool call, can be a string, a stringified json, etc.
        - `successful` boolean: Whether the tool call was successful.
        - `created_timestamp` integer, required: Create timestamp of the message
      - NodeTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'node_transition', required: This is a node transition.
        - `former_node_id` string: Former node id
        - `former_node_name` string: Former node name
        - `new_node_id` string: New node id
        - `new_node_name` string: New node name
        - `transition_type` 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal': How this node was reached. "global" means a global node transition, "global_go_back" means returning from a global node, "interrupt_go_back" means going back due to user interruption, and "normal" means a regular edge transition.
        - `created_timestamp` integer, required: Create timestamp of the message
      - StateTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'state_transition', required: This is a state transition.
        - `former_state_name` string: Former state name
        - `new_state_name` string: New state name
        - `created_timestamp` integer, required: Create timestamp of the message
      - InjectedMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'injected', required: External context injected into the conversation via the update-live-call API. Not spoken by either party.
        - `content` string, required: The injected context text.
        - `created_timestamp` integer, required: Create timestamp of the message
      - SmsMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'sms', required: SMS message exchanged during the call (for example received from the user). Woven into the transcript and shown to the agent, but not part of the spoken conversation.
        - `content` string, required: Text content of the SMS message.
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments (MMS). Display only; not relayed into the spoken conversation.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
  - `scrubbed_pre_session_message_with_tool_calls` MessageOrToolCall[]: Pre-session integration tool call invocations and results, without PII. Available after chat ends if pre-session integration tools ran and PII scrubbing is enabled.
    - union
      - Message
        - `message_id` string, required: Unique id of the message
        - `role` 'agent' | 'user', required: Documents whether this message is sent by agent or user.
        - `content` string, required: Content of the message
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments received with this message (MMS). Display only; a textual summary of each attachment is already included in content. Response only — supplying it in a request has no effect and is silently ignored. Omitted from PII-scrubbed messages.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallInvocationMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_invocation', required: This is a tool call invocation.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `name` string, required: Name of the tool. This is the configured tool name, or the node name for a built-in conversation flow node, so it can contain spaces and non-ASCII characters. To identify the kind of tool, use `type`.
        - `type` string: Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, `book_appointment_cal`, and `check_availability_cal`. New values can be added. Absent on tool calls sent by a custom LLM, and on some older calls and chats.
        - `arguments` string, required: Arguments for this tool call, it's a stringified JSON object.
        - `thought_signature` string: Optional thought signature from Google Gemini thinking models. This is used internally to maintain reasoning chain in multi-turn function calling.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallResultMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_result', required: This is the result of a tool call.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `content` string, required: Result of the tool call, can be a string, a stringified json, etc.
        - `successful` boolean: Whether the tool call was successful.
        - `created_timestamp` integer, required: Create timestamp of the message
      - NodeTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'node_transition', required: This is a node transition.
        - `former_node_id` string: Former node id
        - `former_node_name` string: Former node name
        - `new_node_id` string: New node id
        - `new_node_name` string: New node name
        - `transition_type` 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal': How this node was reached. "global" means a global node transition, "global_go_back" means returning from a global node, "interrupt_go_back" means going back due to user interruption, and "normal" means a regular edge transition.
        - `created_timestamp` integer, required: Create timestamp of the message
      - StateTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'state_transition', required: This is a state transition.
        - `former_state_name` string: Former state name
        - `new_state_name` string: New state name
        - `created_timestamp` integer, required: Create timestamp of the message
      - InjectedMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'injected', required: External context injected into the conversation via the update-live-call API. Not spoken by either party.
        - `content` string, required: The injected context text.
        - `created_timestamp` integer, required: Create timestamp of the message
      - SmsMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'sms', required: SMS message exchanged during the call (for example received from the user). Woven into the transcript and shown to the agent, but not part of the spoken conversation.
        - `content` string, required: Text content of the SMS message.
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments (MMS). Display only; not relayed into the spoken conversation.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
  - `post_session_message_with_tool_calls` MessageOrToolCall[]: Tool call invocations and results of integration tools run after post-chat analysis (post-session). Stored separately from the main transcript. Available after chat ends if post-session integration tools ran.
    - union
      - Message
        - `message_id` string, required: Unique id of the message
        - `role` 'agent' | 'user', required: Documents whether this message is sent by agent or user.
        - `content` string, required: Content of the message
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments received with this message (MMS). Display only; a textual summary of each attachment is already included in content. Response only — supplying it in a request has no effect and is silently ignored. Omitted from PII-scrubbed messages.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallInvocationMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_invocation', required: This is a tool call invocation.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `name` string, required: Name of the tool. This is the configured tool name, or the node name for a built-in conversation flow node, so it can contain spaces and non-ASCII characters. To identify the kind of tool, use `type`.
        - `type` string: Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, `book_appointment_cal`, and `check_availability_cal`. New values can be added. Absent on tool calls sent by a custom LLM, and on some older calls and chats.
        - `arguments` string, required: Arguments for this tool call, it's a stringified JSON object.
        - `thought_signature` string: Optional thought signature from Google Gemini thinking models. This is used internally to maintain reasoning chain in multi-turn function calling.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallResultMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_result', required: This is the result of a tool call.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `content` string, required: Result of the tool call, can be a string, a stringified json, etc.
        - `successful` boolean: Whether the tool call was successful.
        - `created_timestamp` integer, required: Create timestamp of the message
      - NodeTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'node_transition', required: This is a node transition.
        - `former_node_id` string: Former node id
        - `former_node_name` string: Former node name
        - `new_node_id` string: New node id
        - `new_node_name` string: New node name
        - `transition_type` 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal': How this node was reached. "global" means a global node transition, "global_go_back" means returning from a global node, "interrupt_go_back" means going back due to user interruption, and "normal" means a regular edge transition.
        - `created_timestamp` integer, required: Create timestamp of the message
      - StateTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'state_transition', required: This is a state transition.
        - `former_state_name` string: Former state name
        - `new_state_name` string: New state name
        - `created_timestamp` integer, required: Create timestamp of the message
      - InjectedMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'injected', required: External context injected into the conversation via the update-live-call API. Not spoken by either party.
        - `content` string, required: The injected context text.
        - `created_timestamp` integer, required: Create timestamp of the message
      - SmsMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'sms', required: SMS message exchanged during the call (for example received from the user). Woven into the transcript and shown to the agent, but not part of the spoken conversation.
        - `content` string, required: Text content of the SMS message.
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments (MMS). Display only; not relayed into the spoken conversation.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
  - `scrubbed_post_session_message_with_tool_calls` MessageOrToolCall[]: Post-session integration tool call invocations and results, without PII. Available after chat ends if post-session integration tools ran and PII scrubbing is enabled.
    - union
      - Message
        - `message_id` string, required: Unique id of the message
        - `role` 'agent' | 'user', required: Documents whether this message is sent by agent or user.
        - `content` string, required: Content of the message
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments received with this message (MMS). Display only; a textual summary of each attachment is already included in content. Response only — supplying it in a request has no effect and is silently ignored. Omitted from PII-scrubbed messages.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallInvocationMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_invocation', required: This is a tool call invocation.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `name` string, required: Name of the tool. This is the configured tool name, or the node name for a built-in conversation flow node, so it can contain spaces and non-ASCII characters. To identify the kind of tool, use `type`.
        - `type` string: Kind of tool. Known values are `custom`, `code`, `mcp`, `integration_app`, `end_call`, `transfer_call`, `bridge_transfer`, `cancel_transfer`, `agent_swap`, `press_digit`, `send_sms`, `extract_dynamic_variable`, `adjust_voice_speed`, `book_appointment_cal`, and `check_availability_cal`. New values can be added. Absent on tool calls sent by a custom LLM, and on some older calls and chats.
        - `arguments` string, required: Arguments for this tool call, it's a stringified JSON object.
        - `thought_signature` string: Optional thought signature from Google Gemini thinking models. This is used internally to maintain reasoning chain in multi-turn function calling.
        - `created_timestamp` integer, required: Create timestamp of the message
      - ToolCallResultMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'tool_call_result', required: This is the result of a tool call.
        - `tool_call_id` string, required: Tool call id, globally unique.
        - `content` string, required: Result of the tool call, can be a string, a stringified json, etc.
        - `successful` boolean: Whether the tool call was successful.
        - `created_timestamp` integer, required: Create timestamp of the message
      - NodeTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'node_transition', required: This is a node transition.
        - `former_node_id` string: Former node id
        - `former_node_name` string: Former node name
        - `new_node_id` string: New node id
        - `new_node_name` string: New node name
        - `transition_type` 'global' | 'global_go_back' | 'interrupt_go_back' | 'normal': How this node was reached. "global" means a global node transition, "global_go_back" means returning from a global node, "interrupt_go_back" means going back due to user interruption, and "normal" means a regular edge transition.
        - `created_timestamp` integer, required: Create timestamp of the message
      - StateTransitionMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'state_transition', required: This is a state transition.
        - `former_state_name` string: Former state name
        - `new_state_name` string: New state name
        - `created_timestamp` integer, required: Create timestamp of the message
      - InjectedMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'injected', required: External context injected into the conversation via the update-live-call API. Not spoken by either party.
        - `content` string, required: The injected context text.
        - `created_timestamp` integer, required: Create timestamp of the message
      - SmsMessage
        - `message_id` string, required: Unique id of the message
        - `role` 'sms', required: SMS message exchanged during the call (for example received from the user). Woven into the transcript and shown to the agent, but not part of the spoken conversation.
        - `content` string, required: Text content of the SMS message.
        - `multimedia` SmsMultimediaItem[]: Multimedia attachments (MMS). Display only; not relayed into the spoken conversation.
          - `url` string, required: URL of the multimedia attachment.
          - `summary` string: Optional textual summary of the attachment.
        - `created_timestamp` integer, required: Create timestamp of the message
  - `metadata` object: An arbitrary object for storage purpose only. You can put anything here like your internal customer id associated with the chat. Not used for processing. You can later get this field from the chat object.
  - `chat_cost` object
    - `product_costs` ProductCost[]: List of products with their unit prices and costs in cents
      - `product` string, required: Product name that has a cost associated with it.
      - `unit_price` number: Unit price of the product in cents per second.
      - `cost` number, required: Cost for the product in cents for the duration of the call.
      - `is_transfer_leg_cost` boolean: True if this cost item is for a transfer segment.
    - `combined_cost` number: Combined cost of all individual costs in cents
  - `chat_analysis` ChatAnalysis
    - `chat_summary` string: A high level summary of the chat.
    - `user_sentiment` 'Negative' | 'Positive' | 'Neutral' | 'Unknown': Sentiment of the user in the chat.
    - `chat_successful` boolean: Whether the agent seems to have a successful chat with the user, where the agent finishes the task, and the call was complete without being cutoff.
    - `custom_analysis_data` object: Custom analysis data that was extracted based on the schema defined in chat agent post chat analysis data. Can be empty if nothing is specified.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `404`: Not Found
- `422`: Unprocessable Content
- `429`: Too Many Requests
- `500`: Internal Server Error

## Changes

- **2026-10-16** `ca41f0dbb297`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/retellai/apis/retell-sdk/changes/rerun-chat-analysis/:chat_id/put.md)

---

[API](https://skmtc.dev/retellai/apis/retell-sdk.md) - [All operations](https://skmtc.dev/retellai/apis/retell-sdk/llms.txt) - [OpenAPI document](https://skmtc.dev/retellai/apis/retell-sdk/revisions/e482acaa292c?raw)
