Skip to main content

Endpoint

POST /api/users/forgot-password

Request Body

email
string
required
The email address associated with the account that needs password recovery.

Response

Success response (200 OK)
message
string
Confirmation message: “Reset code sent to email”
resetCode
string
A 6-digit reset code valid for 30 minutes. In production, this would be sent via email rather than returned in the response.

Example Request

curl -X POST https://api.mediguide.com/api/users/forgot-password \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]"
  }'

Example Response

{
  "message": "Reset code sent to email",
  "resetCode": "123456"
}

Error Responses

404 Not Found - Email Not Registered

{
  "error": "No se encontró cuenta con este correo"
}

500 Internal Server Error

{
  "error": "Error message details"
}

Notes

  • The reset code expires after 30 minutes
  • The reset code is a 6-digit numeric string
  • In a production environment, the reset code should be sent via email and not returned in the API response

Build docs developers (and LLMs) love