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

# List chat messages in a Session

> List all chat messages in an AI Session



## OpenAPI

````yaml GET /api/ai/session/{ai_session_id}/qa/list
openapi: 3.0.3
info:
  title: Petal API Document
  description: Reference document for Petal app
  license:
    name: MIT
  version: 1.2.5
servers:
  - url: https://cite.petal.org
security:
  - bearerAuth: []
tags:
  - name: signup
  - name: extraction
  - name: referral
  - name: site
  - name: citegen
  - name: invite
  - name: user
  - name: tag
  - name: ai
  - name: notification
  - name: organization
  - name: annotation
  - name: search
  - name: attachment
  - name: collection
  - name: discourse
  - name: main
  - name: ai-create
  - name: document
  - name: payment
  - name: comment
  - name: lambda
  - name: sauce
  - name: admin
  - name: error
  - name: opengraph
  - name: default
  - name: media
  - name: file
  - name: oauth
paths:
  /api/ai/session/{ai_session_id}/qa/list:
    get:
      tags:
        - ai
      summary: List dicts of AI chat queries and replies for a given session
      description: List all chat messages in an AI Session
      operationId: get_/api/ai/session/{ai_session_id}/qa/list
      parameters:
        - description: The unique ID of the AI Session
          in: path
          name: ai_session_id
          required: true
          schema:
            format: int32
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIQAList'
          description: OK
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
          description: Unprocessable Entity
components:
  schemas:
    AIQAList:
      additionalProperties: false
      items:
        $ref: '#/components/schemas/AIQA'
      title: AIQAList
      type: array
    ValidationError:
      description: Model of a validation error response.
      items:
        $ref: '#/components/schemas/ValidationError.ValidationErrorElement'
      title: ValidationError
      type: array
    AIQA:
      additionalProperties: false
      properties:
        ai_session_id:
          title: AI Session ID
          description: The unique ID of the AI Session this message belongs to
          type: integer
        created_at:
          title: Created At
          description: Time of message creation, in UTC
          type: string
        id:
          title: ID
          description: Unique ID of this message
          type: integer
        meta:
          title: Meta
          description: Metadata, for internal use
          type: object
        query:
          title: Query
          description: The user-provided message to the AI
          type: string
        response:
          title: Response
          description: The AI's response to the user
          type: string
        task_id:
          title: Task ID
          description: Task ID for internal use
          type: string
        task_status:
          title: Task Status
          description: Progress on obtaining a response from the AI
          type: string
        user_id:
          title: User ID
          description: ID of user who submitted the message
          type: integer
        user_rating:
          title: User Rating
          description: User's assessment of the AI response
          type: string
      required:
        - id
        - ai_session_id
        - user_id
        - task_id
        - user_rating
        - created_at
        - query
        - meta
        - task_status
      title: AIQA
      type: object
    ValidationError.ValidationErrorElement:
      description: Model of a validation error response element.
      properties:
        ctx:
          title: Error context
          type: object
        loc:
          items:
            type: string
          title: Missing field name
          type: array
        msg:
          title: Error message
          type: string
        type:
          title: Error type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationErrorElement
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````