Resend Signup OTP
Resend the email verification OTP for a new user signup.
Quick Navigation
Endpoint
POST /api/v1/auth/resend-signup-otp
Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
Request Body
{
"email": "user@example.com",
"temporary_token": "temp_token_from_signup"
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address used for signup |
temporary_token | string | Yes | Temporary token received from signup response |
Validations
- Temporary token validation (must be valid and not expired)
- Email must match the token's associated email
- Email must not already be verified
- Rate limiting protection
Response
Success (200)
{
"success": true,
"data": {
"temporary_token": "new_temp_token",
"message": "OTP resent successfully"
},
"message": "OTP resent successfully"
}
Error Codes
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request |
| 401 | INVALID_TOKEN | Invalid or expired temporary token |
| 409 | EMAIL_ALREADY_VERIFIED | Email address already verified |
| 422 | VALIDATION_ERROR | Request validation failed |
Data Flow
-
Token Validation
- Validate temporary token from Redis
- Check token expiration (10 minutes)
- Extract user information from token
-
Email Verification Check
- Check if email is already verified
- Return error if already verified
-
OTP Generation
- Generate new 6-digit OTP code
- Store OTP in Redis with expiration (10 minutes)
- Reset attempt counter
-
Email Sending
- Send verification email with OTP code
- Queue email via email service
-
Token Refresh
- Create new temporary token
- Update token with new expiry
-
Audit Logging
- Log OTP resend event
- Record IP address and timestamp
Features
- Validates temporary token from signup
- Generates new OTP code
- Sends verification email
- Rate limiting protection
- Audit logging
- Token refresh for extended verification window
Example
curl -X POST https://api.rivergen.com/api/v1/auth/resend-signup-otp \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"temporary_token": "temp_token_abc123"
}'
Related Endpoints
- Signup - Initial signup
- Verify OTP - Verify email with OTP
- Verify Email - Verify email with token