Skip to main content

Resend Signup OTP

Resend the email verification OTP for a new user signup.

Endpoint

POST /api/v1/auth/resend-signup-otp

Headers

HeaderRequiredDescription
Content-TypeYesapplication/json

Request Body

{
"email": "user@example.com",
"temporary_token": "temp_token_from_signup"
}

Parameters

FieldTypeRequiredDescription
emailstringYesEmail address used for signup
temporary_tokenstringYesTemporary 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

StatusCodeDescription
400VALIDATION_ERRORInvalid request
401INVALID_TOKENInvalid or expired temporary token
409EMAIL_ALREADY_VERIFIEDEmail address already verified
422VALIDATION_ERRORRequest validation failed

Data Flow

  1. Token Validation

    • Validate temporary token from Redis
    • Check token expiration (10 minutes)
    • Extract user information from token
  2. Email Verification Check

    • Check if email is already verified
    • Return error if already verified
  3. OTP Generation

    • Generate new 6-digit OTP code
    • Store OTP in Redis with expiration (10 minutes)
    • Reset attempt counter
  4. Email Sending

    • Send verification email with OTP code
    • Queue email via email service
  5. Token Refresh

    • Create new temporary token
    • Update token with new expiry
  6. 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"
}'