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

# Sessions

> Manage conversation sessions.

## Get current session

```bash theme={null}
curl http://localhost:6877/session \
  -H "Authorization: Bearer $API_KEY"
```

```json theme={null}
{
  "session_id": "abc-123",
  "name": "Work planning",
  "sources": ["memory", "gmail", "calendar"]
}
```

## Get session history

Returns full message history including tool call and tool result messages, allowing clients to reconstruct the conversation with tool visualizations.

```bash theme={null}
curl http://localhost:6877/session/history?session_id=abc-123 \
  -H "Authorization: Bearer $API_KEY"
```

## Create session

```bash theme={null}
curl -X POST http://localhost:6877/sessions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Project review"}'
```

## List sessions

```bash theme={null}
curl http://localhost:6877/sessions \
  -H "Authorization: Bearer $API_KEY"
```

Returns up to 20 most recent sessions.

## Rename session

```bash theme={null}
curl -X PATCH http://localhost:6877/sessions/abc-123 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "New name"}'
```

## Archive session

```bash theme={null}
curl -X DELETE http://localhost:6877/sessions/abc-123 \
  -H "Authorization: Bearer $API_KEY"
```

Archived sessions can be restored.

## Restore archived session

```bash theme={null}
curl -X POST http://localhost:6877/sessions/abc-123/restore \
  -H "Authorization: Bearer $API_KEY"
```

## Permanently delete

```bash theme={null}
curl -X DELETE http://localhost:6877/sessions/abc-123/permanent \
  -H "Authorization: Bearer $API_KEY"
```

## Clear session history

```bash theme={null}
curl -X POST http://localhost:6877/session/clear \
  -H "Authorization: Bearer $API_KEY"
```

## List archived sessions

```bash theme={null}
curl http://localhost:6877/sessions/archived \
  -H "Authorization: Bearer $API_KEY"
```
