For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# Get a chat

GET https://api.synthflow.ai/v2/chat/{chat_id}

Retrieve details of a specific chat session.

Reference: https://docs.synthflow.ai/api-reference/platform-api/chat/get-chat

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Synthflow APIs
  version: 1.0.0
paths:
  /chat/{chat_id}:
    get:
      operationId: get-chat
      summary: Get a chat
      description: Retrieve details of a specific chat session.
      tags:
        - subpackage_chat
      parameters:
        - name: chat_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Chat_get-chat_Response_200'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Get-chatRequestBadRequestError'
servers:
  - url: https://api.synthflow.ai/v2
  - url: https://api.us.synthflow.ai/v2
components:
  schemas:
    status:
      type: string
      description: Whether the request was successful.
      title: status
    ChatResponseChatStatus:
      type: string
      enum:
        - ongoing
        - completed
        - cancelled
      description: Current status of the chat session.
      title: ChatResponseChatStatus
    ChatMessage:
      type: object
      properties:
        agent_id:
          type: string
          description: ID of the agent (or 'user' for user messages).
        current_state:
          type: string
          description: The current state of the agent when this message was sent.
        message:
          type: string
          description: The message content.
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the message was sent.
        turn_number:
          type: integer
          description: The turn number in the conversation.
      required:
        - agent_id
        - current_state
        - message
        - timestamp
        - turn_number
      description: A single message in a chat conversation.
      title: ChatMessage
    ChatResponseInitialMessage:
      type: object
      properties:
        agent_message:
          type: string
          description: The message content from the agent.
        current_state:
          type: string
          description: The current state of the agent.
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the message was sent.
        turn_number:
          type: integer
          description: The turn number in the conversation.
      description: The initial message sent by the agent when the chat was created.
      title: ChatResponseInitialMessage
    FsmEventEventType:
      type: string
      enum:
        - fsm_started
        - state_executed
        - utterance_sent
        - state_transition
        - turn_changed
        - user_input
        - command_executed
        - command_received
        - command_failed
        - action_executed
        - action_failed
        - transition
        - error
      description: Type of the event.
      title: FsmEventEventType
    FSMEvent:
      type: object
      properties:
        event_type:
          $ref: '#/components/schemas/FsmEventEventType'
          description: Type of the event.
        state_id:
          type: string
          description: ID of the state where the event occurred.
        timestamp:
          type: integer
          description: Unix timestamp in milliseconds when the event occurred.
        details:
          type: object
          additionalProperties:
            description: Any type
          description: Additional details specific to the event type.
      required:
        - event_type
        - state_id
        - timestamp
        - details
      description: A single FSM event.
      title: FSMEvent
    FsmAgentLogExecutionStats:
      type: object
      properties:
        commands_executed:
          type: integer
          description: Number of commands executed.
        state_transitions:
          type: integer
          description: Number of state transitions.
        total_events:
          type: integer
          description: Total number of events executed.
      description: Statistics about FSM execution.
      title: FsmAgentLogExecutionStats
    FsmAgentLogFsmMetadata:
      type: object
      properties:
        name:
          type: string
          description: Name of the FSM.
      description: Metadata about the FSM.
      title: FsmAgentLogFsmMetadata
    FsmAgentLogVariablesValue:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
        - type: object
          additionalProperties:
            description: Any type
      description: The collected value of the variable.
      title: FsmAgentLogVariablesValue
    FsmAgentLogVariables:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/FsmAgentLogVariablesValue'
          description: The collected value of the variable.
        collected:
          type: boolean
          description: >-
            Whether this variable was successfully collected during the
            conversation.
      title: FsmAgentLogVariables
    FSMAgentLog:
      type: object
      properties:
        current_state:
          type: string
          description: The current state of the FSM.
        current_turn:
          type: string
          description: Identifier for the current turn in the conversation.
        event_summary:
          type: object
          additionalProperties:
            type: integer
          description: Summary of event counts by type.
        events:
          type: array
          items:
            $ref: '#/components/schemas/FSMEvent'
          description: List of FSM events that occurred during execution.
        execution_stats:
          $ref: '#/components/schemas/FsmAgentLogExecutionStats'
          description: Statistics about FSM execution.
        fsm_metadata:
          $ref: '#/components/schemas/FsmAgentLogFsmMetadata'
          description: Metadata about the FSM.
        state_path:
          type: array
          items:
            type: string
          description: Path of states visited during FSM execution.
        variables:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FsmAgentLogVariables'
          description: >-
            Collected variables (slots) from the conversation flow. Contains
            variable names as keys with their values and collection status.
      required:
        - current_state
        - current_turn
        - event_summary
        - events
        - execution_stats
        - fsm_metadata
        - variables
      description: FSM execution log for a specific agent in the chat session.
      title: FSMAgentLog
    ChatResponse:
      type: object
      properties:
        chat_id:
          type: string
          format: uuid
          description: Unique identifier for the chat session.
        chat_status:
          $ref: '#/components/schemas/ChatResponseChatStatus'
          description: Current status of the chat session.
        conversation_history:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
          description: List of messages in the conversation.
        initial_message:
          oneOf:
            - $ref: '#/components/schemas/ChatResponseInitialMessage'
            - type: 'null'
          description: The initial message sent by the agent when the chat was created.
        start_timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of when the chat session started.
        transcript:
          type: string
          description: Full transcript of the conversation.
        fsm_log:
          type:
            - object
            - 'null'
          additionalProperties:
            $ref: '#/components/schemas/FSMAgentLog'
          description: Finite State Machine (FSM) execution log for the chat session.
      required:
        - chat_id
        - chat_status
        - conversation_history
        - start_timestamp
        - transcript
      description: Chat session details.
      title: ChatResponse
    Chat_get-chat_Response_200:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/status'
        response:
          $ref: '#/components/schemas/ChatResponse'
      title: Chat_get-chat_Response_200
    Get-chatRequestBadRequestError:
      type: object
      properties: {}
      title: Get-chatRequestBadRequestError
  securitySchemes:
    sec0:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Chat_get-chat_example
import requests

url = "https://api.synthflow.ai/v2/chat/fe90071d-fd73-4755-87a4-6aaa0f9bfb25"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```go Chat_get-chat_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthflow.ai/v2/chat/fe90071d-fd73-4755-87a4-6aaa0f9bfb25"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Chat_get-chat_example
require 'uri'
require 'net/http'

url = URI("https://api.synthflow.ai/v2/chat/fe90071d-fd73-4755-87a4-6aaa0f9bfb25")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Chat_get-chat_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.synthflow.ai/v2/chat/fe90071d-fd73-4755-87a4-6aaa0f9bfb25")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```csharp Chat_get-chat_example
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/chat/fe90071d-fd73-4755-87a4-6aaa0f9bfb25");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Chat_get-chat_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/chat/fe90071d-fd73-4755-87a4-6aaa0f9bfb25")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```