> ## 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 Session Messages

> Return the active turns of a session owned by the authenticated user.

Messages come back oldest-first (transcript order), paginated. The
ownership gate runs first: a session that does not exist or belongs to
another user returns 404 (not 403, not an empty 200), exactly as the
PATCH/DELETE routes do, so an empty page cannot be confused with a
cross-tenant miss. An owned session with no messages returns 200 with
an empty array and total 0.

# IDOR AUDIT PASS — the ownership lookup filters by Session.user_id, and
# list_messages re-filters by user_id AND session_id.



## OpenAPI

````yaml get /api/v1/sessions/{session_id}/messages
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/{session_id}/messages:
    get:
      summary: List Session Messages
      description: |-
        Return the active turns of a session owned by the authenticated user.

        Messages come back oldest-first (transcript order), paginated. The
        ownership gate runs first: a session that does not exist or belongs to
        another user returns 404 (not 403, not an empty 200), exactly as the
        PATCH/DELETE routes do, so an empty page cannot be confused with a
        cross-tenant miss. An owned session with no messages returns 200 with
        an empty array and total 0.

        # IDOR AUDIT PASS — the ownership lookup filters by Session.user_id, and
        # list_messages re-filters by user_id AND session_id.
      operationId: list_session_messages_api_v1_sessions__session_id__messages_get
      parameters:
        - in: path
          name: session_id
          required: true
          schema:
            title: Session Id
            type: string
        - description: Max messages to return (capped at 200)
          in: query
          name: limit
          required: false
          schema:
            default: 50
            description: Max messages 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
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagesListResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    MessagesListResponse:
      properties:
        messages:
          items:
            $ref: '#/components/schemas/MessageItem'
          title: Messages
          type: array
        session_id:
          title: Session Id
          type: string
        total:
          title: Total
          type: integer
        user_id:
          title: User Id
          type: string
      required:
        - messages
        - total
        - session_id
        - user_id
      title: MessagesListResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    MessageItem:
      properties:
        content:
          title: Content
          type: string
        created_at:
          title: Created At
          type: string
        id:
          title: Id
          type: string
        records_used:
          anyOf:
            - type: integer
            - type: 'null'
          title: Records Used
        role:
          title: Role
          type: string
        round_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Round Id
        sip_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Sip Text
      required:
        - id
        - role
        - content
        - created_at
      title: MessageItem
      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

````