Skip to main content
This endpoint requires authentication. Only the owner of the favorite record can delete it — the query is scoped to the current user’s usuario_id.

Endpoint

DELETE /api/favoritos/[id]

Path parameters

id
string
required
The UUID of the recipe (receta_id) to remove from favorites. This is the recipe’s ID, not a separate favorites record ID.

Response

Returns a confirmation message on success.
message
string
Confirmation string. Value is "Eliminado" on success.

Error responses

StatusErrorDescription
401No autorizadoNo active session or invalid session token.
400Database error messageA Supabase delete error occurred.
500Error internoAn unexpected server error occurred.
If the specified recipe is not in the user’s favorites, Supabase performs a no-op delete and still returns 200. No error is raised for non-existent records.

Example request

curl --request DELETE \
  --url https://your-app.vercel.app/api/favoritos/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  --header 'Cookie: sb-access-token=<your-session-token>'

Example responses

200 OK
{
  "message": "Eliminado"
}
401 Unauthorized
{
  "error": "No autorizado"
}

Build docs developers (and LLMs) love