Updating Appointments
Update an existing appointment — reschedule, assign a doctor, add notes, or change status — using PATCH /v1/appointments/{appointment_id}.
Before You Begin
Your API key requires the appointments:write scope.
Updating an Appointment
- Endpoint:
PATCH https://api.huskyvoice.ai/v1/appointments/{appointment_id} - Required scope:
appointments:write
Send only the fields you want to change. At least one field is required.
- 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 '{
"assigned_doctor": "Dr. Priya Sharma",
"notes": "Patient requested morning slot"
}'
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 = {
"assigned_doctor": "Dr. Priya Sharma",
"notes": "Patient requested morning slot"
}
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({
assigned_doctor: "Dr. Priya Sharma",
notes: "Patient requested morning slot"
})
}
);
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 – Update Appointment",
"nodes": [
{
"parameters": {
"method": "PATCH",
"url": "https://api.huskyvoice.ai/v1/appointments/appt_a1b2c3d4e5",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "{\n \"assigned_doctor\": \"Dr. Priya Sharma\",\n \"notes\": \"Patient requested morning slot\"\n}"
},
"id": "1",
"name": "Update 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": "Dr. Priya Sharma",
"status": "confirmed",
"external_reference_id": null,
"created_at": "2026-05-26T10:00:00.000Z",
"updated_at": "2026-05-26T11:00:00.000Z"
}
}
Updatable Fields
| Field | Description |
|---|---|
appointment_date | Reschedule to a new ISO 8601 UTC datetime — validated against availability, capacity, and duplicate rules |
status | Set a new status: confirmed, completed, or cancelled |
assigned_doctor | Name or identifier of the assigned doctor |
notes | Free-text notes attached to the appointment |
session | "Morning", "Afternoon", or "Evening" |
batch | Batch label (e.g. "MA") |
When you pass appointment_date, the same availability and capacity checks that apply at creation are re-run against the new date and time. The request will fail with OUTSIDE_AVAILABILITY, SLOT_FULL, or DUPLICATE_BOOKING if the new time does not pass validation. Unless you explicitly include a status field in the same request, the appointment's status is automatically set to "rescheduled".
Use status: "completed" to mark an appointment as done, and status: "cancelled" to cancel it. See Cancelling Appointments for cancellation-specific details.
Error Codes
| Status | Code | Cause |
|---|---|---|
400 | VALIDATION_ERROR | No valid fields provided, or appointment_date format is invalid |
404 | NOT_FOUND | Appointment not found |
409 | SLOT_FULL | Rescheduled time has no remaining capacity |
409 | SLOT_INACTIVE | Rescheduled window is closed |
409 | DUPLICATE_BOOKING | An active booking already exists for this patient, type, and new date |
422 | OUTSIDE_AVAILABILITY | Rescheduled time does not fall within any configured calendar window |
403 | INSUFFICIENT_SCOPE | API key does not have the required scope |