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
| Parameter | Type | Required | Description |
|---|---|---|---|
email | String | Yes | Email used to request the OTP. |
code | String | Integer | Yes | Valid password-reset OTP. |
password | String | Yes | New password. |
password_confirmation | String | Yes | Must 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
| Field | Type | Description |
|---|---|---|
expires_at | DateTime | Token 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."
}