Create task
curl --request POST \
--url https://api.clinikapi.com/v1/tasks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"statusReason": "<string>",
"businessStatus": "<string>",
"code": "<string>",
"description": "<string>",
"focusId": "<string>",
"patientId": "<string>",
"encounterId": "<string>",
"executionPeriod": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"authoredOn": "2023-11-07T05:31:56Z",
"requesterId": "<string>",
"ownerId": "<string>",
"reasonCode": "<string>",
"note": "<string>",
"basedOn": [
"<string>"
],
"partOf": [
"<string>"
],
"input": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": true,
"valueInteger": 123
}
],
"output": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": true,
"valueInteger": 123
}
],
"restriction": {
"repetitions": 123,
"period": {
"start": "<string>",
"end": "<string>"
},
"recipientIds": [
"<string>"
]
}
}
'import requests
url = "https://api.clinikapi.com/v1/tasks"
payload = {
"statusReason": "<string>",
"businessStatus": "<string>",
"code": "<string>",
"description": "<string>",
"focusId": "<string>",
"patientId": "<string>",
"encounterId": "<string>",
"executionPeriod": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"authoredOn": "2023-11-07T05:31:56Z",
"requesterId": "<string>",
"ownerId": "<string>",
"reasonCode": "<string>",
"note": "<string>",
"basedOn": ["<string>"],
"partOf": ["<string>"],
"input": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": True,
"valueInteger": 123
}
],
"output": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": True,
"valueInteger": 123
}
],
"restriction": {
"repetitions": 123,
"period": {
"start": "<string>",
"end": "<string>"
},
"recipientIds": ["<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({
statusReason: '<string>',
businessStatus: '<string>',
code: '<string>',
description: '<string>',
focusId: '<string>',
patientId: '<string>',
encounterId: '<string>',
executionPeriod: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
authoredOn: '2023-11-07T05:31:56Z',
requesterId: '<string>',
ownerId: '<string>',
reasonCode: '<string>',
note: '<string>',
basedOn: ['<string>'],
partOf: ['<string>'],
input: [
{
type: '<string>',
valueString: '<string>',
valueBoolean: true,
valueInteger: 123
}
],
output: [
{
type: '<string>',
valueString: '<string>',
valueBoolean: true,
valueInteger: 123
}
],
restriction: {
repetitions: 123,
period: {start: '<string>', end: '<string>'},
recipientIds: ['<string>']
}
})
};
fetch('https://api.clinikapi.com/v1/tasks', 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/tasks",
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([
'statusReason' => '<string>',
'businessStatus' => '<string>',
'code' => '<string>',
'description' => '<string>',
'focusId' => '<string>',
'patientId' => '<string>',
'encounterId' => '<string>',
'executionPeriod' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'authoredOn' => '2023-11-07T05:31:56Z',
'requesterId' => '<string>',
'ownerId' => '<string>',
'reasonCode' => '<string>',
'note' => '<string>',
'basedOn' => [
'<string>'
],
'partOf' => [
'<string>'
],
'input' => [
[
'type' => '<string>',
'valueString' => '<string>',
'valueBoolean' => true,
'valueInteger' => 123
]
],
'output' => [
[
'type' => '<string>',
'valueString' => '<string>',
'valueBoolean' => true,
'valueInteger' => 123
]
],
'restriction' => [
'repetitions' => 123,
'period' => [
'start' => '<string>',
'end' => '<string>'
],
'recipientIds' => [
'<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/tasks"
payload := strings.NewReader("{\n \"statusReason\": \"<string>\",\n \"businessStatus\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"focusId\": \"<string>\",\n \"patientId\": \"<string>\",\n \"encounterId\": \"<string>\",\n \"executionPeriod\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"authoredOn\": \"2023-11-07T05:31:56Z\",\n \"requesterId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"note\": \"<string>\",\n \"basedOn\": [\n \"<string>\"\n ],\n \"partOf\": [\n \"<string>\"\n ],\n \"input\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"output\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"restriction\": {\n \"repetitions\": 123,\n \"period\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"recipientIds\": [\n \"<string>\"\n ]\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/tasks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"statusReason\": \"<string>\",\n \"businessStatus\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"focusId\": \"<string>\",\n \"patientId\": \"<string>\",\n \"encounterId\": \"<string>\",\n \"executionPeriod\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"authoredOn\": \"2023-11-07T05:31:56Z\",\n \"requesterId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"note\": \"<string>\",\n \"basedOn\": [\n \"<string>\"\n ],\n \"partOf\": [\n \"<string>\"\n ],\n \"input\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"output\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"restriction\": {\n \"repetitions\": 123,\n \"period\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"recipientIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/tasks")
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 \"statusReason\": \"<string>\",\n \"businessStatus\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"focusId\": \"<string>\",\n \"patientId\": \"<string>\",\n \"encounterId\": \"<string>\",\n \"executionPeriod\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"authoredOn\": \"2023-11-07T05:31:56Z\",\n \"requesterId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"note\": \"<string>\",\n \"basedOn\": [\n \"<string>\"\n ],\n \"partOf\": [\n \"<string>\"\n ],\n \"input\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"output\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"restriction\": {\n \"repetitions\": 123,\n \"period\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"recipientIds\": [\n \"<string>\"\n ]\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>"
}
]
}Tasks
Create Task
POST
/
v1
/
tasks
Create task
curl --request POST \
--url https://api.clinikapi.com/v1/tasks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"statusReason": "<string>",
"businessStatus": "<string>",
"code": "<string>",
"description": "<string>",
"focusId": "<string>",
"patientId": "<string>",
"encounterId": "<string>",
"executionPeriod": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"authoredOn": "2023-11-07T05:31:56Z",
"requesterId": "<string>",
"ownerId": "<string>",
"reasonCode": "<string>",
"note": "<string>",
"basedOn": [
"<string>"
],
"partOf": [
"<string>"
],
"input": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": true,
"valueInteger": 123
}
],
"output": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": true,
"valueInteger": 123
}
],
"restriction": {
"repetitions": 123,
"period": {
"start": "<string>",
"end": "<string>"
},
"recipientIds": [
"<string>"
]
}
}
'import requests
url = "https://api.clinikapi.com/v1/tasks"
payload = {
"statusReason": "<string>",
"businessStatus": "<string>",
"code": "<string>",
"description": "<string>",
"focusId": "<string>",
"patientId": "<string>",
"encounterId": "<string>",
"executionPeriod": {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z"
},
"authoredOn": "2023-11-07T05:31:56Z",
"requesterId": "<string>",
"ownerId": "<string>",
"reasonCode": "<string>",
"note": "<string>",
"basedOn": ["<string>"],
"partOf": ["<string>"],
"input": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": True,
"valueInteger": 123
}
],
"output": [
{
"type": "<string>",
"valueString": "<string>",
"valueBoolean": True,
"valueInteger": 123
}
],
"restriction": {
"repetitions": 123,
"period": {
"start": "<string>",
"end": "<string>"
},
"recipientIds": ["<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({
statusReason: '<string>',
businessStatus: '<string>',
code: '<string>',
description: '<string>',
focusId: '<string>',
patientId: '<string>',
encounterId: '<string>',
executionPeriod: {start: '2023-11-07T05:31:56Z', end: '2023-11-07T05:31:56Z'},
authoredOn: '2023-11-07T05:31:56Z',
requesterId: '<string>',
ownerId: '<string>',
reasonCode: '<string>',
note: '<string>',
basedOn: ['<string>'],
partOf: ['<string>'],
input: [
{
type: '<string>',
valueString: '<string>',
valueBoolean: true,
valueInteger: 123
}
],
output: [
{
type: '<string>',
valueString: '<string>',
valueBoolean: true,
valueInteger: 123
}
],
restriction: {
repetitions: 123,
period: {start: '<string>', end: '<string>'},
recipientIds: ['<string>']
}
})
};
fetch('https://api.clinikapi.com/v1/tasks', 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/tasks",
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([
'statusReason' => '<string>',
'businessStatus' => '<string>',
'code' => '<string>',
'description' => '<string>',
'focusId' => '<string>',
'patientId' => '<string>',
'encounterId' => '<string>',
'executionPeriod' => [
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z'
],
'authoredOn' => '2023-11-07T05:31:56Z',
'requesterId' => '<string>',
'ownerId' => '<string>',
'reasonCode' => '<string>',
'note' => '<string>',
'basedOn' => [
'<string>'
],
'partOf' => [
'<string>'
],
'input' => [
[
'type' => '<string>',
'valueString' => '<string>',
'valueBoolean' => true,
'valueInteger' => 123
]
],
'output' => [
[
'type' => '<string>',
'valueString' => '<string>',
'valueBoolean' => true,
'valueInteger' => 123
]
],
'restriction' => [
'repetitions' => 123,
'period' => [
'start' => '<string>',
'end' => '<string>'
],
'recipientIds' => [
'<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/tasks"
payload := strings.NewReader("{\n \"statusReason\": \"<string>\",\n \"businessStatus\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"focusId\": \"<string>\",\n \"patientId\": \"<string>\",\n \"encounterId\": \"<string>\",\n \"executionPeriod\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"authoredOn\": \"2023-11-07T05:31:56Z\",\n \"requesterId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"note\": \"<string>\",\n \"basedOn\": [\n \"<string>\"\n ],\n \"partOf\": [\n \"<string>\"\n ],\n \"input\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"output\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"restriction\": {\n \"repetitions\": 123,\n \"period\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"recipientIds\": [\n \"<string>\"\n ]\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/tasks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"statusReason\": \"<string>\",\n \"businessStatus\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"focusId\": \"<string>\",\n \"patientId\": \"<string>\",\n \"encounterId\": \"<string>\",\n \"executionPeriod\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"authoredOn\": \"2023-11-07T05:31:56Z\",\n \"requesterId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"note\": \"<string>\",\n \"basedOn\": [\n \"<string>\"\n ],\n \"partOf\": [\n \"<string>\"\n ],\n \"input\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"output\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"restriction\": {\n \"repetitions\": 123,\n \"period\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"recipientIds\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/tasks")
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 \"statusReason\": \"<string>\",\n \"businessStatus\": \"<string>\",\n \"code\": \"<string>\",\n \"description\": \"<string>\",\n \"focusId\": \"<string>\",\n \"patientId\": \"<string>\",\n \"encounterId\": \"<string>\",\n \"executionPeriod\": {\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\"\n },\n \"authoredOn\": \"2023-11-07T05:31:56Z\",\n \"requesterId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"reasonCode\": \"<string>\",\n \"note\": \"<string>\",\n \"basedOn\": [\n \"<string>\"\n ],\n \"partOf\": [\n \"<string>\"\n ],\n \"input\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"output\": [\n {\n \"type\": \"<string>\",\n \"valueString\": \"<string>\",\n \"valueBoolean\": true,\n \"valueInteger\": 123\n }\n ],\n \"restriction\": {\n \"repetitions\": 123,\n \"period\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"recipientIds\": [\n \"<string>\"\n ]\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:
draft, requested, received, accepted, rejected, ready, cancelled, in-progress, on-hold, failed, completed Available options:
unknown, proposal, plan, order, original-order, reflex-order, filler-order, instance-order, option Maximum string length:
500Business-specific status (e.g. Specimen collected)
Maximum string length:
200Available options:
routine, urgent, asap, stat Task type code
Maximum string length:
200Maximum string length:
2000What the task is acting on
Beneficiary of the task
Show child attributes
Show child attributes
Maximum string length:
500Maximum string length:
2000Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Task created
⌘I