> ## 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 weekly story

> Five slides Lala writes about the last seven days (today and the six before it) for
one exam type: `week` HAFTAN, `time` ZAMANIN NEREYE GİTTİ, `deneme` DENEME, `subjects`
DERSLER, `next` SIRADAKİ ADIM. The numbers are computed on the server and the model only
writes the text. A slide whose text breaks the rules (over 240 characters, an
exclamation mark, an emoji, an em dash) gets a plain template text instead, so a bad
model answer never fails the read.

`suggestion`, on the last slide, is computed, not written: each item is a valid
`PlanBlockInput` once the client adds a date. `panels` carries only what the client
cannot compute itself.

The text is cached per exam type and ISO week, and written again only when the numbers
under it change. 204 when the seven days hold no done block and no paper of the exam
type: the ÖZETLE button then stays hidden.



## OpenAPI

````yaml /api-reference/openapi.json get /api/journey/weekly-story
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: notifications
    description: Replies typed into a push notification, authenticated by its reply token
  - name: system
    description: Health check
paths:
  /api/journey/weekly-story:
    get:
      tags:
        - journey
      summary: The weekly story
      description: >-
        Five slides Lala writes about the last seven days (today and the six
        before it) for

        one exam type: `week` HAFTAN, `time` ZAMANIN NEREYE GİTTİ, `deneme`
        DENEME, `subjects`

        DERSLER, `next` SIRADAKİ ADIM. The numbers are computed on the server
        and the model only

        writes the text. A slide whose text breaks the rules (over 240
        characters, an

        exclamation mark, an emoji, an em dash) gets a plain template text
        instead, so a bad

        model answer never fails the read.


        `suggestion`, on the last slide, is computed, not written: each item is
        a valid

        `PlanBlockInput` once the client adds a date. `panels` carries only what
        the client

        cannot compute itself.


        The text is cached per exam type and ISO week, and written again only
        when the numbers

        under it change. 204 when the seven days hold no done block and no paper
        of the exam

        type: the ÖZETLE button then stays hidden.
      operationId: getApiJourneyWeeklyStory
      parameters:
        - in: query
          name: examType
          schema:
            $ref: '#/components/schemas/ExamType'
          required: true
      responses:
        '200':
          description: The story
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeeklyStory'
        '204':
          description: Nothing to tell this week
        '400':
          description: The input is not valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The token is missing, expired, or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ExamType:
      type: string
      enum:
        - TYT
        - AYT
        - LGS
      description: One scored paper. TYT and AYT nets are never summed.
    WeeklyStory:
      type: object
      properties:
        range:
          $ref: '#/components/schemas/WeeklyStoryRange'
        slides:
          type: array
          items:
            $ref: '#/components/schemas/WeeklyStorySlide'
          description: Always five, in key order.
        panels:
          $ref: '#/components/schemas/WeeklyStoryPanels'
      required:
        - range
        - slides
        - panels
    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.
    WeeklyStoryRange:
      type: object
      properties:
        from:
          type: string
          description: Local Istanbul date, `YYYY-MM-DD`.
        to:
          type: string
          description: 'Local Istanbul date, inclusive: today.'
      required:
        - from
        - to
    WeeklyStorySlide:
      type: object
      properties:
        key:
          $ref: '#/components/schemas/WeeklyStorySlideKey'
        title:
          type: string
          description: 'Turkish upper case: `HAFTAN`, `SIRADAKİ ADIM`.'
        text:
          type: string
          description: >-
            Lala's text. Lower case, at most 240 characters, no exclamation
            marks, emojis or em dashes.
        suggestion:
          description: On the `next` slide only. What PLANA EKLE adds.
          type: array
          items:
            $ref: '#/components/schemas/WeeklyStorySuggestion'
      required:
        - key
        - title
        - text
    WeeklyStoryPanels:
      type: object
      properties:
        kayip:
          description: >-
            Up to 3 topics that cost the most net across this week's papers.
            Absent when no paper this week has topic rows with a wrong or blank
            answer.
          type: array
          items:
            $ref: '#/components/schemas/WeeklyStoryLostTopic'
        surenet:
          description: >-
            Up to 4 subjects of this week's newest paper, by study minutes.
            Absent when that paper is not from this week or has no earlier paper
            to compare with.
          type: array
          items:
            $ref: '#/components/schemas/WeeklyStorySubjectNet'
        buhafta:
          $ref: '#/components/schemas/WeeklyStoryPlan'
      description: >-
        Only the panel values the client cannot compute from the study and
        deneme reads.
    ValidationIssue:
      type: object
      properties:
        path:
          type: string
          description: Dotted path to the offending field, empty at the root.
        message:
          type: string
      required:
        - path
        - message
    WeeklyStorySlideKey:
      type: string
      enum:
        - week
        - time
        - deneme
        - subjects
        - next
      description: The five slides, in order.
    WeeklyStorySuggestion:
      type: object
      properties:
        subject:
          type: string
          description: 'The planner''s display subject: `Matematik`.'
        activity:
          $ref: '#/components/schemas/PlanActivity'
        durationMin:
          type: integer
          minimum: 5
          maximum: 720
          description: Length of one block.
        count:
          type: integer
          minimum: 1
          maximum: 9007199254740991
          description: How many blocks of this.
        topic:
          description: The topic, when the item is about one.
          type: string
      required:
        - subject
        - activity
        - durationMin
        - count
      description: >-
        One planned block, `count` times. Every field maps onto
        `PlanBlockInput`: add a `date` per block and send them to `POST
        /api/plan`.
    WeeklyStoryLostTopic:
      type: object
      properties:
        topic:
          type: string
        subject:
          type: string
          description: The planner's display subject.
        yanlis:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        bos:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - topic
        - subject
        - yanlis
        - bos
    WeeklyStorySubjectNet:
      type: object
      properties:
        subject:
          type: string
          description: The planner's display subject.
        minutes:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Completed minutes in the seven days.
        delta:
          type: number
          description: Net change against the previous paper of the same exam type.
      required:
        - subject
        - minutes
        - delta
    WeeklyStoryPlan:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/WeeklyStoryPlanItem'
        totalMin:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Sum of count times durationMin.
      required:
        - items
        - totalMin
      description: The suggestion, as the BU HAFTA panel shows it.
    PlanActivity:
      type: string
      enum:
        - questions
        - lesson
        - review
        - subject_mock
        - mock_exam
        - homework
        - reading
        - break
        - other
      description: >-
        What the block is. Turkish labels, in order: soru çözümü, konu anlatımı,
        tekrar, branş denemesi, deneme, ödev, okuma, mola, çalışma. On write,
        the Turkish name is accepted too (`soru çözümü`, `branş denemesi`, …).
    WeeklyStoryPlanItem:
      type: object
      properties:
        label:
          type: string
          description: The topic, or the subject and the activity.
        count:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        durationMin:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - label
        - count
        - durationMin
  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.