Skip to main content

Resend Verification

Sends a new verification email to the user. Use this when the original verification email was not received or the token expired.

Endpoint​

POST /api/v1/auth/resend-verification

Authentication​

No authentication required (public endpoint).

Request​

Content-Type​

application/json

Request Body​

FieldTypeRequiredDescription
emailstringYesEmail address to resend verification to

Example Request​

{
"email": "john@example.com"
}

Response​

Success Response (200 OK)​

{
"message": "Verification email sent successfully",
"success": true
}

Examples​

curl -X POST https://api.callcov.com/api/v1/auth/resend-verification \
-H "Content-Type: application/json" \
-d '{
"email": "john@example.com"
}'

Errors​

400 Bad Request​

Email already verified:

{
"detail": "Email already verified"
}

404 Not Found​

User not found:

{
"detail": "User not found"
}

500 Internal Server Error​

Failed to send email:

{
"detail": "Failed to send verification email"
}

Behavior​

When this endpoint is called:

  1. Invalidates all previous verification tokens for this user
  2. Generates a new verification token (expires in 15 minutes)
  3. Sends new verification email
  4. Returns success message

Rate Limiting​

To prevent abuse, this endpoint is rate-limited:

  • Maximum 3 requests per email per hour
  • Maximum 10 requests per IP per hour

Use Cases​

Verification Email Not Received​

function resendVerificationEmail(email) {
return fetch('https://api.callcov.com/api/v1/auth/resend-verification', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email })
});
}

// In your login form
async function handleLogin(email, password) {
try {
const response = await loginUser(email, password);
} catch (error) {
if (error.message.includes('verify your email')) {
// Show "Resend verification email" button
const resendButton = document.getElementById('resend-button');
resendButton.style.display = 'block';

resendButton.onclick = async () => {
await resendVerificationEmail(email);
alert('Verification email sent! Please check your inbox.');
};
}
}
}

Verification Token Expired​

// When user clicks expired verification link
const urlParams = new URLSearchParams(window.location.search);
const token = urlParams.get('token');

try {
const response = await fetch('/api/v1/auth/verify-email', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ code: token })
});

if (!response.ok) {
const error = await response.json();
if (error.detail.includes('expired')) {
// Show resend verification form
showResendVerificationForm();
}
}
} catch (error) {
console.error(error);
}

Security Considerations​

  • Previous tokens invalidated: All old verification tokens are marked as used
  • Rate limited: Prevents email bombing
  • Single-use tokens: Each new token can only be used once
  • Time-limited: New tokens expire in 15 minutes