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
- Python
- JavaScript
- n8n
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"}'
import requests
appointment_id = "appt_a1b2c3d4e5"
url = f"https://api.huskyvoice.ai/v1/appointments/{appointment_id}"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {"status": "cancelled"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
const appointmentId = "appt_a1b2c3d4e5";
const response = await fetch(
`https://api.huskyvoice.ai/v1/appointments/${appointmentId}`,
{
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({ status: "cancelled" })
}
);
const data = await response.json();
console.log(data);
Create an HTTP Header Auth credential in n8n: set Name to Authorization and Value to Bearer YOUR_API_KEY. Select it in the HTTP Request node's Authentication field.
{
"name": "HuskyVoice – Cancel Appointment",
"nodes": [
{
"parameters": {
"method": "PATCH",
"url": "https://api.huskyvoice.ai/v1/appointments/appt_a1b2c3d4e5",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "{\n \"status\": \"cancelled\"\n}"
},
"id": "1",
"name": "Cancel Appointment",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [250, 300]
}
],
"connections": {},
"settings": {},
"meta": { "instanceId": "huskyvoice-docs" }
}
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 behaviour is governed by your org settings. Read GET /v1/appointment-config to check:
allow_cancellation— iffalse, the API will reject cancellation requestscancellation_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
| Status | Code | Cause |
|---|---|---|
404 | NOT_FOUND | Appointment not found |
403 | INSUFFICIENT_SCOPE | API key does not have the required scope |