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.

All /api/consumos routes require a valid Bearer token in the Authorization header. Dates and times are always stored and returned in the Bogotá timezone (UTC-5).
HealtyHelp stores every date as a plain YYYY-MM-DD string and every time as HH:mm in Bogotá time (UTC-5). Pass date parameters in this format and interpret all fechaBogota / horaBogota fields accordingly.

The Consumo object

Every endpoint that returns consumption records uses the following shape:
{
  "_id": "664a1b2c3d4e5f6a7b8c9d0e",
  "userId": "663f0a1b2c3d4e5f6a7b8c9d",
  "recetaId": "661e0f2a3b4c5d6e7f8a9b0c",
  "recetaSnapshot": {
    "nombre": "Avena con frutas",
    "img": "https://cdn.example.com/avena.jpg",
    "desc": "Bowl de avena con fresas y arándanos"
  },
  "tipo": "desayuno",
  "fechaBogota": "2024-05-20",
  "horaBogota": "07:45",
  "nutri": {
    "cal": 320,
    "prot": 12,
    "carb": 54,
    "gras": 6
  },
  "createdAt": "2024-05-20T12:45:00.000Z",
  "updatedAt": "2024-05-20T12:45:00.000Z"
}
FieldTypeDescription
_idstringMongoDB ObjectId of this consumption entry
userIdstringObjectId of the owning user
recetaIdstringObjectId of the logged recipe
recetaSnapshot.nombrestringRecipe name at the time of logging
recetaSnapshot.imgstringRecipe image URL at the time of logging
recetaSnapshot.descstringRecipe short description at the time of logging
tipostringMeal slot: desayuno, almuerzo, cena, or snack
fechaBogotastringDate in Bogotá time — YYYY-MM-DD
horaBogotastringTime of logging in Bogotá time — HH:mm
nutriobjectNutritional snapshot copied from the recipe at log time (fields vary by recipe)
createdAtstringISO 8601 UTC timestamp of document creation

Meal type auto-detection

When logging via POST /api/consumos/:recetaId, the tipo is inferred automatically:
Bogotá hourAssigned tipo
06:00 – 11:59desayuno
12:00 – 16:59almuerzo
17:00 – 05:59cena
any (recipe category postres-snacks)snack
Snacks are limited to 3 per day. Main meal slots (desayuno, almuerzo, cena) allow multiple entries per slot per day.

Endpoints

GET /api/consumos/hoy

Returns all consumption entries logged today in Bogotá time, sorted by horaBogota ascending. Response
{
  "fecha": "2024-05-20",
  "consumos": [ /* Consumo[] */ ]
}
curl https://api.healtyhelp.com/api/consumos/hoy \
  -H "Authorization: Bearer <token>"

GET /api/consumos/dias

Returns a deduplicated, descending-sorted list of every date (YYYY-MM-DD) that has at least one consumption record for the authenticated user. Response
{
  "dias": ["2024-05-20", "2024-05-19", "2024-05-15"]
}
curl https://api.healtyhelp.com/api/consumos/dias \
  -H "Authorization: Bearer <token>"

GET /api/consumos/dia/:fecha

Returns all consumptions for the specified day, sorted by horaBogota ascending. Path parameter
fecha
string
required
Target date in YYYY-MM-DD format (Bogotá timezone).
Response
{
  "consumos": [ /* Consumo[] */ ]
}
curl https://api.healtyhelp.com/api/consumos/dia/2024-05-20 \
  -H "Authorization: Bearer <token>"

GET /api/consumos/semana/:lunes

Returns all consumptions for the 7-day week beginning on the given Monday date. Path parameter
lunes
string
required
Monday date in YYYY-MM-DD format. The window spans from this date to the following Sunday (inclusive).
Response
{
  "semana": {
    "inicio": "2024-05-20",
    "fin": "2024-05-26"
  },
  "consumos": [ /* Consumo[] sorted by fechaBogota, horaBogota */ ]
}
curl https://api.healtyhelp.com/api/consumos/semana/2024-05-20 \
  -H "Authorization: Bearer <token>"

GET /api/consumos/mes/:yearMes

Returns all consumptions for the given calendar month. Path parameter
yearMes
string
required
Month in YYYY-MM format (e.g. 2024-05).
Response
{
  "mes": "2024-05",
  "consumos": [ /* Consumo[] sorted by fechaBogota, horaBogota */ ]
}
curl https://api.healtyhelp.com/api/consumos/mes/2024-05 \
  -H "Authorization: Bearer <token>"

GET /api/consumos/receta/:recetaId/hoy

Checks whether a specific recipe has already been logged today, and whether it can still be logged at the current Bogotá hour. Path parameter
recetaId
string
required
MongoDB ObjectId of the recipe to check.
Response
{
  "tipoActual": "almuerzo",
  "registrado": false,
  "consumoId": null,
  "tipo": null,
  "bloqueado": false,
  "motivoBloqueado": null
}
FieldTypeDescription
tipoActualstringMeal slot that would be assigned right now
registradobooleantrue if this recipe has already been logged today
consumoIdstring | nullObjectId of the existing entry, or null
tipostring | nullMeal type of the existing entry, or null
bloqueadobooleantrue when the recipe cannot be logged again right now
motivoBloqueadostring | nullHuman-readable reason when bloqueado is true

POST /api/consumos/:recetaId

Logs a recipe as consumed right now. The tipo is inferred automatically from the current Bogotá hour (see auto-detection table above). No request body is accepted — the meal slot cannot be overridden on this endpoint. Use POST /api/consumos/manual if you need to choose the slot explicitly. Path parameter
recetaId
string
required
MongoDB ObjectId of the recipe to log.
Response 201 Created
{
  "consumo": { /* Consumo object */ }
}
Error responses
StatusCondition
404Recipe not found
409Snack limit reached (max 3 per day)
curl -X POST https://api.healtyhelp.com/api/consumos/661e0f2a3b4c5d6e7f8a9b0c \
  -H "Authorization: Bearer <token>"

POST /api/consumos/manual

Logs a recipe manually, choosing any meal slot and any past or current date. Useful for retroactively recording meals. Request body
recetaId
string
required
MongoDB ObjectId of the recipe to log.
tipo
string
required
Meal slot: desayuno, almuerzo, cena, or snack.
fecha
string
required
Date in YYYY-MM-DD format (Bogotá timezone). Must be a valid calendar date.
Response 201 Created
{
  "consumo": { /* Consumo object */ }
}
Error responses
StatusCondition
400Invalid tipo or malformed fecha
404Recipe not found
409Snack limit reached (max 3/day)
curl -X POST https://api.healtyhelp.com/api/consumos/manual \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "recetaId": "661e0f2a3b4c5d6e7f8a9b0c",
    "tipo": "cena",
    "fecha": "2024-05-19"
  }'

DELETE /api/consumos/:consumoId

Removes a consumption entry owned by the authenticated user. Path parameter
consumoId
string
required
MongoDB ObjectId of the consumption entry to delete.
Response 200 OK
{ "ok": true }
Error responses
StatusCondition
400Invalid ObjectId format
404Entry not found or does not belong to the authenticated user
curl -X DELETE https://api.healtyhelp.com/api/consumos/664a1b2c3d4e5f6a7b8c9d0e \
  -H "Authorization: Bearer <token>"

PUT /api/consumos/:consumoId/tipo

Updates the meal type of an existing consumption entry. Enforces the same snack cap and duplicate-slot rules as creation. Path parameter
consumoId
string
required
MongoDB ObjectId of the consumption entry to update.
Request body
tipo
string
required
New meal slot: desayuno, almuerzo, cena, or snack.
Response 200 OK
{
  "consumo": { /* updated Consumo object */ }
}
Error responses
StatusCondition
400tipo is not a valid value or ObjectId is malformed
404Entry not found or not owned by the authenticated user
409Changing to snack would exceed the 3-per-day cap, or the target meal slot is already occupied for that day
curl -X PUT https://api.healtyhelp.com/api/consumos/664a1b2c3d4e5f6a7b8c9d0e/tipo \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ "tipo": "snack" }'

Build docs developers (and LLMs) love