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

# Get the conversation history

> The last 60 messages, oldest first. Not paginated, by design.



## OpenAPI

````yaml /api-reference/openapi.json get /api/chat/history
openapi: 3.1.0
info:
  title: Lala Client API
  description: >-
    The HTTP API behind Lala, the AI study companion for Turkish YKS and LGS
    students. This document is generated from the Zod schemas that validate each
    request at runtime. Do not hand-edit openapi.json. Student-visible text is
    Turkish. All identifiers are English.
  version: 1.0.0
servers:
  - url: https://client-api.lala.ist
    description: production
  - url: http://localhost:3000
    description: local dev
security:
  - supabaseJwt: []
tags:
  - name: chat
    description: The chat stream and the message history
  - name: profile
    description: The student profile and onboarding
  - name: system
    description: Health check
paths:
  /api/chat/history:
    get:
      tags:
        - chat
      summary: Get the conversation history
      description: The last 60 messages, oldest first. Not paginated, by design.
      operationId: getApiChatHistory
      responses:
        '200':
          description: The messages
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatHistoryResponse'
        '401':
          description: The token is missing, expired, or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ChatHistoryResponse:
      type: object
      properties:
        messages:
          type: array
          items:
            $ref: '#/components/schemas/ChatMessage'
      required:
        - messages
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      description: Error body. `error` is a short English string.
    ChatMessage:
      type: object
      properties:
        id:
          type: string
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          type: string
        mediaUrl:
          type: string
        timestamp:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - role
        - content
        - timestamp
  securitySchemes:
    supabaseJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase access token: `Authorization: Bearer <token>`'

````