Clear (cancel) a contact's appointment
Finds the contact by contact_id or phone_number and cancels their
appointment(s).
ALL of the contact's live upcoming appointments are soft-deleted in
the appointments table, not just the soonest one — duplicate rows do
occur (the AI setter, inbound webhooks, and the booking page each insert
independently), and clearing one left the duplicate on the calendar.
Past appointments are left alone as reporting history; if the contact has
nothing upcoming, the single most recent appointment is cleared instead.
Once no live appointment remains, the contact's appointment_date,
appointment_time, and appointment_date_display columns are nulled so
the contact record and the calendar agree. If a live appointment still
remains, those columns are left pointing at it.
A cancel that removed nothing returns success: false with reason
no_appointment_to_clear — still HTTP 200, because the request was
processed fine and the outcome was simply "nothing booked". Check
success (or appointments_cleared), not the status code: a cancel
arriving before the booking exists must not be read as a cancellation.
Idempotent — calling it twice gives success: false the second time.
Never creates a contact — an unknown identifier returns 404 with reason
contact_not_found.
Required fields: one of contact_id / phone_number. No date/time.
https://api.channelautomation.com/api/appointmentsAuthorization
Request body JSON required
Returns
200
Request processed. success is the outcome, not the status code:
true means at least one appointment was soft-deleted; false with
reason no_appointment_to_clear means the contact had nothing booked
and nothing was cancelled.
400
Missing identifier (neither contact_id nor phone_number)
- reasonoptionalstring
Short error code for programmatic handling. Possible values:
missing_phonemissing_adatemissing_atimemissing_workspacemissing_workspace_contextcontact_upsert_failedcontact_upsert_exceptiondatetime_resolution_failedappointment_insert_failedappointment_insert_exceptionunhandled_exception
Additional values returned by PUT /api/appointments:
missing_identifier(neither contact_id nor phone_number provided)invalid_contact_id(contact_id is not a valid UUID)contact_not_foundcontact_lookup_failedappointment_lookup_failedappointment_update_failedfeature_disabled(APPOINTMENT_UPDATE_API flag is off for the workspace)
403
API key lacks contacts.write permission
404
No contact found for the provided identifier in this workspace
(reason contact_not_found). A contact that exists but has no
appointment is NOT a 404 — that returns 200 with success: false
and reason no_appointment_to_clear.
- reasonoptionalstring
Short error code for programmatic handling. Possible values:
missing_phonemissing_adatemissing_atimemissing_workspacemissing_workspace_contextcontact_upsert_failedcontact_upsert_exceptiondatetime_resolution_failedappointment_insert_failedappointment_insert_exceptionunhandled_exception
Additional values returned by PUT /api/appointments:
missing_identifier(neither contact_id nor phone_number provided)invalid_contact_id(contact_id is not a valid UUID)contact_not_foundcontact_lookup_failedappointment_lookup_failedappointment_update_failedfeature_disabled(APPOINTMENT_UPDATE_API flag is off for the workspace)
500
Clearing the appointment failed (DB error)
- reasonoptionalstring
Short error code for programmatic handling. Possible values:
missing_phonemissing_adatemissing_atimemissing_workspacemissing_workspace_contextcontact_upsert_failedcontact_upsert_exceptiondatetime_resolution_failedappointment_insert_failedappointment_insert_exceptionunhandled_exception
Additional values returned by PUT /api/appointments:
missing_identifier(neither contact_id nor phone_number provided)invalid_contact_id(contact_id is not a valid UUID)contact_not_foundcontact_lookup_failedappointment_lookup_failedappointment_update_failedfeature_disabled(APPOINTMENT_UPDATE_API flag is off for the workspace)
