> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://one.miles-api.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://one.miles-api.com/_mcp/server.

# Get Chats

GET https://api.milescaira.com/v7/chatbot/get_chats/

Expired chat sessions + messages (reads the separate summarization DB).

Reference: https://one.miles-api.com/api-reference/engagement/chatbot/get-chats-v-7-chatbot-get-chats-get

## Servers

- `https://api.milescaira.com` (Production, default)
- `https://miles-usp-backend-uat-2-154625965269.asia-south1.run.app` (UAT)
- `http://localhost:8080` (Local)

## Request

### Query parameters

- `assume_tz` (string, optional, default: UTC)
- `as_of` (string, optional, nullable)
- `limit` (integer, optional, nullable)

## Response

### 200

Successful Response

- `list of ExpiredSessionOut`

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ExpiredSessionOut

A single expired chat session + its ordered messages (``get_chats``).

- `sso_user_id` (string, required)
- `session_id` (string, required)
- `chats` (list of any, optional)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
[
  {
    "sso_user_id": "string",
    "session_id": "string",
    "chats": [
      null
    ]
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.milescaira.com/v7/chatbot/get_chats/"

response = requests.get(url)

print(response.json())
```

```go
package main

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

func main() {

	url := "https://api.milescaira.com/v7/chatbot/get_chats/"

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

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

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

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

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.milescaira.com/v7/chatbot/get_chats/")
  .asString();
```