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

# List Sessions

> List user's chat sessions, newest first.



## OpenAPI

````yaml /openapi.json get /api/v1/chat/sessions
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/chat/sessions:
    get:
      tags:
        - Chat
      summary: List Sessions
      description: List user's chat sessions, newest first.
      operationId: list_sessions_api_v1_chat_sessions_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: team_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Team Id
        - name: workspace_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ChatSessionListResponse:
      properties:
        sessions:
          items:
            $ref: '#/components/schemas/ChatSessionResponse'
          type: array
          title: Sessions
        total:
          type: integer
          title: Total
        has_more:
          type: boolean
          title: Has More
      type: object
      required:
        - sessions
        - total
        - has_more
      title: ChatSessionListResponse
      description: Paginated list of chat sessions.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChatSessionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        team_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Team Id
        session_type:
          type: string
          title: Session Type
        title:
          type: string
          title: Title
        status:
          type: string
          title: Status
        message_count:
          type: integer
          title: Message Count
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        team_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Type
        team_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Display Name
      type: object
      required:
        - id
        - session_type
        - title
        - status
        - message_count
        - created_at
        - updated_at
      title: ChatSessionResponse
      description: Chat session metadata.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````