Cancel Appointment(s)

Cancelling is done via our PATCH Appointments endpoints.

Cancel Single Appointment

If you want to cancel a single appointment, use PATCH Appointment endpoint, passing appointment_id as the path parameter, and including "status": "cancelled" in JSON body payload:

curl --location --request PATCH 'https://api.leyr.io/api/emrs/{emr}/appointments/{appointment_id}' 
--header 'x-leyr-client-id: {x-leyr-client-id}'
--header 'x-leyr-client-secret: {x-leyr-client-secret}'
--header 'x-leyr-standard: {x-leyr-standard}'
--data-raw '{
    "status": "cancelled",
    "comment": {comment}
}'

You don't have to provide other optional fields, mentioned in the endpoint (like start, end or resource_id), but you can provide comment that will be added to the appointment in EHR.

Cancel Multiple Appointments

If you want to cancel multiple appointments at once, doing bulk cancel, use our PATCH Appointments. In that case you no longer pass appointment_id in path parameters. Instead, you pass ids in array in JSON body payload, together with "status": "cancelled"

curl --location --request PATCH 'https://api.leyr.io/api/emrs/{emr}/appointments' 
--header 'x-leyr-client-id: {x-leyr-client-id}'
--header 'x-leyr-client-secret: {x-leyr-client-secret}'
--header 'x-leyr-standard: {x-leyr-standard}'
--data-raw '{
    "ids": ["appointment_id_1", "appointment_id_2", "appointment_id_3"],
    "status": "cancelled",
    "comment": {comment}
}'

You don't have to provide other optional fields, mentioned in the endpoint (like start, end or resource_id), but you can provide comment that will be added to the appointments in EHR.