Overview
Permanently deletes an appointment from the system using its unique identifier. This action triggers socket events to notify connected clients of the deletion.
This action is irreversible. The appointment will be permanently removed from the system.
Authentication
Bearer token for authenticated accessAuthorization: Bearer your_jwt_token_here
Path Parameters
Unique appointment identifier (ObjectId format)
Response
Whether the deletion was successful
Error message (only present when success is false)
Example Request
curl -X DELETE /appointments/65f8a1b2c3d4e5f6789012ef \
-H "Authorization: Bearer your_jwt_token_here"
Example Response
Error Response
{
"success": false,
"error": "Error message describing what went wrong"
}
Side Effects
When an appointment is successfully deleted:
- A socket event is emitted with
{ status: "deleted", id: appointment_id } to notify connected clients
- The appointment is permanently removed from the database
- All references to this appointment become invalid