GET /api/recetas
Returns a paginated list of public recipes. Only recipes whereoculta is false are returned, sorted by creation date descending. Each recipe includes the author’s profile data.
No authentication is required to list recipes.
Query parameters
Filter recipes by title. Performs a case-insensitive partial match.
Page number to retrieve.
Number of results per page.
Response fields
Array of recipe objects for the requested page.
Total number of pages for the current query.
The page number returned in this response.
Example request
Example response
POST /api/recetas
Creates a new recipe. The recipe is automatically associated with the authenticated user and set to visible (oculta: false).
Request body
Title of the recipe. Maximum 60 characters. Leading and trailing whitespace is trimmed.
Short description of the recipe. Maximum 300 characters. Leading and trailing whitespace is trimmed.
Preparation and cooking time (e.g.,
"30 minutos"). Leading and trailing whitespace is trimmed.Difficulty level (e.g.,
"Fácil", "Medio", "Difícil").Array of ingredient strings. Empty strings and whitespace-only entries are ignored. At least one valid entry is required.
Array of step strings describing the preparation process. Empty strings and whitespace-only entries are ignored. At least one valid entry is required.
URL of the recipe image. Stored as
null if not provided.Validation rules
titulo,descripcion, andtiempoare required and must not be blank after trimming.titulomust not exceed 60 characters.descripcionmust not exceed 300 characters.ingredientesandpasosmust each contain at least one non-empty string.
Response
Returns201 Created on success.
Error responses
| Status | Condition |
|---|---|
400 | Missing required fields, validation failure, or database error |
401 | No authenticated session |
500 | Unexpected server error |