Account Activation API
This API allows users to verify their OTP (One-Time Password) for account activation and regenerate a new OTP if needed.
1. Verify OTP
Endpoint: api/v1/accounts/account_activation/verify_otp/
Method: POST
Permissions: AllowAny
This endpoint verifies the OTP sent to the user's email during account registration. If the OTP is correct, the user's account is activated.
Request Payload
{
"email": "user@example.com",
"otp": "123456"
}
Response Payload (Success)
{
"msg": "OTP verified. User activated successfully!"
}
Response Payload (Error)
{
"error": "Invalid or expired OTP"
}
2. Regenerate OTP
Endpoint: api/v1/accounts/account_activation/regenerate_otp/
Method: POST
Permissions: AllowAny
This endpoint allows users to regenerate a new OTP if the previous OTP has expired or the user has not yet activated their account.
Request Payload
{
"email": "user@example.com"
}
Response Payload (Success)
{
"msg": "New OTP generated and sent via email!"
}
Response Payload (Error)
{
"msg": "User is already active"
}