Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanSebasSV/healtyhelp/llms.txt

Use this file to discover all available pages before exploring further.

Favorites API

Base path: /api/favoritos All favorites endpoints require authentication. The favorites list is stored as an array of Recipe ObjectIds on the user document. A single toggle endpoint handles both adding and removing a recipe from the list.
A user’s favorites list is capped at 100 recipes. Attempting to add a 101st item returns a 400 error.

GET /api/favoritos

Requires Authorization: Bearer <token>
Returns the full list of Recipe ObjectIds that the authenticated user has favorited. Response 200
{
  "favoritos": [
    "64b2a3c4d5e6f7a8b9c0d1e2",
    "64c3b4d5e6f7a8b9c0d1e2f3",
    "64d4c5d6e7f8a9b0c1d2e3f4"
  ]
}
FieldTypeDescription
favoritosstring[]Array of Recipe ObjectIds in the order they were added
curl example
curl -X GET https://api.healtyhelp.com/api/favoritos \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Error responses
StatusErrorCondition
401"No autorizado - Token no proporcionado"No Authorization header
401"Token inválido o expirado"Token expired or signature invalid
500"Error obteniendo favoritos"Unexpected server error

POST /api/favoritos/:recetaId

Requires Authorization: Bearer <token>
Toggles the given recipe in the authenticated user’s favorites list:
  • If the recipe is not in the list → it is added.
  • If the recipe is already in the list → it is removed.
The updated list is returned after each operation. Path parameter
ParamTypeDescription
recetaIdstringObjectId of the recipe to toggle
Response 200 — recipe added
{
  "favoritos": [
    "64b2a3c4d5e6f7a8b9c0d1e2",
    "64c3b4d5e6f7a8b9c0d1e2f3"
  ]
}
Response 200 — recipe removed
{
  "favoritos": [
    "64b2a3c4d5e6f7a8b9c0d1e2"
  ]
}
curl example — add a recipe
curl -X POST https://api.healtyhelp.com/api/favoritos/64c3b4d5e6f7a8b9c0d1e2f3 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
curl example — remove the same recipe (second call)
# Calling the same endpoint a second time removes the recipe
curl -X POST https://api.healtyhelp.com/api/favoritos/64c3b4d5e6f7a8b9c0d1e2f3 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Error responses
StatusErrorCondition
400"Límite de favoritos alcanzado"List already contains 100 recipes and this is an add operation
401"No autorizado - Token no proporcionado"Missing token
401"Token inválido o expirado"Invalid or expired token
500"Error actualizando favorito"Unexpected server error

100-Item Limit

Each user may save up to 100 recipes as favorites. The limit is enforced server-side on every add operation. When the limit is reached:
  • The POST /api/favoritos/:recetaId endpoint returns 400 if the recipe is not yet in the list.
  • Remove operations are always permitted regardless of the current list size — the limit only blocks additions.
  • To make room for a new favorite, first remove an existing one with another POST call.
{
  "error": "Límite de favoritos alcanzado"
}

Build docs developers (and LLMs) love