Skip to main content

Reset Password Endpoint

Verifies the password-reset OTP, updates the password, consumes the OTP, and returns a new Sanctum token.

  • Endpoint: /api/v1/auth/reset-password
  • Method: POST
  • Authentication: Partner token.

Payload Parameters

ParameterTypeRequiredDescription
emailStringYesEmail used to request the OTP.
codeString | IntegerYesValid password-reset OTP.
passwordStringYesNew password.
password_confirmationStringYesMust match password.

Sample Payload

{
"email": "user@example.com",
"code": "482193",
"password": "new-secret123",
"password_confirmation": "new-secret123"
}

Sample Response

{
"result": 1,
"message": "success",
"data": {
"token": "4|sanctum-plain-text-token",
"expires_at": "2026-09-25T08:00:00.000000Z",
"user": {
"id": 42,
"email": "user@example.com",
"is_active": true,
"partner_id": 12
}
}
}

The user object is the model's public JSON representation. The new token is also returned in the Authorization response header.

Token Metadata

FieldTypeDescription
expires_atDateTimeToken expiration in ISO 8601 format, set to 30 days after the token is issued.

The token lifetime can be configured with SANCTUM_USER_TOKEN_EXPIRATION_DAYS.

Sample Failure Response

{
"result": 0,
"message": "Invalid code & can you resend code."
}