Users

Change password (authenticated)

Changed on

Changes the password for the authenticated user. Requires the current password for verification. Protected by selfOnly middleware (users can only change their own password). Rate-limited.

patch/users/chng-pass/{id}

Request

  • Base URL
    /api (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /api/users/chng-pass/{id}
  • Auth
    HTTP bearer

Path parameters

idinteger required

User ID (must match authenticated user via selfOnly middleware)

Request body

idinteger required

User ID (must match path parameter)

currentPasswordstring password required

Current password for verification

newPasswordstring password required

Must be 8+ chars with uppercase, lowercase, and digit

Example request

{
  "id": 1,
  "currentPassword": "OldPassword123!",
  "newPassword": "NewPassword456!"
}

Response

Password changed successfully

messagestring

Example response

{
  "message": "Password updated successfully",
  "data": {
    "id": 1,
    "name": "John",
    "surname": "Doe",
    "email": "john@example.com",
    "role_id": 1,
    "organization_id": 1
  }
}

Changes

    • breaking

      the response property / became nullable for the status

    • breaking

      removed the required property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      api operation id ChangePassword was added

    • info

      api tag Users added

    • info

      api tag Users - Password removed