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

# List Sessions

> List active sessions for the authenticated user, newest first.

When ``project_id`` is supplied, the result is restricted to sessions
assigned to that project - backs the chat sidebar's project selector
(Step 8). The filter is also user-scoped, so a project_id belonging
to another user simply yields an empty list rather than leaking.

When ``q`` is supplied and non-empty after strip, the result is
further restricted to sessions whose title contains ``q`` as a
case-insensitive substring. The match is ``lower(title) LIKE
lower('%q%')`` with LIKE wildcards in ``q`` escaped, so it is backed
by the ``ix_sessions_lower_title`` functional index and a user-typed
``%`` or ``_`` matches literally. The filter is always combined with
the user scope, so ``q`` never widens beyond the caller's sessions.

# IDOR AUDIT PASS — filters by Session.user_id == authenticated user_id



## OpenAPI

````yaml get /api/v1/sessions
openapi: 3.1.0
info:
  title: EDN Memory Engine
  version: 0.1.0
servers:
  - description: EDN evaluation endpoint
    url: https://api.tensorpro.ai
security:
  - EDNApiKey: []
paths:
  /api/v1/sessions:
    get:
      summary: List Sessions
      description: |-
        List active sessions for the authenticated user, newest first.

        When ``project_id`` is supplied, the result is restricted to sessions
        assigned to that project - backs the chat sidebar's project selector
        (Step 8). The filter is also user-scoped, so a project_id belonging
        to another user simply yields an empty list rather than leaking.

        When ``q`` is supplied and non-empty after strip, the result is
        further restricted to sessions whose title contains ``q`` as a
        case-insensitive substring. The match is ``lower(title) LIKE
        lower('%q%')`` with LIKE wildcards in ``q`` escaped, so it is backed
        by the ``ix_sessions_lower_title`` functional index and a user-typed
        ``%`` or ``_`` matches literally. The filter is always combined with
        the user scope, so ``q`` never widens beyond the caller's sessions.

        # IDOR AUDIT PASS — filters by Session.user_id == authenticated user_id
      operationId: list_sessions_api_v1_sessions_get
      parameters:
        - description: Max sessions to return (capped at 200)
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: Max sessions to return (capped at 200)
            minimum: 1
            title: Limit
            type: integer
        - description: Pagination offset
          in: query
          name: offset
          required: false
          schema:
            default: 0
            description: Pagination offset
            minimum: 0
            title: Offset
            type: integer
        - description: Optional project filter - only sessions in this project
          in: query
          name: project_id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Optional project filter - only sessions in this project
            title: Project Id
        - description: Case-insensitive substring filter on the session title
          in: query
          name: q
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Case-insensitive substring filter on the session title
            title: Q
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionsListResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    SessionsListResponse:
      properties:
        sessions:
          items:
            $ref: '#/components/schemas/SessionSummary'
          title: Sessions
          type: array
        total:
          title: Total
          type: integer
        user_id:
          title: User Id
          type: string
      required:
        - sessions
        - total
        - user_id
      title: SessionsListResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SessionSummary:
      properties:
        created_at:
          title: Created At
          type: string
        id:
          title: Id
          type: string
        is_archived:
          default: false
          title: Is Archived
          type: boolean
        last_message_preview:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Message Preview
        message_count:
          title: Message Count
          type: integer
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
        title:
          title: Title
          type: string
        updated_at:
          title: Updated At
          type: string
      required:
        - id
        - title
        - created_at
        - updated_at
        - message_count
        - last_message_preview
      title: SessionSummary
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    EDNApiKey:
      description: >-
        EDN API key presented as 'Bearer <key>' in the Authorization header.
        Create and manage keys from the Console.
      in: header
      name: Authorization
      type: apiKey

````