Email ServicesAPI Reference
Complete email management endpoints for verification, password reset, and notification services. EasyAuth server handles all email templating and sending automatically.
Base URL
https://easyauth-server.vercel.app/api/v1
Email Service
• Professional HTML email templates
• Automatic app name extraction from URL
• Built-in rate limiting protection
• Server handles all email configuration
Email Endpoints
Professional email templates with automatic app branding and secure token generation
/auth/verify-email
Verify Email Address
Verify a user's email address using a verification token. This endpoint is called when users click the verification link in their email.
Parameters
token
stringrequiredEmail verification token from the verification email
applicationUrl
stringOptional redirect URL after verification
Example Request
curl -X POST https://easyauth-server.vercel.app/api/v1/auth/verify-email \
-H "Content-Type: application/json" \
-d '{
"token": "abc123def456ghi789jkl012mno345pqr678stu901vwx234yz",
"applicationUrl": "https://myapp.com"
}'
Responses
{
"success": true,
"message": "Email verified successfully",
"data": {
"user": {
"id": "user_1234567890",
"email": "user@example.com",
"email_verified": true,
"verified_at": "2023-12-01T10:30:00Z"
}
}
}
{
"success": false,
"message": "Invalid or expired verification token",
"error": "INVALID_TOKEN"
}
/auth/resend-verification-email
Resend Verification Email
Resend the email verification email to a user who hasn't verified their email yet.
Parameters
email
stringrequiredUser's email address to resend verification to
applicationUrl
stringOptional application URL for the verification redirect
Example Request
curl -X POST https://easyauth-server.vercel.app/api/v1/auth/resend-verification-email \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"applicationUrl": "https://myapp.com"
}'
Responses
{
"success": true,
"message": "Verification email sent successfully"
}
{
"success": false,
"message": "Email already verified or user not found",
"error": "EMAIL_ALREADY_VERIFIED"
}
/auth/forgot-password
Send Password Reset Email
Send a password reset email to the user's registered email address. The email contains a secure link to reset their password.
Parameters
email
stringrequiredUser's registered email address
applicationUrl
stringOptional application URL for the reset redirect
Example Request
curl -X POST https://easyauth-server.vercel.app/api/v1/auth/forgot-password \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"applicationUrl": "https://myapp.com"
}'
Responses
{
"success": true,
"message": "Password reset email sent successfully"
}
{
"success": false,
"message": "No account found with this email address",
"error": "USER_NOT_FOUND"
}
/auth/reset-password
Reset Password
Reset user's password using the reset token received via email. This is typically called from the password reset form.
Parameters
token
stringrequiredPassword reset token from the reset email
newPassword
stringrequiredNew password for the user account (minimum 6 characters)
Example Request
curl -X POST https://easyauth-server.vercel.app/api/v1/auth/reset-password \
-H "Content-Type: application/json" \
-d '{
"token": "abc123def456ghi789jkl012mno345pqr678stu901vwx234yz",
"newPassword": "newSecurePassword123"
}'
Responses
{
"success": true,
"message": "Password reset successfully"
}
{
"success": false,
"message": "Invalid or expired reset token",
"error": "INVALID_TOKEN"
}
Email Workflow
Understanding the email verification and password reset flow
Email Verification
User Registration
User registers with email and verification email is automatically sent
Click Verify Link
User clicks verification link in email with embedded token
API Verification
Your app calls POST /email/verify
with token
Email Verified
User's email is marked as verified in the system
Password Reset
Request Reset
Call POST /email/reset
with user's email
Email Sent
Password reset email with link is sent to user's email
Click Reset Link
User clicks link and is taken to password reset page
Password Updated
User enters new password and it's updated in the system
Common Error Codes
Email Verification Errors
INVALID_TOKEN
Verification token is invalid or expired
EMAIL_ALREADY_VERIFIED
User's email is already verified
EMAIL_NOT_FOUND
Email address not found in system
Password Reset Errors
USER_NOT_FOUND
No account found with this email
RATE_LIMITED
Too many reset requests from this IP
EMAIL_SERVICE_ERROR
Failed to send email due to service error
Related APIs
Explore other EasyAuth API endpoints that work with email services