Skip to main content

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 -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"
}'

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

FieldDescription
appointment_dateReschedule to a new ISO 8601 UTC datetime — validated against availability, capacity, and duplicate rules
statusSet a new status: confirmed, completed, or cancelled
assigned_doctorName or identifier of the assigned doctor
notesFree-text notes attached to the appointment
session"Morning", "Afternoon", or "Evening"
batchBatch label (e.g. "MA")
Rescheduling

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".

Status transitions

Use status: "completed" to mark an appointment as done, and status: "cancelled" to cancel it. See Cancelling Appointments for cancellation-specific details.


Error Codes

StatusCodeCause
400VALIDATION_ERRORNo valid fields provided, or appointment_date format is invalid
404NOT_FOUNDAppointment not found
409SLOT_FULLRescheduled time has no remaining capacity
409SLOT_INACTIVERescheduled window is closed
409DUPLICATE_BOOKINGAn active booking already exists for this patient, type, and new date
422OUTSIDE_AVAILABILITYRescheduled time does not fall within any configured calendar window
403INSUFFICIENT_SCOPEAPI key does not have the required scope