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

# Update a User

> Update a user



## OpenAPI

````yaml /api/openapi.yaml patch /v1/users/{id}
openapi: 3.0.3
info:
  title: Documentation Service API
  description: API documentation for Documentation Service
  version: 1.0.0
servers:
  - url: https://api.us.lexful.app
    description: US pod
security:
  - bearerAuth: []
    accountId: []
paths:
  /v1/users/{id}:
    patch:
      tags:
        - Users
      summary: Update a User
      description: Update a user
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: id
          required: true
          description: User ID
      requestBody:
        $ref: '#/components/requestBodies/patch_v1_users__id__request'
      responses:
        '200':
          $ref: '#/components/responses/CreateUserResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
        '500':
          $ref: '#/components/responses/InternalServerErrorResponse'
components:
  requestBodies:
    patch_v1_users__id__request:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/patch_v1_users__id__request_application_json'
  responses:
    CreateUserResponse:
      description: Default Response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CreateUserResponse_application_json'
    BadRequestResponse:
      description: Bad request - validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenResponse:
      description: Forbidden - insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundResponse:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerErrorResponse:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    patch_v1_users__id__request_application_json:
      type: object
      properties:
        email:
          type: string
          format: email
          maxLength: 255
          description: User email address
        first_name:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          description: User first name
        last_name:
          type: string
          nullable: true
          minLength: 1
          maxLength: 100
          description: User last name
        role:
          type: string
          enum:
            - system_admin
            - system_support
            - admin
            - support
            - viewer
            - organization_viewer
          description: User role
        account_scopes:
          type: array
          items:
            oneOf:
              - type: string
                format: uuid
              - type: string
                enum:
                  - '*'
            description: UUID or wildcard "*"
          description: >-
            Array of account IDs the user has access to (or "*" for wildcard
            access)
        organization_scopes:
          type: array
          items:
            oneOf:
              - type: string
                format: uuid
              - type: string
                enum:
                  - '*'
            description: UUID or wildcard "*"
          description: >-
            Array of organization IDs the user has access to (or "*" for
            wildcard access)
    CreateUserResponse_application_json:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: User unique identifier
        account_id:
          type: string
          format: uuid
          description: Account ID this user belongs to
        email:
          type: string
          format: email
          description: User email address
        first_name:
          type: string
          nullable: true
          description: User first name
        last_name:
          type: string
          nullable: true
          description: User last name
        role:
          type: string
          enum:
            - system_admin
            - system_support
            - admin
            - support
            - viewer
            - organization_viewer
          description: User role
        external_ids:
          type: object
          additionalProperties:
            type: string
          description: External system ID mappings
        account_scopes:
          type: array
          items:
            oneOf:
              - type: string
                format: uuid
              - type: string
                enum:
                  - '*'
            description: UUID or wildcard "*"
          description: >-
            Array of account IDs the user has access to (or "*" for wildcard
            access)
        organization_scopes:
          type: array
          items:
            oneOf:
              - type: string
                format: uuid
              - type: string
                enum:
                  - '*'
            description: UUID or wildcard "*"
          description: >-
            Array of organization IDs the user has access to (or "*" for
            wildcard access)
        created_at:
          type: string
          format: date-time
          description: User creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp
        created_by:
          type: string
          description: User ID who created this user
        updated_by:
          type: string
          description: User ID who last updated this user
        deleted_at:
          type: string
          nullable: true
          format: date-time
          description: Deletion timestamp
      required:
        - id
        - account_id
        - email
        - role
        - account_scopes
        - organization_scopes
    ErrorResponse:
      description: Bad request - validation error
      type: object
      properties:
        status:
          type: number
          description: HTTP status code
        message:
          type: string
          description: Error message
        error_id:
          type: string
          description: Unique error identifier
        error_code:
          type: string
          description: Error code
        developer_message:
          type: string
          description: Additional details for developers
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token
    accountId:
      type: apiKey
      in: header
      name: X-Account-ID
      description: Account ID

````