Password Recovery Request
POST/company/auth/recovery
Endpoint for requesting password recovery for enterprise users.
Performs the following operations:
- Validates the email format
- Searches for the user in the database
- Generates a unique recovery token
- Sends an email with a password reset link
Detailed flow:
- Client sends email in JSON format
- Server validates email format (400 if invalid)
- Searches for user by email (404 if not found)
- Generates a random 32-character token
- Stores the token in the database associated with the user
- Sends an email with a link containing the token
- The link redirects to a new password form
Security:
- Tokens have limited validity (24h by default)
- Each token is single-use
- Requires HTTPS
Example request:
\{
email: usuario@empresa.com
\}
Example successful response:
\{
op: recovery,
message: RECOVERY_EMAIL_SENT,
email: usuario@empresa.com
\}
Error codes:
- 400: Email not provided or invalid format
- 404: User not found
- 500: Internal server error
Request
Responses
- 200
- 404
Password recovery email sent
Not found