---
# System prepended metadata

title: Reset Password With OTP (Backend Endpoint)

---

# Reset Password With OTP (Backend Endpoint)

* URL: `PUT ~/api/v2/authentication/password`
* Request params:
    * `withOtp: Boolean` (default value = `false`)
* Request model:
```lang=kotlin
data class ChangePasswordRequest (
    val username: String?,
    val otpSessionId: String?,
    val otp: String?,
    val newPassword: String
)
```
* Responses:
    * 201 OK (null body if no error)
    * 400 BAD REQUEST
        * ```lang=kotlin
          data class ChangePasswordError(
                val reason: FailureReason
            ) {

                enum class FailureReason {
                    PASSWORD_INVALID,
                    INVALID_OTP,
                    EXPIRED_OTP,
                    UNKNOWN
                }
            }
          ```