Skip to main content
DELETE
/
appointments
/
{id}
curl -X DELETE /appointments/65f8a1b2c3d4e5f6789012ef \
  -H "Authorization: Bearer your_jwt_token_here"
{
  "success": true
}

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

Authorization
string
required
Bearer token for authenticated access
Authorization: Bearer your_jwt_token_here

Path Parameters

id
string
required
Unique appointment identifier (ObjectId format)

Response

success
boolean
Whether the deletion was successful
error
string
Error message (only present when success is false)

Example Request

curl -X DELETE /appointments/65f8a1b2c3d4e5f6789012ef \
  -H "Authorization: Bearer your_jwt_token_here"

Example Response

{
  "success": true
}

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