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

# Update User Profile

> Update user profile fields (upsert pattern).



## OpenAPI

````yaml /openapi.json patch /api/v1/users/{user_id}
openapi: 3.1.0
info:
  title: VIZOCHOK API
  description: >

    ## VIZOCHOK — AI Shopping Assistant API


    Integrate an AI-powered grocery shopping assistant into your app or website.

    The assistant helps customers find products, build shopping lists, plan
    meals, and manage recipes using your store's real inventory.


    ### Integration


    | Method | Use Case | Auth |

    |--------|----------|------|

    | **WebSocket** `/api/v1/ws/chat` | Real-time streaming chat | API key via
    first message |


    ### Authentication


    All endpoints require an API key:

    ```

    Authorization: Bearer sk_...

    ```


    **Key types:**

    - `sk_*` — **Secret key** (backend-to-backend). Full access. Pass
    `X-User-Id` header for user identity.

    - `pk_*` — **Public key** (frontend widget). Chat-only access. Pass
    `X-User-Token` (JWT) for user identity.


    Get your keys from the admin panel or contact support.


    ### Quick Start

    1. Get an API key

    2. Upload your product catalog: `PUT /catalog/products` (returns job_id,
    embedding runs in background)

    3. Connect WebSocket and start chatting!

    4. Configure webhook URLs in the admin panel for real-time prices and cart
    sync
  version: 1.0.0
servers:
  - url: https://api.vizochok.com
    description: Production
security: []
tags:
  - name: Catalog
    description: 'Product catalog management: upload, search, update, and delete products.'
  - name: Catalog Jobs
    description: Track bulk catalog upload and re-embedding job progress.
  - name: Conversations
    description: View and manage customer chat conversations.
  - name: Users
    description: 'User profile management: language, dietary preferences, favorites.'
paths:
  /api/v1/users/{user_id}:
    patch:
      tags:
        - Users
      summary: Update User Profile
      description: Update user profile fields (upsert pattern).
      operationId: update_user_profile_api_v1_users__user_id__patch
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserProfileUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProfileResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UserProfileUpdate:
      properties:
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: Preferred language code (e.g. 'uk', 'en')
        dietary:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Dietary
          description: 'Dietary preferences and restrictions (e.g. {"vegan": true})'
        favorite_brands:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Favorite Brands
          description: List of preferred brand names for personalized recommendations
      type: object
      title: UserProfileUpdate
    UserProfileResponse:
      properties:
        user_id:
          type: string
          title: User Id
          description: Unique user identifier (provided by the client application)
        language:
          anyOf:
            - type: string
            - type: 'null'
          title: Language
          description: Preferred language code (e.g. 'uk', 'en')
        dietary:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Dietary
          description: 'Dietary preferences and restrictions (e.g. {"vegan": true})'
        favorite_brands:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Favorite Brands
          description: List of preferred brand names for personalized recommendations
      type: object
      required:
        - user_id
      title: UserProfileResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````