curl --request PATCH \
--url https://api.openloophealth.com/v0.1/appointments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"cancel": {
"reason": "<string>"
}
}
'import requests
url = "https://api.openloophealth.com/v0.1/appointments/{id}"
payload = { "cancel": { "reason": "<string>" } }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cancel: {reason: '<string>'}})
};
fetch('https://api.openloophealth.com/v0.1/appointments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openloophealth.com/v0.1/appointments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cancel' => [
'reason' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openloophealth.com/v0.1/appointments/{id}"
payload := strings.NewReader("{\n \"cancel\": {\n \"reason\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.openloophealth.com/v0.1/appointments/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancel\": {\n \"reason\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/appointments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel\": {\n \"reason\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"status": "open",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"outcome": "completed",
"state": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancel_reason": "<string>",
"notes": "<string>",
"external_refs": [
{
"system": "<string>",
"id": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Update an appointment
Changes one of your appointments. The body carries exactly one named change: cancel, reschedule, complete, or reopen. Two together is a 400 (conflicting-patch); none is a 400 (empty-patch).
Cancel — { "cancel": { "reason": "..." } } closes the appointment and frees the slot. The response carries cancelled_at and cancel_reason. reason is optional, so { "cancel": {} } is a valid cancel.
Reschedule — { "reschedule": { "slot_token": "..." } } moves it to the window sealed by a token from a slot search. start and end are not settable directly: the token is what proves the new window is bookable, and the provider is re-selected from the set it seals. The appointment id does not change.
Complete — { "complete": {} } records that the visit happened; { "complete": { "no_show": true } } that the patient did not attend. One arm settles both, because closing the appointment out and saying whether the patient turned up is one action.
Reopen — { "reopen": {} } re-opens a closed appointment, a cancelled one included. Cancelling freed the slot, so this is best-effort: the response is { appointment, mechanism } rather than the appointment alone. mechanism is original-provider (the window came back), substitute-provider (another provider took it; original_provider_id names who held it before), or unresolved (nobody could take the window, so the appointment stays closed — but with the outcome you disputed replaced by unresolved, from which reschedule and cancel both work). The arm takes no fields: the substitute search reads the appointment’s own type and state.
Every arm is attributed to the access token’s subject, so the appointment’s status history names who acted.
curl --request PATCH \
--url https://api.openloophealth.com/v0.1/appointments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"cancel": {
"reason": "<string>"
}
}
'import requests
url = "https://api.openloophealth.com/v0.1/appointments/{id}"
payload = { "cancel": { "reason": "<string>" } }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({cancel: {reason: '<string>'}})
};
fetch('https://api.openloophealth.com/v0.1/appointments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.openloophealth.com/v0.1/appointments/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'cancel' => [
'reason' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.openloophealth.com/v0.1/appointments/{id}"
payload := strings.NewReader("{\n \"cancel\": {\n \"reason\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.openloophealth.com/v0.1/appointments/{id}")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancel\": {\n \"reason\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openloophealth.com/v0.1/appointments/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel\": {\n \"reason\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"status": "open",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"outcome": "completed",
"state": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"cancel_reason": "<string>",
"notes": "<string>",
"external_refs": [
{
"system": "<string>",
"id": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "slot_search.window_too_large",
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Authorizations
Headers
A key you generate, one per update attempt. A retry under the same key replays the stored response instead of applying the change twice. Omitting it is a 400 (missing-idempotency-key). A key is global to your integration, not scoped to an endpoint or an appointment, so mint a fresh UUID per action rather than deriving one from the resource — a key already spent on a booking will replay that booking if you send it on a later cancel or complete.
1 - 255Body
Response
The updated appointment — or, on the reopen arm, the appointment plus the mechanism that restored it.
- Option 1
- Option 2
A booked appointment. Returned bare (not wrapped in a data envelope) by the single-appointment endpoints. Carries no organization_id — your org comes from the access token.

