Skip to main content
POST
Send a password recovery email to users who have forgotten their password. This endpoint initiates the password reset flow by sending a secure recovery link via email.
This endpoint always returns success (200) to prevent email enumeration attacks, even if the email doesn’t exist.

Request Body

string
required
Email address of the user requesting password recovery.
string
URL to redirect to after password recovery verification. If not provided, uses the default redirect URL.
string
Captcha token for verification if captcha is enabled.

Response

string
Success message (always returned regardless of email existence)

Error Responses

Password Recovery Flow

1

Request Recovery

User submits their email address to the recovery endpoint
2

Email Sent

If the email exists, a recovery email is sent with a secure token
3

User Clicks Link

User clicks the recovery link in their email
4

Verification

The recovery token is verified and user is redirected to reset form
5

Password Reset

User sets a new password using the verify endpoint

Recovery Email Template

The recovery email should include:

Implementation Examples

React Password Recovery Form

Password Reset Form (After Email Click)

Node.js Backend Handler

Security Features

  • Email Enumeration Protection: Always returns success regardless of email existence
  • Token Expiration: Recovery tokens expire after 1 hour
  • Single Use: Recovery tokens can only be used once
  • Rate Limiting: Prevents abuse and spam
  • Secure Tokens: Cryptographically secure random tokens

Rate Limiting

This endpoint is rate limited to prevent abuse:

Best Practices

  • Always return success to prevent email enumeration
  • Use secure, random tokens with sufficient entropy
  • Implement proper token expiration (1 hour recommended)
  • Log recovery attempts for security monitoring
  • Require strong passwords for reset
  • Provide clear instructions in recovery emails
  • Include troubleshooting tips for common issues
  • Offer alternative recovery methods if available
  • Show helpful error messages without revealing sensitive info
  • Use reputable email service providers
  • Implement proper email authentication (SPF, DKIM, DMARC)
  • Monitor delivery rates and bounce rates
  • Provide clear sender identification

Testing

Unit Tests

Verify Recovery

Complete password reset with new password

Resend Recovery

Resend password recovery email

User Login

Sign in with new password

Update Profile

Change password when authenticated