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

# Sessions

> Every published sessions operation, generated from the contract.

11 operations on `client.sessions`, including `sessions.messages`, `sessions.traces`.

Path parameters come first, positionally; the request body is last, as a plain
object. Method names are `snake_case` in Python and `camelCase` in
TypeScript, and resource names follow the same rule.

<CodeGroup>
  ```python Python theme={null}
  result = client.sessions.aggregate(body)
  ```

  ```typescript TypeScript theme={null}
  const result = await client.sessions.aggregate(body);
  ```
</CodeGroup>

## Operations

| Call                                                   | Route                                                       | Does                            |
| ------------------------------------------------------ | ----------------------------------------------------------- | ------------------------------- |
| `client.sessions.aggregate(body)`                      | `POST /agent/v1/sessions/aggregate`                         | Aggregate sessions              |
| `client.sessions.create_record(body)`                  | `POST /agent/v1/sessions`                                   | Upload a session record         |
| `client.sessions.get(session_id)`                      | `GET /agent/v1/sessions/{session_id}`                       | Get a session                   |
| `client.sessions.list()`                               | `GET /agent/v1/sessions`                                    | List sessions                   |
| `client.sessions.poll_events(session_id)`              | `GET /agent/v1/sessions/{session_id}/events`                | Poll the session message log    |
| `client.sessions.search(body)`                         | `POST /agent/v1/sessions/search`                            | Search sessions                 |
| `client.sessions.stream_events(session_id)`            | `GET /agent/v1/sessions/{session_id}/events/stream`         | Stream session turns over SSE   |
| `client.sessions.messages.create(session_id, body)`    | `POST /agent/v1/sessions/{session_id}/messages`             | Record a session turn           |
| `client.sessions.messages.get(session_id, message_id)` | `GET /agent/v1/sessions/{session_id}/messages/{message_id}` | Get one recorded turn           |
| `client.sessions.messages.list(session_id)`            | `GET /agent/v1/sessions/{session_id}/messages`              | List a session's recorded turns |
| `client.sessions.traces.list(session_id)`              | `GET /agent/v1/sessions/{session_id}/traces`                | List traces for a session       |

## Related

<CardGroup cols={2}>
  <Card title="How the client is organised" icon="list" href="/sdk/operations">
    Resources, call shapes, and errors.
  </Card>

  <Card title="Errors and retries" icon="triangle-exclamation" href="/developers/errors-and-retries">
    What the SDK raises, and which calls are safe to retry.
  </Card>
</CardGroup>
