Change current user's password with old password verification.

Authentication: JWT token required Access: Secure password change requiring current password verification Security: Validates old password before allowing change

Request Schema:

{
  "old_password": "currentPassword123",
  "new_password": "newSecurePassword456"
}

Request Fields:

  • old_password: Current password for verification (required)
  • new_password: New password to set (required)

Response Schema:

{
  "data": {
    "id": "user-123",
    "email": "user@example.com",
    "name": "John Doe",
    "role": "USER",
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T12:30:00Z",
    "password_last_changed": "2025-01-15T12:30:00Z"
  }
}

Security Features:

  • Verifies current password before allowing change
  • Enforces password strength requirements
  • Updates password change timestamp
  • Invalidates existing sessions (optional security measure)
  • Logs password change event for audit

Password Requirements:

  • Minimum length (typically 8+ characters)
  • Must include mix of letters, numbers, and special characters
  • Cannot be same as current password
  • Cannot be common or easily guessable passwords

Use Cases:

  • Regular password rotation for security
  • Password change after suspected compromise
  • Compliance with security policies
  • User-initiated security enhancement

Error Responses:

  • 400 Bad Request: Missing required fields
  • 401 Unauthorized: JWT token required or incorrect old password
  • 422 Unprocessable Entity: New password doesn't meet requirements
  • 500 Internal Server Error: Password change failed
patch/api/v1/user/me/change-password

Request body

object required

Response

Success

object required

Changes

No recorded changes to this endpoint across all 1 revision of this API.