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

# Reply from a notification

> Sends a chat message that the student typed into a push notification, from the
Android inline reply or the iOS reply action. The native handler has no session, so
this route takes no `Authorization` header. The `replyToken` from the notification
data authenticates it. A reply token is valid for 14 days and only for this route.

The server answers `202` at once, then runs the normal chat turn. Lala's answer
arrives as a new `reply` push, and both messages are in the history.

Send a `clientId` and repeat it on a retry. A repeated `clientId` gets `202` again
and does not send the message a second time.



## OpenAPI

````yaml /api-reference/openapi.json post /api/notifications/reply
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/notifications/reply:
    post:
      tags:
        - notifications
      summary: Reply from a notification
      description: >-
        Sends a chat message that the student typed into a push notification,
        from the

        Android inline reply or the iOS reply action. The native handler has no
        session, so

        this route takes no `Authorization` header. The `replyToken` from the
        notification

        data authenticates it. A reply token is valid for 14 days and only for
        this route.


        The server answers `202` at once, then runs the normal chat turn. Lala's
        answer

        arrives as a new `reply` push, and both messages are in the history.


        Send a `clientId` and repeat it on a retry. A repeated `clientId` gets
        `202` again

        and does not send the message a second time.
      operationId: postApiNotificationsReply
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationReplyBody'
      responses:
        '202':
          description: The message is accepted and the turn has started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationReplyResponse'
        '400':
          description: The body is not valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The reply token is not valid or has expired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: The student of the token no longer exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    NotificationReplyBody:
      type: object
      properties:
        token:
          type: string
          minLength: 1
          maxLength: 4096
          description: >-
            The `replyToken` from the data of the notification the student
            replied to.
        text:
          type: string
          minLength: 1
          maxLength: 4000
          description: What the student typed into the notification.
        clientId:
          description: >-
            A UUID the device makes once per reply and repeats on a retry. A
            repeat inside 10 minutes is accepted again and does not send a
            second message.
          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)$
      required:
        - token
        - text
    NotificationReplyResponse:
      type: object
      properties:
        accepted:
          type: boolean
          const: true
      required:
        - accepted
    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.
    ValidationIssue:
      type: object
      properties:
        path:
          type: string
          description: Dotted path to the offending field, empty at the root.
        message:
          type: string
      required:
        - path
        - message
  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.