> ## 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 Password

> Use this endpoint to change a user's password by providing the current (old) password along with the new one. Ideal for self-service password updates.



## OpenAPI

````yaml /en/openapi/v3-current/AM-identity.yaml patch /v1/users/{id}/update-password
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}/update-password:
    patch:
      tags:
        - Users API
      summary: Update a User Password
      description: >-
        Use this endpoint to change a user's password by providing the current
        (old) password along with the new one. Ideal for self-service password
        updates.
      parameters:
        - $ref: '#/components/parameters/UserId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserPasswordInput'
            example:
              newPassword: newpassword
              oldPassword: oldpassword
      responses:
        '204':
          description: If the request is successful, you will receive an empty response.
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0003:
                  $ref: '#/components/examples/Error0003'
                Error0004:
                  $ref: '#/components/examples/Error0004'
                Error0007:
                  $ref: '#/components/examples/Error0007'
                Error0013:
                  $ref: '#/components/examples/Error0013'
                Error0020:
                  $ref: '#/components/examples/Error0020'
                Error0021:
                  $ref: '#/components/examples/Error0021'
                Error0022:
                  $ref: '#/components/examples/Error0022'
                Error0023:
                  $ref: '#/components/examples/Error0023'
                Error0024:
                  $ref: '#/components/examples/Error0024'
                Error0025:
                  $ref: '#/components/examples/Error0025'
                Error0026:
                  $ref: '#/components/examples/Error0026'
                Error0027:
                  $ref: '#/components/examples/Error0027'
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
              examples:
                Error0008:
                  $ref: '#/components/examples/Error0008'
                Error0009:
                  $ref: '#/components/examples/Error0009'
          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:
    UserPasswordInput:
      description: Information used to update a user's password.
      type: object
      required:
        - newPassword
        - oldPassword
      properties:
        newPassword:
          type: string
          description: New user password.
        oldPassword:
          type: string
          description: Current user password.
    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:
    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.
    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.
    Error0020:
      summary: Password Too Short
      value:
        code: IDE-0020
        title: Password Too Short
        message: The password must be at least 12 characters long.
    Error0021:
      summary: Password No Uppercase
      value:
        code: IDE-0021
        title: Password No Uppercase
        message: The password must contain at least one uppercase letter.
    Error0022:
      summary: Password No Lowercase
      value:
        code: IDE-0022
        title: Password No Lowercase
        message: The password must contain at least one lowercase letter.
    Error0023:
      summary: Password No Digit
      value:
        code: IDE-0023
        title: Password No Digit
        message: The password must contain at least one digit.
    Error0024:
      summary: Password No Special Char
      value:
        code: IDE-0024
        title: Password No Special Char
        message: The password must contain at least one special character.
    Error0025:
      summary: Password Consecutive Repeated
      value:
        code: IDE-0025
        title: Password Consecutive Repeated
        message: The password must not contain consecutive repeated characters.
    Error0026:
      summary: Password Unknown Rule
      value:
        code: IDE-0026
        title: Password Unknown Rule
        message: Unknown password validation rule.
    Error0027:
      summary: Old Password Invalid
      value:
        code: IDE-0027
        title: Old Password Invalid
        message: The old password provided is invalid.
    Error0008:
      summary: Token Missing
      value:
        code: IDE-0008
        title: Token Missing
        message: >-
          A valid token must be provided in the request header. Please include a
          token and try again.
    Error0009:
      summary: Invalid Token
      value:
        code: IDE-0009
        title: Invalid Token
        message: >-
          The provided token is expired, invalid or malformed. Please provide a
          valid token 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.

````