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

# Update the profile

> Partial update. The server writes only the fields that are present in the body. `onboardingComplete` becomes true when `grade` and `examType` are set, and, for YKS, `field` too. `communicationStyle` is accepted here, but no response returns it.



## OpenAPI

````yaml /api-reference/openapi.json patch /api/profile
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/profile:
    patch:
      tags:
        - profile
      summary: Update the profile
      description: >-
        Partial update. The server writes only the fields that are present in
        the body. `onboardingComplete` becomes true when `grade` and `examType`
        are set, and, for YKS, `field` too. `communicationStyle` is accepted
        here, but no response returns it.
      operationId: patchApiProfile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfilePatchBody'
      responses:
        '200':
          description: The profile after the update
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileResponse'
        '401':
          description: The token is missing, expired, or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ProfilePatchBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        examType:
          type: string
          enum:
            - YKS
            - LGS
        field:
          anyOf:
            - type: string
              enum:
                - EA
                - Sayısal
                - Sözel
            - type: 'null'
        grade:
          type: string
          maxLength: 32
        targetRanking:
          anyOf:
            - type: string
              maxLength: 120
            - type: 'null'
        targetRankingNum:
          anyOf:
            - type: integer
              minimum: 1
              maximum: 1000000
            - type: 'null'
        dailyHours:
          anyOf:
            - type: integer
              minimum: 1
              maximum: 16
            - type: 'null'
        strongSubjects:
          maxItems: 16
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
        weakSubjects:
          maxItems: 16
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 64
        communicationStyle:
          type: string
          enum:
            - informal
            - formal
    ProfileResponse:
      type: object
      properties:
        profile:
          $ref: '#/components/schemas/StudentProfile'
      required:
        - profile
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      description: Error body. `error` is a short English string.
    StudentProfile:
      type: object
      properties:
        name:
          type: string
        examType:
          anyOf:
            - type: string
              enum:
                - YKS
                - LGS
            - type: 'null'
        field:
          anyOf:
            - type: string
              enum:
                - EA
                - Sayısal
                - Sözel
            - type: 'null'
        grade:
          type: string
        targetRanking:
          anyOf:
            - type: string
            - type: 'null'
        targetRankingNum:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        dailyHours:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        strongSubjects:
          type: array
          items:
            type: string
        weakSubjects:
          type: array
          items:
            type: string
        onboardingComplete:
          type: boolean
        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))$
        imageUrl:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - name
        - examType
        - field
        - grade
        - targetRanking
        - targetRankingNum
        - dailyHours
        - strongSubjects
        - weakSubjects
        - onboardingComplete
        - createdAt
        - imageUrl
  securitySchemes:
    supabaseJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase access token: `Authorization: Bearer <token>`'

````