> ## 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 an User

> Update an User information.



## OpenAPI

````yaml /es/openapi/v3-current/AM-identity.yaml patch /v1/users/{id}
openapi: 3.0.1
info:
  contact: {}
  description: This is a swagger documentation for the Identity API
  termsOfService: http://swagger.io/terms/
  title: Identity API
  version: 1.0.0
servers:
  - url: //localhost:4001/
security: []
paths:
  /v1/users/{id}:
    patch:
      tags:
        - Users
      summary: Update an User
      description: Update an User information.
      parameters:
        - description: User ID
          in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateInput'
        description: User Update Input
        required: true
      responses:
        '200':
          content: {}
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg.HTTPError'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg.HTTPError'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pkg.HTTPError'
          description: Internal Server Error
      security:
        - BearerAuth: []
components:
  schemas:
    UserUpdateInput:
      description: UserUpdateInput payload
      example:
        firstName: John
        lastName: Doe
        phone: 5511998888777
        countryCode: BR
        groups:
          - admin-group
          - midaz-viewer-group
          - midaz-contributor-group
        email: john@example.com
      properties:
        countryCode:
          description: >-
            User's ISO 3166-1 alpha-2 country code. Optional; omit to leave the
            stored

            value unchanged, but it must accompany a phone in the same payload —
            Casdoor

            validates the number against it and rejects an unresolvable pair
            with an

            opaque upstream error.
          example: BR
          type: string
        email:
          description: User's email address.
          example: john@example.com
          type: string
        firstName:
          description: User's first name.
          example: John
          type: string
        groups:
          description: >-
            Array of user role groups IDs. Role groups IDs can be retrieved
            through the List Groups endpoint.
          example:
            - admin-group
            - midaz-viewer-group
            - midaz-contributor-group
          items:
            type: string
          type: array
        lastName:
          description: User's last name.
          example: Doe
          type: string
        phone:
          description: >-
            User's phone number in E.164 format. Optional; omit to leave the
            stored phone

            unchanged. Must be accompanied by countryCode in the same payload.
          example: 5511998888777
          type: string
      required:
        - email
        - firstName
        - lastName
      type: object
    pkg.HTTPError:
      properties:
        code:
          type: string
        entityType:
          type: string
        err:
          type: object
        message:
          type: string
        title:
          type: string
      type: object
  securitySchemes:
    BearerAuth:
      description: 'Bearer authentication. Send Authorization: Bearer <token>.'
      in: header
      name: Authorization
      type: apiKey

````