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

# Update a User

> Use this endpoint to update a user's information, such as name, email, or group assignments.



## OpenAPI

````yaml /en/openapi/v3-current/AM-identity.yaml patch /v1/users/{id}
openapi: 3.1.0
info:
  title: Identity Plugin
  description: ''
  version: 2.4.4
servers:
  - url: https://identity.sandbox.lerian.net
security: []
tags:
  - name: Groups API
  - name: Applications API
  - name: Users API
  - name: MFA API
  - name: Providers API
  - name: Application Providers API
paths:
  /v1/users/{id}:
    patch:
      tags:
        - Users API
      summary: Update a User
      description: >-
        Use this endpoint to update a user's information, such as name, email,
        or group assignments.
      parameters:
        - $ref: '#/components/parameters/UserId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateInput'
            example:
              email: john@example.com
              firstName: John
              groups:
                - admin-group
                - midaz-viewer-group
              lastName: Doe
      responses:
        '200':
          description: >-
            Indicates that the resource was successfully updated and the
            operation was completed as expected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserUpdateInput'
              example:
                email: john@example.com
                firstName: John
                groups:
                  - admin-group
                  - midaz-viewer-group
                lastName: Doe
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0001:
                  $ref: '#/components/examples/Error0001'
                Error0002:
                  $ref: '#/components/examples/Error0002'
                Error0003:
                  $ref: '#/components/examples/Error0003'
                Error0004:
                  $ref: '#/components/examples/Error0004'
                Error0007:
                  $ref: '#/components/examples/Error0007'
                Error0010:
                  $ref: '#/components/examples/Error0010'
                Error0011:
                  $ref: '#/components/examples/Error0011'
                Error0013:
                  $ref: '#/components/examples/Error0013'
                Error0017:
                  $ref: '#/components/examples/Error0017'
          headers: {}
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error1003:
                  $ref: '#/components/examples/Error1003'
          headers: {}
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0006:
                  $ref: '#/components/examples/Error0006'
          headers: {}
      security:
        - bearer: []
components:
  parameters:
    UserId:
      name: id
      in: path
      description: The unique identifier of the user you want to retrieve.
      required: true
      example: 019c96a0-0c21-71f9-a487-66a1258278a1
      schema:
        type: string
  schemas:
    UserUpdateInput:
      description: Information used to update a user's information.
      type: object
      required:
        - email
        - firstName
        - lastName
      properties:
        email:
          type: string
          description: User's email address.
        firstName:
          type: string
          description: User's first name.
        groups:
          description: >-
            Array of user role groups IDs. Role groups IDs can be retrieved
            through the List Groups endpoint.
          type: array
          items:
            type: string
        lastName:
          type: string
          description: User's last name.
    ErrorMessage:
      description: The response message error.
      type: object
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
  examples:
    Error0001:
      summary: Missing Fields in Request
      value:
        code: IDE-0001
        title: Missing Fields in Request
        message: Your request is missing one or more required fields.
    Error0002:
      summary: Invalid Field Type in Request
      value:
        code: IDE-0002
        title: Invalid Field Type in Request
        message: The provided field type in the request is invalid.
    Error0003:
      summary: Invalid Path Parameter
      value:
        code: IDE-0003
        title: Invalid Path Parameter
        message: One or more path parameters are in an incorrect format.
    Error0004:
      summary: Unexpected Fields in the Request
      value:
        code: IDE-0004
        title: Unexpected Fields in the Request
        message: >-
          The request body contains more fields than expected. Please send only
          the allowed fields.
    Error0007:
      summary: Bad Request
      value:
        code: IDE-0007
        title: Bad Request
        message: The server could not understand the request due to malformed syntax.
    Error0010:
      summary: Unmodifiable Field Error
      value:
        code: IDE-0010
        title: Unmodifiable Field Error
        message: Your request includes a field that cannot be modified.
    Error0011:
      summary: Immutable Field Error
      value:
        code: IDE-0011
        title: Immutable Field Error
        message: The field cannot be modified. Please remove it from your request.
    Error0013:
      summary: User ID Not Match
      value:
        code: IDE-0013
        title: User ID Not Match
        message: >-
          The provided ID does not match the token owner. Users are only allowed
          to update their own password. Please ensure you are using the correct
          ID and try again.
    Error0017:
      summary: User Already Exists
      value:
        code: IDE-0017
        title: User Already Exists
        message: >-
          The user already exists. Please use a different username or email and
          try again.
    Error1003:
      summary: User ID Not Found
      value:
        code: IDE-1003
        title: User ID Not Found
        message: The provided user ID does not exist in our records.
    Error0006:
      summary: Internal Server Error
      value:
        code: IDE-0006
        title: Internal Server Error
        message: The server encountered an unexpected error. Please try again later.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: The authorization token in the 'Bearer <token>' format.

````