curl --request POST \
--url https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clinician_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"origin_assistant_name": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
patient_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
clinician_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
started_at: '2023-11-07T05:31:56Z',
ended_at: '2023-11-07T05:31:56Z',
reason: '<string>',
origin_assistant_name: '<string>'
})
};
fetch('https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters', 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"
payload = {
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clinician_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"origin_assistant_name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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>"
}
]
}Open an encounter
Permission: encounters:write
Open a visit as a draft note.
Opens a visit for a patient as a DRAFT note a clinician completes, and answers 201 Created with the encounter (status: draft, review_status: pending). Nothing is ordered, prescribed, signed, locked or billed, and no note text can be sent; the draft appears in the clinic’s consultation list for a clinician to finish. A restricted patient is a 404. The Idempotency-Key header is REQUIRED — a retry with the same key returns the original encounter, never a second draft. Send JSON; a FHIR Encounter body is refused.
curl --request POST \
--url https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clinician_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"origin_assistant_name": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
patient_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
clinician_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
started_at: '2023-11-07T05:31:56Z',
ended_at: '2023-11-07T05:31:56Z',
reason: '<string>',
origin_assistant_name: '<string>'
})
};
fetch('https://api.clinikehr.com/v1/clinics/{clinic_id}/encounters', 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"
payload = {
"patient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"clinician_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"reason": "<string>",
"origin_assistant_name": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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
A unique value you choose for this request, such as a UUID. Sending the same key again returns the first answer instead of doing the work twice, so a timed-out request is safe to retry. Reusing a key for a different request is refused with 409 idempotency_key_conflict, and retrying while the first request is still running with 409 idempotency_key_reused. See Retries and idempotency.
1Path Parameters
Body
A visit to open for a patient. It opens a DRAFT note for a clinician to complete: nothing is ordered, prescribed, signed, locked or billed, and no note text can be sent (there is no field for it). The draft appears in the clinic's consultation list for the clinician to finish. clinician_id must be a clinician the clinic lists (see GET …/note-clinicians). The Idempotency-Key header is REQUIRED. Send JSON; a FHIR Encounter body is not accepted.
ambulatory, emergency, inpatient, virtual, home_health Must not be before started_at.
The administrative reason for the visit — not clinical note text.
1 - 500Name of the assistant or connected app that opened the visit.
200Response
Created — a draft visit note awaiting a clinician.
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 encounter is returned.