> ## 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.

# The journey overview

> Everything the journey tab opens on, in one call: days together, the streak, the
rolling deneme averages with their trend per exam type, the newest denemeler, a
30-day study summary, and the strongest and weakest topics.

Averages are over the last three denemeler of an exam type. TYT and AYT are never
combined. The trend compares that window against the same window shifted one deneme
back, so a single good paper moves it and a single old one leaving does too.

The streak counts days with meaningful activity: a chat message, a completed study
block, a logged deneme, or a saved check-in. `current` reads 0 once a day has been
missed.



## OpenAPI

````yaml /api-reference/openapi.json get /api/journey
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, the message history, and reactions
  - name: media
    description: Upload and read message attachments
  - name: plan
    description: The study planner — blocks of work on a day
  - name: journey
    description: Deneme results, topic performance, study-hours stats, and the streak
  - name: profile
    description: The student profile and onboarding
  - name: devices
    description: Push notification devices
  - name: system
    description: Health check
paths:
  /api/journey:
    get:
      tags:
        - journey
      summary: The journey overview
      description: >-
        Everything the journey tab opens on, in one call: days together, the
        streak, the

        rolling deneme averages with their trend per exam type, the newest
        denemeler, a

        30-day study summary, and the strongest and weakest topics.


        Averages are over the last three denemeler of an exam type. TYT and AYT
        are never

        combined. The trend compares that window against the same window shifted
        one deneme

        back, so a single good paper moves it and a single old one leaving does
        too.


        The streak counts days with meaningful activity: a chat message, a
        completed study

        block, a logged deneme, or a saved check-in. `current` reads 0 once a
        day has been

        missed.
      operationId: getApiJourney
      responses:
        '200':
          description: The overview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JourneyOverview'
        '401':
          description: The token is missing, expired, or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    JourneyOverview:
      type: object
      properties:
        daysTogether:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Days since sign-up, first day inclusive.
        streak:
          type: object
          properties:
            current:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
              description: 0 once the streak has lapsed (no activity yesterday or today).
            longest:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - current
            - longest
        exams:
          type: array
          items:
            $ref: '#/components/schemas/ExamAverages'
          description: One entry per exam type the student has denemeler for.
        recentDenemeler:
          type: array
          items:
            $ref: '#/components/schemas/Deneme'
        study:
          $ref: '#/components/schemas/JourneyStudySummary'
        strongTopics:
          type: array
          items:
            $ref: '#/components/schemas/JourneyTopicHighlight'
        weakTopics:
          type: array
          items:
            $ref: '#/components/schemas/JourneyTopicHighlight'
      required:
        - daysTogether
        - streak
        - exams
        - recentDenemeler
        - study
        - strongTopics
        - weakTopics
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        issues:
          description: >-
            Present only on a 400 raised by request validation, capped at 10
            entries. Every other error carries `error` alone.
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
      required:
        - error
      description: Error body. `error` is a short English string.
    ExamAverages:
      type: object
      properties:
        examType:
          $ref: '#/components/schemas/ExamType'
        avgNet:
          type: number
          description: Average total net of the last 3 denemeler.
        trend:
          $ref: '#/components/schemas/DenemeTrend'
        count:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: All-time deneme count for the exam type.
        subjects:
          type: array
          items:
            $ref: '#/components/schemas/SubjectAverage'
      required:
        - examType
        - avgNet
        - trend
        - count
        - subjects
    Deneme:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        examType:
          $ref: '#/components/schemas/ExamType'
        field:
          anyOf:
            - type: string
              enum:
                - EA
                - Sayısal
                - Sözel
            - type: 'null'
          description: AYT only. Null on TYT and LGS papers.
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: '`Bilgi Sarmal Türkiye Geneli`, …'
        publisher:
          anyOf:
            - type: string
            - type: 'null'
        takenDate:
          type: string
          description: Local Istanbul calendar date, `YYYY-MM-DD`.
        durationMin:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        totalNet:
          type: number
          description: Sum of the subject nets. Recomputed on every write.
        source:
          type: string
          enum:
            - manual
            - chat
          description: '`chat` when Lala logged it from the conversation.'
        createdBy:
          type: string
          enum:
            - student
            - lala
        notes:
          anyOf:
            - type: string
            - type: 'null'
        subjects:
          type: array
          items:
            $ref: '#/components/schemas/DenemeSubjectResult'
          description: Booklet order.
        topics:
          type: array
          items:
            $ref: '#/components/schemas/DenemeTopicResult'
        createdAt:
          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))$
        updatedAt:
          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:
        - id
        - examType
        - field
        - name
        - publisher
        - takenDate
        - durationMin
        - totalNet
        - source
        - createdBy
        - notes
        - subjects
        - topics
        - createdAt
        - updatedAt
    JourneyStudySummary:
      type: object
      properties:
        days:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: The window the summary covers, in days.
        totalMin:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        activeDays:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        dailyAvgMin:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: totalMin / activeDays.
      required:
        - days
        - totalMin
        - activeDays
        - dailyAvgMin
    JourneyTopicHighlight:
      type: object
      properties:
        subject:
          type: string
          description: >-
            Canonical subject key — exam-prefixed, e.g. `tyt_matematik`,
            `ayt_tarih1`, `lgs_fen`.
        label:
          type: string
        short:
          type: string
        examType:
          $ref: '#/components/schemas/ExamType'
        topic:
          type: string
        accuracy:
          type: number
        total:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - subject
        - label
        - short
        - examType
        - topic
        - accuracy
        - total
    ValidationIssue:
      type: object
      properties:
        path:
          type: string
          description: Dotted path to the offending field, empty at the root.
        message:
          type: string
      required:
        - path
        - message
    ExamType:
      type: string
      enum:
        - TYT
        - AYT
        - LGS
      description: One scored paper. TYT and AYT nets are never summed.
    DenemeTrend:
      type: string
      enum:
        - up
        - down
        - flat
      description: >-
        Direction of the rolling average: the newest window of 3 against the
        same window shifted one deneme back.
    SubjectAverage:
      type: object
      properties:
        subject:
          type: string
          description: >-
            Canonical subject key — exam-prefixed, e.g. `tyt_matematik`,
            `ayt_tarih1`, `lgs_fen`.
        label:
          type: string
        short:
          type: string
        avgNet:
          type: number
          description: Average of the last 3 denemeler containing the subject.
        trend:
          $ref: '#/components/schemas/DenemeTrend'
        count:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - subject
        - label
        - short
        - avgNet
        - trend
        - count
    DenemeSubjectResult:
      type: object
      properties:
        subject:
          type: string
          description: >-
            Canonical subject key — exam-prefixed, e.g. `tyt_matematik`,
            `ayt_tarih1`, `lgs_fen`.
        label:
          type: string
          description: Turkish display name. Read-only.
        short:
          type: string
          description: 'Short code for dense views: `TÜR`, `MAT`. Read-only.'
        dogru:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        yanlis:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        bos:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        net:
          type: number
          description: >-
            TYT/AYT: doğru − yanlış/4. LGS: doğru − yanlış/3. Computed when the
            counts are known.
      required:
        - subject
        - label
        - short
        - dogru
        - yanlis
        - bos
        - net
    DenemeTopicResult:
      type: object
      properties:
        subject:
          type: string
          description: >-
            Canonical subject key — exam-prefixed, e.g. `tyt_matematik`,
            `ayt_tarih1`, `lgs_fen`.
        topic:
          type: string
          description: 'Free text: `Paragraf`, `Türev`, …'
        dogru:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        yanlis:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        bos:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - subject
        - topic
        - dogru
        - yanlis
        - bos
  securitySchemes:
    supabaseJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase access token: `Authorization: Bearer <token>`'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.