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

# Update User

> Updates user information with partial update support.



## OpenAPI

````yaml api-reference/openapiFiles/users/Update/openapi.json put /users/{userId}
openapi: 3.0.1
info:
  title: YJSG Institution APIs
  description: >-
    APIs for educational institutions to manage student accounts and track
    engagement.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.yourjobsearchgenius.ai/v1
    description: Production server
security:
  - bearerAuth: []
paths:
  /users/{userId}:
    put:
      description: Updates user information with partial update support.
      parameters:
        - name: userId
          in: path
          description: The user's unique identifier
          required: true
          schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
            example: 507f1f77bcf86cd799439011
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserRequest'
      responses:
        '200':
          description: User updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateUserResponse'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid Token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Internal Server Error!
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    UpdateUserRequest:
      type: object
      properties:
        firstName:
          description: The first name of the user.
          type: string
        lastName:
          description: The last name of the user.
          type: string
        email:
          description: Email address of the user.
          type: string
          format: email
        uniqueUserId:
          description: Unique user ID assigned by the institution
          type: string
        accountStatus:
          description: Current status of the user account
          type: string
          enum:
            - active
            - inactive
    UpdateUserResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            _id:
              description: ID of the user (MongoDB ObjectId)
              type: string
            firstName:
              description: The first name of the user.
              type: string
            lastName:
              description: The last name of the user.
              type: string
            email:
              description: Email address of the user.
              type: string
            uniqueUserId:
              description: Unique user ID assigned by the institution
              type: string
            accountStatus:
              description: Current status of the user account
              type: string
              enum:
                - active
                - inactive
            autoLoginUrl:
              description: Auto login URL for the user
              type: string
              format: uri
        success:
          description: Indicates if the request was successful
          type: boolean
      required:
        - data
        - success
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
          format: s
    ValidationError:
      type: object
      properties:
        errors:
          type: object
          properties:
            email:
              type: array
              items:
                type: string
            uniqueUserId:
              type: array
              items:
                type: string
        success:
          description: Indicates if the request was successful
          type: boolean
      required:
        - errors
        - success
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````