> ## 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: []
paths:
  /v1/users/{id}:
    patch:
      tags:
        - Users
      summary: Update a User
      description: Update a user
      parameters:
        - in: header
          name: X-Account-ID
          required: true
          schema:
            type: string
            format: uuid
          description: Account ID
        - 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/UpdateUserResponse'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '403':
          $ref: '#/components/responses/ForbiddenResponse'
        '404':
          $ref: '#/components/responses/NotFoundResponse'
        '409':
          $ref: '#/components/responses/ConflictResponse'
        '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:
    UpdateUserResponse:
      description: Default Response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateUserResponse_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'
    ConflictResponse:
      description: Conflict - resource already exists
      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)
    UpdateUserResponse_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
        navigation_profile_id:
          type: string
          nullable: true
          readOnly: true
        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)
        metadata:
          $ref: '#/components/schemas/UpdateUserResponse_application_json_metadata'
        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
    UpdateUserResponse_application_json_metadata:
      type: object
      readOnly: true
      description: >-
        System-recorded, read-only details. Only included with expand=metadata,
        which requires permission to create users.
      properties:
        sso:
          $ref: >-
            #/components/schemas/UpdateUserResponse_application_json_metadata_sso
    UpdateUserResponse_application_json_metadata_sso:
      type: object
      description: The user's latest SSO sign-in and what the identity provider sent
      properties:
        connection_id:
          type: string
        connection_type:
          type: string
          enum:
            - saml
            - oidc
        claims:
          type: object
          description: >-
            What the identity provider sent at the latest sign-in: SAML
            attributes or OIDC claims, by name. Values are text.
          additionalProperties:
            type: array
            items:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.