> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thinnest.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Chat

> Retrieve a chat session with full message history.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.thinnest.ai/v2/chats/{session_id} \
    -H "Authorization: Bearer $THINNESTAI_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.thinnest.ai/v2/chats/{session_id}"
  headers = {
      "Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
  }

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.thinnest.ai/v2/chats/{session_id}", {
    method: "GET",
    headers: {
      "Authorization": "Bearer " + "YOUR_THINNESTAI_API_KEY",
    },
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

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

  func main() {
      req, _ := http.NewRequest("GET", "https://api.thinnest.ai/v2/chats/{session_id}", nil)
      req.Header.Set("Authorization", "Bearer YOUR_THINNESTAI_API_KEY")

      resp, err := http.DefaultClient.Do(req)
      if err != nil { panic(err) }
      defer resp.Body.Close()
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</RequestExample>

### Response `200`

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "sess_abc123",
    "agent_id": 5,
    "name": "Sales inquiry",
    "source": "dashboard",
    "messages": [
      { "role": "user", "content": "What's the pricing?", "timestamp": "2026-03-25T10:00:01Z" },
      { "role": "assistant", "content": "Our pricing starts at...", "timestamp": "2026-03-25T10:00:03Z" }
    ],
    "created_at": "2026-03-25T10:00:00Z",
    "updated_at": "2026-03-25T10:15:00Z"
  }
  ```
</ResponseExample>

### Errors

| Code  | Description                        |
| ----- | ---------------------------------- |
| `404` | Chat session not found             |
| `403` | Not authorized to access this chat |
