curl --request PATCH \
--url https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters/{encounter_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
started_at: '2023-11-07T05:31:56Z',
ended_at: '2023-11-07T05:31:56Z',
reason: '<string>'
})
};
fetch('https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters/{encounter_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters/{encounter_id}"
payload = {
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "consultation",
"status": "draft",
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"source": "clinic",
"review_status": "pending",
"class": "ambulatory",
"reason": "<string>",
"clinician_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"origin_assistant_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"idempotent_replay": true
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}Update an encounter
Permission: encounters:write
Change the details of a visit the API opened.
Answers 200 with the encounter. Changes the visit’s class, start, end or reason, and only on a draft the SAME key opened that no clinician has edited since: a signed, locked or clinician-edited visit is refused with 409 note_not_editable, and a visit opened by anyone else is a 404. It never changes note text and never signs, locks or finalizes. The Idempotency-Key header is optional. Send JSON; a FHIR Encounter body is refused.
curl --request PATCH \
--url https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters/{encounter_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
started_at: '2023-11-07T05:31:56Z',
ended_at: '2023-11-07T05:31:56Z',
reason: '<string>'
})
};
fetch('https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters/{encounter_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters/{encounter_id}"
payload = {
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "consultation",
"status": "draft",
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"source": "clinic",
"review_status": "pending",
"class": "ambulatory",
"reason": "<string>",
"clinician_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"origin_assistant_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"idempotent_replay": true
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"code": "<string>",
"request_id": "<string>",
"detail": "<string>",
"errors": [
{
"pointer": "<string>",
"message": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional. A unique value you choose for this request, such as a UUID. When sent, a retry with the same key returns the first answer instead of applying the change twice. See Retries and idempotency.
1Body
A change to a visit's details. It is accepted only while the draft the same key opened is still untouched: once a clinician has edited or signed the note the answer is 409 note_not_editable, and another party's visit is a 404. Only these four fields can change; no note text can be sent and nothing is signed, locked or finalized. The Idempotency-Key header is optional. Send JSON; a FHIR Encounter body is not accepted.
Response
OK.
A visit as documented in the clinic: a clinical note seen as a visit — the exposed-field allow-list, field by field. The id is the note's id, so the same visit reads under Notes. It carries the visit's status, dates, administrative reason and clinician only: no note text, title, diagnosis, plan, service, signature or billing is ever exposed here (clinical text is read through Notes). Every encounter is a consultation; triage, ward and appointment records are not encounters in this API. A visit opened through the API is a draft with review_status: pending until a clinician has reviewed it.
Show child attributes
Show child attributes
Present and true when this Idempotency-Key was already used and the original answer is returned.