# Remove Appointment The record_as_cancelled field controls whether the removal of an appointment is recorded as a cancellation on the patient's record. When set to true, the appointment is recorded as a cancellation and included in the patient's attendance history. When set to false, the appointment is removed without affecting the patient's attendance history. In both cases, the action is recorded in the system audit log. Endpoint: POST /appointment/{appointment_id}/cancel Version: v1 Security: x-api-key, A-api-key ## Path parameters: - `appointment_id` (integer, required) ## Request fields (application/json): - `appointment_cancellation_reason_id` (integer) - `record_as_cancelled` (boolean) - `reason` (string) ## Response 401 fields (application/json): - `error` (object, required) - `error.status` (integer) Example: 403 - `error.code` (string) Example: "UNAUTHORIZED" - `error.detail` (string) Human readable explanation of the error Example: "Access could not be verified for this request." - `request_id` (string, required) Example: "00000000-0000-0000-0000-000000000000" ## Response 403 fields (application/json): - `error` (object, required) - `error.status` (integer) Example: 403 - `error.code` (string) Example: "MISSING_AUTHENTICATION_TOKEN" - `error.detail` (string) Human readable explanation of the error Example: "Authentication token is missing or the requested endpoint does not exist" - `request_id` (string, required) Example: "00000000-0000-0000-0000-000000000000" ## Response 404 fields (application/json): - `error` (object, required) - `error.status` (integer) Example: 404 - `error.code` (string) Example: "NOT_FOUND" - `error.detail` (string) Human readable explanation of the error Example: "Could not find {Resource} with ID {ID_HERE}" - `request_id` (string) Example: "00000000-0000-0000-0000-000000000000" ## Response 422 fields (application/json): - `error` (object, required) - `error.status` (integer) Example: 422 - `error.code` (string) Example: "INVALID_BODY" - `error.detail` (string) Human readable explanation of the error Example: "There are some issues with the request body." - `error.validation` (array) List of validation errors for specific fields - `error.validation.field` (string) Example: "surname" - `error.validation.message` (string) Example: "The surname field is required." - `request_id` (string, required) Example: "00000000-0000-0000-0000-000000000000" ## Response 500 fields (application/json): - `error` (object, required) - `error.status` (integer) Example: 500 - `error.code` (string) Example: "SERVER_ERROR" - `error.detail` (string) Human readable explanation of the error Example: "An unexpected error occurred while processing your request. Please try again in a few minutes. If it keeps happening, contact support with Request ID: 00000000-0000-0000-0000-000000000000." - `request_id` (string, required) Example: "00000000-0000-0000-0000-000000000000" ## Response 204 fields