Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/EstefanoARG/FridgeRadar/llms.txt

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

Households (hogares) are the top-level organizational unit in FridgeRadar. Each household contains zones, shelves, and products, and can be shared between multiple users via the membership (miembros) sub-resource. Every request to these endpoints must carry a valid Authorization: Bearer <token> header.

POST /api/v1/hogares

Creates a new household owned by the authenticated user. The service automatically records the creator as the first member. Authentication: Authorization: Bearer <token> required.
nombre
string
required
Display name for the household (e.g. "Casa Principal").
codigo_invitacion
string
Optional invite code that other users can quote when requesting to join. If omitted the field is stored as null.

Response — 201 Created

id_hogar
integer
Auto-assigned primary key.
nombre
string
Household name as stored.
codigo_invitacion
string | null
Invite code, or null if not set.
fecha_creacion
string (datetime)
ISO 8601 timestamp of when the household was created.
curl -X POST http://localhost:8000/api/v1/hogares \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "nombre": "Casa Principal",
    "codigo_invitacion": "VERANO24"
  }'
StatusMeaning
201 CreatedHousehold created; object returned.
401 UnauthorizedToken missing, expired, or invalid.
422 Unprocessable EntityValidation error — nombre is required.

GET /api/v1/hogares

Returns all households that the authenticated user belongs to. Authentication: Authorization: Bearer <token> required.

Response — 200 OK

Returns a JSON array of HogarResponse objects.
id_hogar
integer
Household primary key.
nombre
string
Household name.
codigo_invitacion
string | null
Invite code, or null.
fecha_creacion
string (datetime)
Creation timestamp.
curl -X GET http://localhost:8000/api/v1/hogares \
  -H "Authorization: Bearer <token>"
StatusMeaning
200 OKArray returned (may be empty if the user belongs to no households).
401 UnauthorizedToken missing, expired, or invalid.

GET /api/v1/hogares/{id_hogar}

Fetches a single household by its ID. Authentication: Authorization: Bearer <token> required.
id_hogar
integer
required
The primary key of the household to retrieve.

Response — 200 OK

id_hogar
integer
Household primary key.
nombre
string
Household name.
codigo_invitacion
string | null
Invite code, or null.
fecha_creacion
string (datetime)
Creation timestamp.
curl -X GET http://localhost:8000/api/v1/hogares/3 \
  -H "Authorization: Bearer <token>"
StatusMeaning
200 OKHousehold object returned.
401 UnauthorizedToken missing, expired, or invalid.
404 Not FoundNo household exists with that ID.

PATCH /api/v1/hogares/{id_hogar}

Partially updates a household’s mutable fields. Only the fields included in the request body are changed. Authentication: Authorization: Bearer <token> required.
id_hogar
integer
required
The primary key of the household to update.
nombre
string
New display name for the household. Optional.

Response — 200 OK

Returns the full updated HogarResponse object.
id_hogar
integer
Unchanged primary key.
nombre
string
Name after the update.
codigo_invitacion
string | null
Invite code (unchanged by this endpoint).
fecha_creacion
string (datetime)
Original creation timestamp.
curl -X PATCH http://localhost:8000/api/v1/hogares/3 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"nombre": "Casa de Verano"}'
StatusMeaning
200 OKUpdated household returned.
401 UnauthorizedToken missing, expired, or invalid.
404 Not FoundNo household with that ID.
422 Unprocessable EntityValidation error.

DELETE /api/v1/hogares/{id_hogar}

Permanently deletes a household and all its associated data. Authentication: Authorization: Bearer <token> required.
id_hogar
integer
required
The primary key of the household to delete.
curl -X DELETE http://localhost:8000/api/v1/hogares/3 \
  -H "Authorization: Bearer <token>"
StatusMeaning
204 No ContentHousehold deleted; no response body.
401 UnauthorizedToken missing, expired, or invalid.
404 Not FoundNo household with that ID.

POST /api/v1/hogares/{id_hogar}/miembros

Adds a user to a household with a specified role. Authentication: Authorization: Bearer <token> required.
id_hogar
integer
required
The primary key of the target household.
id_usuario
integer
required
Primary key of the user to add.
id_hogar
integer
required
Must match the id_hogar path parameter.
rol
string
Role to assign to the new member. Defaults to "miembro" if omitted. Common values: "admin", "miembro".

Response — 201 Created

id_usuario_hogar
integer
Auto-assigned primary key for this membership record.
id_usuario
integer
User that was added.
id_hogar
integer
Household they were added to.
rol
string
Role assigned to this member.
fecha_union
string (datetime)
ISO 8601 timestamp of when the user joined the household.
curl -X POST http://localhost:8000/api/v1/hogares/3/miembros \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "id_usuario": 7,
    "id_hogar": 3,
    "rol": "miembro"
  }'
StatusMeaning
201 CreatedMembership created; record returned.
401 UnauthorizedToken missing, expired, or invalid.
404 Not FoundHousehold or user not found.
422 Unprocessable EntityValidation error.

GET /api/v1/hogares/{id_hogar}/miembros

Returns all membership records for the specified household. Authentication: Authorization: Bearer <token> required.
id_hogar
integer
required
The primary key of the household whose members to list.

Response — 200 OK

Returns a JSON array of UsuarioHogarResponse objects.
id_usuario_hogar
integer
Membership record primary key.
id_usuario
integer
User’s primary key.
id_hogar
integer
Household’s primary key.
rol
string
Role assigned to this member.
fecha_union
string (datetime)
When the user joined the household.
curl -X GET http://localhost:8000/api/v1/hogares/3/miembros \
  -H "Authorization: Bearer <token>"
StatusMeaning
200 OKArray of membership records returned.
401 UnauthorizedToken missing, expired, or invalid.
404 Not FoundNo household with that ID.

DELETE /api/v1/hogares/{id_hogar}/miembros/{id_usuario_hogar}

Removes a specific membership record from a household, effectively revoking that user’s access. Authentication: Authorization: Bearer <token> required.
id_hogar
integer
required
The primary key of the household.
id_usuario_hogar
integer
required
The primary key of the membership record to remove (not the user’s ID, but the join-table row ID).
curl -X DELETE http://localhost:8000/api/v1/hogares/3/miembros/12 \
  -H "Authorization: Bearer <token>"
StatusMeaning
204 No ContentMember removed; no response body.
401 UnauthorizedToken missing, expired, or invalid.
404 Not FoundHousehold or membership record not found.

Build docs developers (and LLMs) love