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

# Update the current user

> Updates preferences on the authenticated user's own account. Only the fields included in the request body are changed. This endpoint does not accept a user ID; it always updates the authenticated caller.



## OpenAPI

````yaml https://api.gumnut.ai/openapi.json patch /api/users/me
openapi: 3.1.0
info:
  title: Gumnut API
  description: >-
    The Gumnut API manages photo and video libraries: upload and organize
    assets, search by content, group detected faces into people, and curate
    albums and stacks.


    Headless clients authenticate by sending either a Gumnut API key
    (`apikey_...`) or an OAuth access token as a Bearer token in the
    `Authorization` header. The Gumnut web and mobile apps sign in with a
    first-party session (Clerk session JWT) instead, which is also the only
    credential that can manage API keys.
  contact:
    name: Gumnut
    url: https://www.gumnut.ai/contact
  version: 1.0.0
servers:
  - url: https://api.gumnut.ai
    description: Production
security:
  - apiKeyAuth: []
  - oauthJwtAuth: []
tags:
  - name: assets
    description: >-
      Photos and videos in a library: upload, list and filter, update metadata,
      trash and restore.
  - name: search
    description: >-
      Content-based search over a library's assets, with album, person, date,
      and location filters.
  - name: albums
    description: User-curated collections of assets.
  - name: album-assets
    description: Link records connecting albums to their member assets.
  - name: stacks
    description: >-
      Groups of related shots of the same moment, presented as a single unit
      with a cover asset.
  - name: people
    description: Named people, each built from clustered faces.
  - name: faces
    description: Detected faces and their assignment to people.
  - name: libraries
    description: Top-level containers that own assets, albums, people, and everything else.
  - name: events
    description: Change-event feed for keeping client state in sync.
  - name: tasks
    description: Status of background processing tasks.
  - name: users
    description: The authenticated user's profile.
  - name: api-keys
    description: >-
      Create and manage Gumnut API keys. Requires a first-party Gumnut app
      session — API keys and OAuth tokens cannot manage credentials.
  - name: oauth
    description: OAuth flow endpoints for obtaining and refreshing access tokens.
  - name: server
    description: Service health.
paths:
  /api/users/me:
    patch:
      tags:
        - users
      summary: Update the current user
      description: >-
        Updates preferences on the authenticated user's own account. Only the
        fields included in the request body are changed. This endpoint does not
        accept a user ID; it always updates the authenticated caller.
      operationId: update_current_user
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            The credentials are valid but not authorized for this operation —
            for example an API key whose action or library scope excludes it, or
            a credential type this operation does not accept.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
        '429':
          description: >-
            Rate limit exceeded. Retry after the interval in the `Retry-After`
            header.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    UserUpdate:
      properties:
        favorite_display_mode:
          anyOf:
            - $ref: '#/components/schemas/FavoriteDisplayMode'
            - type: 'null'
          description: >-
            Preferred favorite/rating display mode. Omit to leave unchanged;
            send `null` to reset to the default (favorite mode).
      type: object
      title: UserUpdate
      description: Updatable fields on the authenticated user's own account.
    UserResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique user identifier with 'intuser_' prefix
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: User's email address
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          description: User's first name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          description: User's last name
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
          description: >-
            User's home timezone as an IANA zone id (e.g.
            'America/Los_Angeles'); null until a home zone is captured
        favorite_display_mode:
          $ref: '#/components/schemas/FavoriteDisplayMode'
          description: >-
            The user's effective favorite/rating display mode, defaulting to
            `favorite` when they have never selected one.
        is_active:
          type: boolean
          title: Is Active
          description: Whether this user account is currently active
        is_superuser:
          type: boolean
          title: Is Superuser
          description: Whether this user has superuser/admin privileges
        is_verified:
          type: boolean
          title: Is Verified
          description: >-
            Whether the account is marked verified. An internal account flag,
            not proof of email verification — it can be true even when `email`
            is null
        storage_used_bytes:
          type: integer
          title: Storage Used Bytes
          description: Total bytes of assets the user is currently storing
        storage_limit_bytes:
          type: integer
          title: Storage Limit Bytes
          description: Maximum bytes of assets the user may store
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When this user account was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When this user account was last updated
      type: object
      required:
        - id
        - favorite_display_mode
        - is_active
        - is_superuser
        - is_verified
        - storage_used_bytes
        - storage_limit_bytes
        - created_at
        - updated_at
      title: UserResponse
      description: Represents a user account with profile information.
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        detail:
          title: Detail
          type: string
          description: Human-readable explanation of the error.
      required:
        - detail
    UnprocessableEntityResponse:
      title: UnprocessableEntityResponse
      type: object
      properties:
        detail:
          title: Detail
          description: >-
            A semantic validation message or structured request-validation
            errors.
          oneOf:
            - type: string
              description: Human-readable semantic validation message.
            - type: array
              items:
                $ref: '#/components/schemas/ValidationError'
              description: Structured request-validation errors.
      required:
        - detail
    FavoriteDisplayMode:
      type: string
      enum:
        - favorite
        - rating
      title: FavoriteDisplayMode
      description: |-
        Presentation a user prefers for the favorite/rating control.

        - `favorite`: a heart — filled at the top rating, empty otherwise.
        - `rating`: a 0-5 star control.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Gumnut API key (`apikey_...`) sent as a Bearer token in the
        `Authorization` header. Create and manage keys in the Gumnut app, or
        with the API key endpoints while signed in to it.
    oauthJwtAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Short-lived JWT obtained from the OAuth token exchange, sent as a Bearer
        token in the `Authorization` header.

````