Skip to main content

DELETE /api/platos/:id

Soft-deletes a dish by setting its borrado_en timestamp. The record remains in the database but is excluded from all active dish queries. Authentication: Bearer JWT required
Required role: admin
This is a soft delete. The dish record is not removed from the database — borrado_en is set to the current timestamp. The dish will no longer appear in GET /api/platos or GET /api/platos/:id, but historical references in orders remain intact.

Request

Path parameters

id
string
required
The dish ID (nanoid format, 10 characters)

Response

Success (200)

message
string
Confirmation message, e.g. "Plato con ID aB3dEfGhIj eliminado exitosamente (soft delete)"

Error responses

StatusDescription
401Unauthorized — missing or invalid JWT
403Forbidden — role is not admin
404Dish not found or already deleted

Example

curl -X DELETE http://localhost:3000/api/platos/aB3dEfGhIj \
  -H "Authorization: Bearer <token>"
{
  "message": "Plato con ID aB3dEfGhIj eliminado exitosamente (soft delete)"
}

Build docs developers (and LLMs) love