Skip to main content
DELETE
/
api
/
citas
/
:id
Delete Appointment
curl --request DELETE \
  --url https://api.example.com/api/citas/:id
{
  "message": "<string>"
}

Authentication

This endpoint requires authentication and authorization. Required role: admin only Header:
Authorization: Bearer <token>

Path Parameters

id
number
required
The appointment ID to delete

Response

Returns a success message confirming deletion.
message
string
Success message confirming the appointment was deleted

Example Request

curl -X DELETE https://api.example.com/api/citas/1 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Example Response

{
  "message": "Cita eliminada correctamente"
}

Error Responses

401 Unauthorized
Missing or invalid authentication token
{
  "message": "Token no proporcionado"
}
403 Forbidden
User doesn’t have admin role
{
  "message": "Acceso denegado: requiere rol admin"
}
500 Internal Server Error
Server error while deleting appointment
{
  "message": "Error al eliminar cita"
}

Notes

  • This endpoint is restricted to users with the admin role only
  • The deletion is permanent and cannot be undone
  • Consider using the cancel endpoint instead of delete to preserve records
  • If the appointment ID doesn’t exist, the operation may still return success or a 500 error depending on database constraints

Build docs developers (and LLMs) love