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

# List all sessions for the current user

> GET /api/managed-agents/sessions — returns up to 50 sessions ordered by most recently updated.

Use this endpoint to retrieve a summary of your recent Knoq sessions. The list is scoped to the authenticated user and the active organisation, ordered by the time each session was last updated. This is the same data that populates the sidebar in the Knoq chat interface.

```
GET /api/managed-agents/sessions
```

## Request

This endpoint has no required parameters. The result set is capped at 50 sessions.

## Response

<ResponseField name="sessions" type="array">
  An ordered array of session summary objects, sorted by `updatedAt` descending (most recently active first). Contains at most 50 entries.

  <Expandable title="Session object">
    <ResponseField name="id" type="string">
      The unique session ID. Use this value with the transcript, message, cancel, and delete endpoints.
    </ResponseField>

    <ResponseField name="title" type="string">
      The auto-generated title for this session, derived from the first message. Truncated to 60 characters when the opening message is longer.
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      ISO 8601 timestamp of the last update to this session, for example `"2025-06-10T14:32:00.000Z"`. Sessions are ordered by this field descending.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl https://knoq.one/api/managed-agents/sessions \
    -H "Origin: https://knoq.one" \
    -H "Cookie: <your-session-cookie>"
  ```

  ```json Response theme={null}
  {
    "sessions": [
      {
        "id": "a3f2c1d4-e5b6-7890-abcd-ef1234567890",
        "title": "Summarise the open GitHub issues assigned to me this week.",
        "updatedAt": "2025-06-10T14:32:00.000Z"
      },
      {
        "id": "b7e8f9a0-b1c2-3456-def0-123456789abc",
        "title": "What did the team ship in the last sprint?",
        "updatedAt": "2025-06-09T09:15:42.000Z"
      },
      {
        "id": "c4d5e6f7-a8b9-0123-cdef-012345678901",
        "title": "Draft a Notion doc summarising Q2 engineering goals.",
        "updatedAt": "2025-06-07T17:05:11.000Z"
      }
    ]
  }
  ```
</CodeGroup>

## Errors

| Status | Meaning                                                                                    |
| ------ | ------------------------------------------------------------------------------------------ |
| `401`  | The request is not authenticated. Ensure your session cookie is valid and has not expired. |
