Skip to main content

GET /api/recetas/usuario/[id]

Returns all recipes authored by a specific user, along with that user’s display name. Results are sorted by creation date descending.
No authentication is required to call this endpoint.
Unlike GET /api/recetas, this endpoint does not filter by oculta. All recipes for the user are returned, including hidden ones. Apply visibility filtering in your client if needed.

Path parameters

id
string
required
UUID of the user whose recipes you want to retrieve.

Response fields

recetas
array
required
All recipes authored by the user, ordered by fecha_creacion descending.
username
string
required
Display name of the user. Falls back to "Usuario Desconocido" if no profile is found.

Example request

curl -X GET "https://example.com/api/recetas/usuario/f1e2d3c4-b5a6-7890-abcd-ef0987654321"

Example response

{
  "recetas": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "titulo": "Pasta al pesto",
      "descripcion": "Una receta clásica italiana con albahaca fresca.",
      "tiempo": "20 minutos",
      "dificultad": "Fácil",
      "ingredientes": "[\"pasta\", \"albahaca\", \"ajo\"]",
      "pasos": "[\"Cocer la pasta.\", \"Mezclar con el pesto.\"]",
      "imagen_url": "https://example.com/images/pasta.jpg",
      "oculta": false,
      "fecha_creacion": "2024-03-15T10:30:00.000Z",
      "autor_id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321",
      "perfiles": {
        "nombre": "María García",
        "avatar_url": "https://example.com/avatars/maria.jpg"
      }
    }
  ],
  "username": "María García"
}

Error responses

StatusCondition
400Missing id path parameter or database error
500Unexpected server error

Build docs developers (and LLMs) love