Skip to main content
This endpoint requires authentication. Requests without a valid session return 401 No autorizado.

Endpoint

GET /api/favoritos

Request

No request body or query parameters required. The user is identified from the active session cookie.

Response

Returns a JSON array of recipe objects, ordered by the date they were saved (most recent first). Each item is a full recipe record with the author’s profile name joined.
[].id
string
Unique identifier of the recipe (UUID).
[].titulo
string
Title of the recipe.
[].descripcion
string
Short description of the recipe.
[].imagen_url
string
Public URL of the recipe’s cover image.
[].autor_id
string
UUID of the user who created the recipe.
[].oculta
boolean
Whether the recipe is hidden from public listings.
[].fecha_creacion
string
ISO 8601 timestamp of when the recipe was created.
[].perfiles
object
Author profile data joined from the perfiles table.

Error responses

StatusErrorDescription
401No autorizadoNo active session or invalid session token.
400Database error messageA Supabase query error occurred.
500Error internoAn unexpected server error occurred.

Example request

curl --request GET \
  --url https://your-app.vercel.app/api/favoritos \
  --header 'Cookie: sb-access-token=<your-session-token>'

Example responses

200 OK
[
  {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "titulo": "Tacos de carnitas",
    "descripcion": "Receta tradicional de tacos de carnitas al estilo michoacano.",
    "imagen_url": "https://your-project.supabase.co/storage/v1/object/public/recetas/receta-user-id-1234567890.jpg",
    "autor_id": "f0e9d8c7-b6a5-4321-fedc-ba9876543210",
    "oculta": false,
    "fecha_creacion": "2024-03-15T10:30:00.000Z",
    "perfiles": {
      "nombre": "María López"
    }
  }
]
401 Unauthorized
{
  "error": "No autorizado"
}

Build docs developers (and LLMs) love