Create encounter
curl --request POST \
--url https://api.clinikapi.com/v1/encounters \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"class": "<string>",
"patientId": "<string>",
"practitionerId": "<string>",
"participants": [
{
"practitionerId": "<string>",
"role": "<string>"
}
],
"type": "<string>",
"serviceType": "<string>",
"priority": "<string>",
"reasonCode": "<string>",
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"lengthMinutes": 123,
"location": "<string>",
"serviceProvider": "<string>",
"diagnosis": [
{
"condition": "<string>",
"use": "<string>",
"rank": 123
}
],
"appointmentId": "<string>",
"basedOnId": "<string>",
"partOfId": "<string>",
"hospitalization": {
"admitSource": "<string>",
"dischargeDisposition": "<string>",
"reAdmission": "<string>",
"dietPreference": [
"<string>"
],
"specialArrangement": [
"<string>"
],
"destination": "<string>",
"origin": "<string>"
}
}
'import requests
url = "https://api.clinikapi.com/v1/encounters"
payload = {
"class": "<string>",
"patientId": "<string>",
"practitionerId": "<string>",
"participants": [
{
"practitionerId": "<string>",
"role": "<string>"
}
],
"type": "<string>",
"serviceType": "<string>",
"priority": "<string>",
"reasonCode": "<string>",
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"lengthMinutes": 123,
"location": "<string>",
"serviceProvider": "<string>",
"diagnosis": [
{
"condition": "<string>",
"use": "<string>",
"rank": 123
}
],
"appointmentId": "<string>",
"basedOnId": "<string>",
"partOfId": "<string>",
"hospitalization": {
"admitSource": "<string>",
"dischargeDisposition": "<string>",
"reAdmission": "<string>",
"dietPreference": ["<string>"],
"specialArrangement": ["<string>"],
"destination": "<string>",
"origin": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
class: '<string>',
patientId: '<string>',
practitionerId: '<string>',
participants: [{practitionerId: '<string>', role: '<string>'}],
type: '<string>',
serviceType: '<string>',
priority: '<string>',
reasonCode: '<string>',
period: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
lengthMinutes: 123,
location: '<string>',
serviceProvider: '<string>',
diagnosis: [{condition: '<string>', use: '<string>', rank: 123}],
appointmentId: '<string>',
basedOnId: '<string>',
partOfId: '<string>',
hospitalization: {
admitSource: '<string>',
dischargeDisposition: '<string>',
reAdmission: '<string>',
dietPreference: ['<string>'],
specialArrangement: ['<string>'],
destination: '<string>',
origin: '<string>'
}
})
};
fetch('https://api.clinikapi.com/v1/encounters', 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.clinikapi.com/v1/encounters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'class' => '<string>',
'patientId' => '<string>',
'practitionerId' => '<string>',
'participants' => [
[
'practitionerId' => '<string>',
'role' => '<string>'
]
],
'type' => '<string>',
'serviceType' => '<string>',
'priority' => '<string>',
'reasonCode' => '<string>',
'period' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'lengthMinutes' => 123,
'location' => '<string>',
'serviceProvider' => '<string>',
'diagnosis' => [
[
'condition' => '<string>',
'use' => '<string>',
'rank' => 123
]
],
'appointmentId' => '<string>',
'basedOnId' => '<string>',
'partOfId' => '<string>',
'hospitalization' => [
'admitSource' => '<string>',
'dischargeDisposition' => '<string>',
'reAdmission' => '<string>',
'dietPreference' => [
'<string>'
],
'specialArrangement' => [
'<string>'
],
'destination' => '<string>',
'origin' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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.clinikapi.com/v1/encounters"
payload := strings.NewReader("{\n \"class\": \"<string>\",\n \"patientId\": \"<string>\",\n \"practitionerId\": \"<string>\",\n \"participants\": [\n {\n \"practitionerId\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"serviceType\": \"<string>\",\n \"priority\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"period\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"lengthMinutes\": 123,\n \"location\": \"<string>\",\n \"serviceProvider\": \"<string>\",\n \"diagnosis\": [\n {\n \"condition\": \"<string>\",\n \"use\": \"<string>\",\n \"rank\": 123\n }\n ],\n \"appointmentId\": \"<string>\",\n \"basedOnId\": \"<string>\",\n \"partOfId\": \"<string>\",\n \"hospitalization\": {\n \"admitSource\": \"<string>\",\n \"dischargeDisposition\": \"<string>\",\n \"reAdmission\": \"<string>\",\n \"dietPreference\": [\n \"<string>\"\n ],\n \"specialArrangement\": [\n \"<string>\"\n ],\n \"destination\": \"<string>\",\n \"origin\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.clinikapi.com/v1/encounters")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"class\": \"<string>\",\n \"patientId\": \"<string>\",\n \"practitionerId\": \"<string>\",\n \"participants\": [\n {\n \"practitionerId\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"serviceType\": \"<string>\",\n \"priority\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"period\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"lengthMinutes\": 123,\n \"location\": \"<string>\",\n \"serviceProvider\": \"<string>\",\n \"diagnosis\": [\n {\n \"condition\": \"<string>\",\n \"use\": \"<string>\",\n \"rank\": 123\n }\n ],\n \"appointmentId\": \"<string>\",\n \"basedOnId\": \"<string>\",\n \"partOfId\": \"<string>\",\n \"hospitalization\": {\n \"admitSource\": \"<string>\",\n \"dischargeDisposition\": \"<string>\",\n \"reAdmission\": \"<string>\",\n \"dietPreference\": [\n \"<string>\"\n ],\n \"specialArrangement\": [\n \"<string>\"\n ],\n \"destination\": \"<string>\",\n \"origin\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/encounters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"class\": \"<string>\",\n \"patientId\": \"<string>\",\n \"practitionerId\": \"<string>\",\n \"participants\": [\n {\n \"practitionerId\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"serviceType\": \"<string>\",\n \"priority\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"period\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"lengthMinutes\": 123,\n \"location\": \"<string>\",\n \"serviceProvider\": \"<string>\",\n \"diagnosis\": [\n {\n \"condition\": \"<string>\",\n \"use\": \"<string>\",\n \"rank\": 123\n }\n ],\n \"appointmentId\": \"<string>\",\n \"basedOnId\": \"<string>\",\n \"partOfId\": \"<string>\",\n \"hospitalization\": {\n \"admitSource\": \"<string>\",\n \"dischargeDisposition\": \"<string>\",\n \"reAdmission\": \"<string>\",\n \"dietPreference\": [\n \"<string>\"\n ],\n \"specialArrangement\": [\n \"<string>\"\n ],\n \"destination\": \"<string>\",\n \"origin\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"requestId": "<string>",
"issues": [
{
"severity": "<string>",
"code": "<string>",
"diagnostics": "<string>"
}
]
}Encounters
Create Encounter
POST
/
v1
/
encounters
Create encounter
curl --request POST \
--url https://api.clinikapi.com/v1/encounters \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"class": "<string>",
"patientId": "<string>",
"practitionerId": "<string>",
"participants": [
{
"practitionerId": "<string>",
"role": "<string>"
}
],
"type": "<string>",
"serviceType": "<string>",
"priority": "<string>",
"reasonCode": "<string>",
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"lengthMinutes": 123,
"location": "<string>",
"serviceProvider": "<string>",
"diagnosis": [
{
"condition": "<string>",
"use": "<string>",
"rank": 123
}
],
"appointmentId": "<string>",
"basedOnId": "<string>",
"partOfId": "<string>",
"hospitalization": {
"admitSource": "<string>",
"dischargeDisposition": "<string>",
"reAdmission": "<string>",
"dietPreference": [
"<string>"
],
"specialArrangement": [
"<string>"
],
"destination": "<string>",
"origin": "<string>"
}
}
'import requests
url = "https://api.clinikapi.com/v1/encounters"
payload = {
"class": "<string>",
"patientId": "<string>",
"practitionerId": "<string>",
"participants": [
{
"practitionerId": "<string>",
"role": "<string>"
}
],
"type": "<string>",
"serviceType": "<string>",
"priority": "<string>",
"reasonCode": "<string>",
"period": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"lengthMinutes": 123,
"location": "<string>",
"serviceProvider": "<string>",
"diagnosis": [
{
"condition": "<string>",
"use": "<string>",
"rank": 123
}
],
"appointmentId": "<string>",
"basedOnId": "<string>",
"partOfId": "<string>",
"hospitalization": {
"admitSource": "<string>",
"dischargeDisposition": "<string>",
"reAdmission": "<string>",
"dietPreference": ["<string>"],
"specialArrangement": ["<string>"],
"destination": "<string>",
"origin": "<string>"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
class: '<string>',
patientId: '<string>',
practitionerId: '<string>',
participants: [{practitionerId: '<string>', role: '<string>'}],
type: '<string>',
serviceType: '<string>',
priority: '<string>',
reasonCode: '<string>',
period: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
lengthMinutes: 123,
location: '<string>',
serviceProvider: '<string>',
diagnosis: [{condition: '<string>', use: '<string>', rank: 123}],
appointmentId: '<string>',
basedOnId: '<string>',
partOfId: '<string>',
hospitalization: {
admitSource: '<string>',
dischargeDisposition: '<string>',
reAdmission: '<string>',
dietPreference: ['<string>'],
specialArrangement: ['<string>'],
destination: '<string>',
origin: '<string>'
}
})
};
fetch('https://api.clinikapi.com/v1/encounters', 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.clinikapi.com/v1/encounters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'class' => '<string>',
'patientId' => '<string>',
'practitionerId' => '<string>',
'participants' => [
[
'practitionerId' => '<string>',
'role' => '<string>'
]
],
'type' => '<string>',
'serviceType' => '<string>',
'priority' => '<string>',
'reasonCode' => '<string>',
'period' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'lengthMinutes' => 123,
'location' => '<string>',
'serviceProvider' => '<string>',
'diagnosis' => [
[
'condition' => '<string>',
'use' => '<string>',
'rank' => 123
]
],
'appointmentId' => '<string>',
'basedOnId' => '<string>',
'partOfId' => '<string>',
'hospitalization' => [
'admitSource' => '<string>',
'dischargeDisposition' => '<string>',
'reAdmission' => '<string>',
'dietPreference' => [
'<string>'
],
'specialArrangement' => [
'<string>'
],
'destination' => '<string>',
'origin' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-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.clinikapi.com/v1/encounters"
payload := strings.NewReader("{\n \"class\": \"<string>\",\n \"patientId\": \"<string>\",\n \"practitionerId\": \"<string>\",\n \"participants\": [\n {\n \"practitionerId\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"serviceType\": \"<string>\",\n \"priority\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"period\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"lengthMinutes\": 123,\n \"location\": \"<string>\",\n \"serviceProvider\": \"<string>\",\n \"diagnosis\": [\n {\n \"condition\": \"<string>\",\n \"use\": \"<string>\",\n \"rank\": 123\n }\n ],\n \"appointmentId\": \"<string>\",\n \"basedOnId\": \"<string>\",\n \"partOfId\": \"<string>\",\n \"hospitalization\": {\n \"admitSource\": \"<string>\",\n \"dischargeDisposition\": \"<string>\",\n \"reAdmission\": \"<string>\",\n \"dietPreference\": [\n \"<string>\"\n ],\n \"specialArrangement\": [\n \"<string>\"\n ],\n \"destination\": \"<string>\",\n \"origin\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.clinikapi.com/v1/encounters")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"class\": \"<string>\",\n \"patientId\": \"<string>\",\n \"practitionerId\": \"<string>\",\n \"participants\": [\n {\n \"practitionerId\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"serviceType\": \"<string>\",\n \"priority\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"period\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"lengthMinutes\": 123,\n \"location\": \"<string>\",\n \"serviceProvider\": \"<string>\",\n \"diagnosis\": [\n {\n \"condition\": \"<string>\",\n \"use\": \"<string>\",\n \"rank\": 123\n }\n ],\n \"appointmentId\": \"<string>\",\n \"basedOnId\": \"<string>\",\n \"partOfId\": \"<string>\",\n \"hospitalization\": {\n \"admitSource\": \"<string>\",\n \"dischargeDisposition\": \"<string>\",\n \"reAdmission\": \"<string>\",\n \"dietPreference\": [\n \"<string>\"\n ],\n \"specialArrangement\": [\n \"<string>\"\n ],\n \"destination\": \"<string>\",\n \"origin\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/encounters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"class\": \"<string>\",\n \"patientId\": \"<string>\",\n \"practitionerId\": \"<string>\",\n \"participants\": [\n {\n \"practitionerId\": \"<string>\",\n \"role\": \"<string>\"\n }\n ],\n \"type\": \"<string>\",\n \"serviceType\": \"<string>\",\n \"priority\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"period\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"lengthMinutes\": 123,\n \"location\": \"<string>\",\n \"serviceProvider\": \"<string>\",\n \"diagnosis\": [\n {\n \"condition\": \"<string>\",\n \"use\": \"<string>\",\n \"rank\": 123\n }\n ],\n \"appointmentId\": \"<string>\",\n \"basedOnId\": \"<string>\",\n \"partOfId\": \"<string>\",\n \"hospitalization\": {\n \"admitSource\": \"<string>\",\n \"dischargeDisposition\": \"<string>\",\n \"reAdmission\": \"<string>\",\n \"dietPreference\": [\n \"<string>\"\n ],\n \"specialArrangement\": [\n \"<string>\"\n ],\n \"destination\": \"<string>\",\n \"origin\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": "<string>",
"message": "<string>",
"code": "<string>",
"requestId": "<string>",
"issues": [
{
"severity": "<string>",
"code": "<string>",
"diagnostics": "<string>"
}
]
}Authorizations
Your ClinikAPI secret key (clk_live_* or clk_test_*)
Body
application/json
Available options:
planned, arrived, triaged, in-progress, onleave, finished, cancelled AMB (ambulatory), IMP (inpatient), EMER (emergency), HH (home health), VR (virtual)
Primary practitioner reference
Additional participants (nurses, specialists)
Show child attributes
Show child attributes
Maximum string length:
200Maximum string length:
200Maximum string length:
50Maximum string length:
500Show child attributes
Show child attributes
Required range:
x <= 10080Maximum string length:
200Maximum string length:
200Maximum array length:
20Show child attributes
Show child attributes
Appointment that scheduled this encounter
ServiceRequest that initiated this encounter
Parent encounter ID (for sub-encounters)
Inpatient admission/discharge details
Show child attributes
Show child attributes
Response
Encounter created
⌘I