Skip to main content

Cancelling Appointments

Cancel a confirmed appointment by setting its status to cancelled using PATCH /v1/appointments/{appointment_id}.

There is no dedicated cancel endpoint — cancellation is a status update. This means you can include other field updates in the same request.


Before You Begin

Your API key requires the appointments:write scope. Whether cancellation is permitted at all is controlled by the allow_cancellation and cancellation_notice_hours settings in your org configuration (see Appointments Overview).


Cancelling an Appointment

  • Endpoint: PATCH https://api.huskyvoice.ai/v1/appointments/{appointment_id}
  • Required scope: appointments:write
curl -s -X PATCH https://api.huskyvoice.ai/v1/appointments/appt_a1b2c3d4e5 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "cancelled"}'

Response — 200 OK

{
"success": true,
"data": {
"appointment_id": "appt_a1b2c3d4e5",
"appointment_type": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"branch_id": "branch_uuid_here",
"date": "2026-06-15",
"session": "Morning",
"batch": "MA",
"token": null,
"patient_name": "Aadhi",
"parent_phone": "+919840XXXXXX",
"assigned_doctor": null,
"status": "cancelled",
"external_reference_id": null,
"created_at": "2026-05-26T10:00:00.000Z",
"updated_at": "2026-05-26T12:00:00.000Z"
}
}

Important Constraints

Cancellation policy

Cancellation behaviour is governed by your org settings. Read GET /v1/appointment-config to check:

  • allow_cancellation — if false, the API will reject cancellation requests
  • cancellation_notice_hours — minimum hours of advance notice required before the appointment time
  • Idempotency: Cancelling an already-cancelled appointment is safe — the API returns the current record without error.
  • No deletion: Appointments are never deleted. A cancelled appointment remains visible in search results and can be retrieved by ID.
  • Slot capacity is freed: When an appointment is cancelled, that slot's filled count is decremented, making the capacity available for new bookings.

Error Codes

StatusCodeCause
404NOT_FOUNDAppointment not found
403INSUFFICIENT_SCOPEAPI key does not have the required scope