Marks an appointment as cancelled. With the default is_copy=0, a cancelled appointment is no longer visible to PATCH or reschedule operations.
Use cases
A patient phones to cancel.
The practice cancels due to clinician availability.
An external booking system propagates a cancellation.
Request body
cancel_reason_id
| integer | Optional. 1 or greater. Use a value from /api/v1/cancel-reasons. |
notes
| string | Optional. Up to 256 characters. |
is_copy
| integer | Optional. 0 (default) or 1. |
appointment_id is supplied as a path parameter on POST /api/v1/appointments/{appointment_id}/cancel.
Returns
A 200 confirms the cancellation. data is an array holding {"status": "cancelled", "appointment_id": 85799}.
Error responses
422 | (none) | notes exceeds 256 characters (schema validation, checked before any business-logic rules run).
|
404 | AW-6050
| Appointment not found (does not exist or already cancelled). |
422 | (none) | cancel_reason_id below 1, or is_copy not 0/1 (schema validation).
|
409 | AW-6058
| Appointment has already been marked as attended. |
409 | AW-6020
| The appointment book is locked for that day by another session, for example someone editing the day at the practice. The lock is temporary: retry after a short wait (for example 30 to 60 seconds) or offer another book or day. |
403 | AW-6001
| Access denied by the practice management system. |
400 | AW-6023
| The notes value contains a disallowed HTML markup pattern (rejected outright, not saved). Script or event-handler shaped content returns 400 with no support_code. |
400 | AW-6025
| The notes value contains characters with no plain-letter equivalent. |
400 | AW-6026
| The notes value is longer than 256 characters after accented characters are converted to plain letters. |
For the canonical list of error codes, see Validation, Limits & Character Handling.
Example error responses
notes over 256 characters (422):
{ "data": [], "status": false, "message": "'notes': ensure this value has at most 256 characters" }
Appointment not found or already cancelled (404):
{ "data": [], "status": false, "message": "Appointment not found.", "support_code": "AW-6050" }
cancel_reason_id below 1 (422):
{ "data": [], "status": false, "message": "'cancel_reason_id': ensure this value is greater than or equal to 1" }
is_copy not 0 or 1 (422):
{ "data": [], "status": false, "message": "'is_copy': ensure this value is less than or equal to 1" }
Important notes
By design, with is_copy=0 the cancelled appointment is no longer visible to subsequent write operations. Re-cancelling returns 404 AW-6050.
cancel_reason_id is optional. To record a specific reason, supply a valid ID from GET /api/v1/cancel-reasons. Omitting it does not prevent cancellation.
When supplied, cancel_reason_id must be 1 or greater; a value below 1 is rejected with 422.
A cancel_reason_id of 1 or greater that doesn’t match a currently active reason for the practice is not rejected: the cancellation still succeeds, but the reason is silently dropped, and the response’s warnings[] discloses this.
is_copy controls what happens to the original appointment. It defaults to 0 and accepts only 0 or 1. With
is_copy=0 the appointment is moved to the cancellation list and is no longer visible to PATCH or reschedule. With
is_copy=1 the original appointment stays in the appointment book and a cancelled copy is recorded. The
appointment_id in the response is then the original appointment’s id, and the cancelled copy appears in
Get cancelled appointments under a different
appointment_id.
notes are capped at 256 characters (a much smaller column than Create/Update Appointment’s
notes field); a value over the limit is rejected with
422 and no
support_code, a schema-validation message naming the field and the limit. Accented characters are converted to plain letters before the practice database stores the value; if the converted text is longer than 256 characters the request is rejected with
400AW-6026. HTML or script content in
notes is rejected outright, as on
Create appointment.
No duplicate protection: this endpoint does not accept an
Idempotency-Key. If a request times out or returns
502,
503 or
504, read the appointment with
Get appointment by ID before sending it again: the cancellation may already have been saved. With
is_copy=0 a cancelled appointment is no longer returned there, so check
Get cancelled appointments with
patient_id instead.
Platform errors: errors such as
MOD-4268 (the practice database needs an upgrade) and
RP-5037 (the Halo Connect daily request quota for the practice is used up; retry after the time given) can be returned by any endpoint. See
Validation, Limits & Character Handling.
Quick example
curl -X POST "https://api-uat.dental4web.com.au/api/v1/appointments/85799/cancel" \
-H "x-api-key: $API_KEY" \
-H "org-id: $ORG_ID" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"cancel_reason_id": 3, "is_copy": 0}'