Password Recovery Request
POST/company/auth/recovery
Endpoint for requesting password recovery for company 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 (401 if invalid)
- Searches for user by email
- Generates a random token
- Stores 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:
- For security, always returns 200 OK to avoid revealing registered emails
- Tokens have limited validity
- Each token is single-use
- Requires HTTPS
- Also checks disabled users (soft delete)
Special behavior:
- If the email does not exist: returns 200 with
USER_NOT_FOUND - If the user is disabled: returns 200 with
USER_DISABLED - Demo users (cia@testing.com, ciamu@testing.com): return 200 without sending an email
Example request:
{
email: user@company.com
}
Example responses:
Valid email found:
{
op: recovery,
message: RECOVERY_EMAIL_SENT,
email: user@company.com
}
Email not found (returns 200 for security):
{
op: recovery,
message: USER_NOT_FOUND,
email: nonexistent@company.com
}
Disabled user:
{
op: recovery,
message: USER_DISABLED,
email: user@company.com
}
Error codes:
- 401: Email not provided
- 500: Internal server error
Request
Responses
- 200
- 401
Processed (always returns 200 for safety)
Response Headers
Email not provided or invalid format