curl --request POST \
--url https://api.eka.care/admin/datasets/v1/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"medication_id": "<string>",
"name": "<string>",
"aliases": [
"<string>"
],
"display_name": "<string>",
"strength": "<string>",
"generic_name": "<string>",
"generic_id": "<string>",
"generic_list": [
"<string>"
],
"generic_list_ids": [
"<string>"
],
"form_name": "<string>",
"sku": "<string>",
"schedule_code": "<string>",
"custom_type": "<string>",
"therapy_class": "<string>",
"therapy_class_id": "<string>",
"action_class": "<string>",
"action_class_id": "<string>",
"manufacturer": "<string>",
"otc": true,
"is_active": true
}
]
'import requests
url = "https://api.eka.care/admin/datasets/v1/"
payload = [
{
"medication_id": "<string>",
"name": "<string>",
"aliases": ["<string>"],
"display_name": "<string>",
"strength": "<string>",
"generic_name": "<string>",
"generic_id": "<string>",
"generic_list": ["<string>"],
"generic_list_ids": ["<string>"],
"form_name": "<string>",
"sku": "<string>",
"schedule_code": "<string>",
"custom_type": "<string>",
"therapy_class": "<string>",
"therapy_class_id": "<string>",
"action_class": "<string>",
"action_class_id": "<string>",
"manufacturer": "<string>",
"otc": True,
"is_active": True
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
medication_id: '<string>',
name: '<string>',
aliases: ['<string>'],
display_name: '<string>',
strength: '<string>',
generic_name: '<string>',
generic_id: '<string>',
generic_list: ['<string>'],
generic_list_ids: ['<string>'],
form_name: '<string>',
sku: '<string>',
schedule_code: '<string>',
custom_type: '<string>',
therapy_class: '<string>',
therapy_class_id: '<string>',
action_class: '<string>',
action_class_id: '<string>',
manufacturer: '<string>',
otc: true,
is_active: true
}
])
};
fetch('https://api.eka.care/admin/datasets/v1/', 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.eka.care/admin/datasets/v1/",
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([
[
'medication_id' => '<string>',
'name' => '<string>',
'aliases' => [
'<string>'
],
'display_name' => '<string>',
'strength' => '<string>',
'generic_name' => '<string>',
'generic_id' => '<string>',
'generic_list' => [
'<string>'
],
'generic_list_ids' => [
'<string>'
],
'form_name' => '<string>',
'sku' => '<string>',
'schedule_code' => '<string>',
'custom_type' => '<string>',
'therapy_class' => '<string>',
'therapy_class_id' => '<string>',
'action_class' => '<string>',
'action_class_id' => '<string>',
'manufacturer' => '<string>',
'otc' => true,
'is_active' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.eka.care/admin/datasets/v1/"
payload := strings.NewReader("[\n {\n \"medication_id\": \"<string>\",\n \"name\": \"<string>\",\n \"aliases\": [\n \"<string>\"\n ],\n \"display_name\": \"<string>\",\n \"strength\": \"<string>\",\n \"generic_name\": \"<string>\",\n \"generic_id\": \"<string>\",\n \"generic_list\": [\n \"<string>\"\n ],\n \"generic_list_ids\": [\n \"<string>\"\n ],\n \"form_name\": \"<string>\",\n \"sku\": \"<string>\",\n \"schedule_code\": \"<string>\",\n \"custom_type\": \"<string>\",\n \"therapy_class\": \"<string>\",\n \"therapy_class_id\": \"<string>\",\n \"action_class\": \"<string>\",\n \"action_class_id\": \"<string>\",\n \"manufacturer\": \"<string>\",\n \"otc\": true,\n \"is_active\": true\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.eka.care/admin/datasets/v1/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"medication_id\": \"<string>\",\n \"name\": \"<string>\",\n \"aliases\": [\n \"<string>\"\n ],\n \"display_name\": \"<string>\",\n \"strength\": \"<string>\",\n \"generic_name\": \"<string>\",\n \"generic_id\": \"<string>\",\n \"generic_list\": [\n \"<string>\"\n ],\n \"generic_list_ids\": [\n \"<string>\"\n ],\n \"form_name\": \"<string>\",\n \"sku\": \"<string>\",\n \"schedule_code\": \"<string>\",\n \"custom_type\": \"<string>\",\n \"therapy_class\": \"<string>\",\n \"therapy_class_id\": \"<string>\",\n \"action_class\": \"<string>\",\n \"action_class_id\": \"<string>\",\n \"manufacturer\": \"<string>\",\n \"otc\": true,\n \"is_active\": true\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/admin/datasets/v1/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"medication_id\": \"<string>\",\n \"name\": \"<string>\",\n \"aliases\": [\n \"<string>\"\n ],\n \"display_name\": \"<string>\",\n \"strength\": \"<string>\",\n \"generic_name\": \"<string>\",\n \"generic_id\": \"<string>\",\n \"generic_list\": [\n \"<string>\"\n ],\n \"generic_list_ids\": [\n \"<string>\"\n ],\n \"form_name\": \"<string>\",\n \"sku\": \"<string>\",\n \"schedule_code\": \"<string>\",\n \"custom_type\": \"<string>\",\n \"therapy_class\": \"<string>\",\n \"therapy_class_id\": \"<string>\",\n \"action_class\": \"<string>\",\n \"action_class_id\": \"<string>\",\n \"manufacturer\": \"<string>\",\n \"otc\": true,\n \"is_active\": true\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "2 medication upserted",
"data": {
"upserted": 2,
"inserted": 1,
"updated": 1,
"reactivated": 0,
"deactivated": 0,
"dry_run": false
}
}Create or update records
Writes records to the catalog. Send either a JSON list of records (Content-Type: application/json) or a CSV file (multipart/form-data, field file, headers as in the CSV template).
Writes are all-or-nothing: if any record or row fails validation, nothing in the request is written and errors lists every problem.
Modes
upsert(default): records in the request are inserted, or merged into the existing record with the same id. Records not in the request are left alone.reconcile: the request is treated as your complete catalog. Records in it are inserted or updated, and every active record not in it is deactivated (never hard-deleted, so it can be restored by sending it again). If a reconcile would deactivate more than half of a non-empty catalog, it is rejected with ashrink_guarderror unless you passconfirm_shrink=true. An empty list or a CSV with no data rows is always rejected in this mode.
Use dry_run=true to validate and get the counts without writing anything.
overwrite=true (CSV only) hard-deletes the whole catalog and replaces it with the file, in one transaction. It cannot be combined with mode=reconcile; prefer reconcile, which can be undone.
curl --request POST \
--url https://api.eka.care/admin/datasets/v1/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"medication_id": "<string>",
"name": "<string>",
"aliases": [
"<string>"
],
"display_name": "<string>",
"strength": "<string>",
"generic_name": "<string>",
"generic_id": "<string>",
"generic_list": [
"<string>"
],
"generic_list_ids": [
"<string>"
],
"form_name": "<string>",
"sku": "<string>",
"schedule_code": "<string>",
"custom_type": "<string>",
"therapy_class": "<string>",
"therapy_class_id": "<string>",
"action_class": "<string>",
"action_class_id": "<string>",
"manufacturer": "<string>",
"otc": true,
"is_active": true
}
]
'import requests
url = "https://api.eka.care/admin/datasets/v1/"
payload = [
{
"medication_id": "<string>",
"name": "<string>",
"aliases": ["<string>"],
"display_name": "<string>",
"strength": "<string>",
"generic_name": "<string>",
"generic_id": "<string>",
"generic_list": ["<string>"],
"generic_list_ids": ["<string>"],
"form_name": "<string>",
"sku": "<string>",
"schedule_code": "<string>",
"custom_type": "<string>",
"therapy_class": "<string>",
"therapy_class_id": "<string>",
"action_class": "<string>",
"action_class_id": "<string>",
"manufacturer": "<string>",
"otc": True,
"is_active": True
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
medication_id: '<string>',
name: '<string>',
aliases: ['<string>'],
display_name: '<string>',
strength: '<string>',
generic_name: '<string>',
generic_id: '<string>',
generic_list: ['<string>'],
generic_list_ids: ['<string>'],
form_name: '<string>',
sku: '<string>',
schedule_code: '<string>',
custom_type: '<string>',
therapy_class: '<string>',
therapy_class_id: '<string>',
action_class: '<string>',
action_class_id: '<string>',
manufacturer: '<string>',
otc: true,
is_active: true
}
])
};
fetch('https://api.eka.care/admin/datasets/v1/', 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.eka.care/admin/datasets/v1/",
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([
[
'medication_id' => '<string>',
'name' => '<string>',
'aliases' => [
'<string>'
],
'display_name' => '<string>',
'strength' => '<string>',
'generic_name' => '<string>',
'generic_id' => '<string>',
'generic_list' => [
'<string>'
],
'generic_list_ids' => [
'<string>'
],
'form_name' => '<string>',
'sku' => '<string>',
'schedule_code' => '<string>',
'custom_type' => '<string>',
'therapy_class' => '<string>',
'therapy_class_id' => '<string>',
'action_class' => '<string>',
'action_class_id' => '<string>',
'manufacturer' => '<string>',
'otc' => true,
'is_active' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.eka.care/admin/datasets/v1/"
payload := strings.NewReader("[\n {\n \"medication_id\": \"<string>\",\n \"name\": \"<string>\",\n \"aliases\": [\n \"<string>\"\n ],\n \"display_name\": \"<string>\",\n \"strength\": \"<string>\",\n \"generic_name\": \"<string>\",\n \"generic_id\": \"<string>\",\n \"generic_list\": [\n \"<string>\"\n ],\n \"generic_list_ids\": [\n \"<string>\"\n ],\n \"form_name\": \"<string>\",\n \"sku\": \"<string>\",\n \"schedule_code\": \"<string>\",\n \"custom_type\": \"<string>\",\n \"therapy_class\": \"<string>\",\n \"therapy_class_id\": \"<string>\",\n \"action_class\": \"<string>\",\n \"action_class_id\": \"<string>\",\n \"manufacturer\": \"<string>\",\n \"otc\": true,\n \"is_active\": true\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.eka.care/admin/datasets/v1/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"medication_id\": \"<string>\",\n \"name\": \"<string>\",\n \"aliases\": [\n \"<string>\"\n ],\n \"display_name\": \"<string>\",\n \"strength\": \"<string>\",\n \"generic_name\": \"<string>\",\n \"generic_id\": \"<string>\",\n \"generic_list\": [\n \"<string>\"\n ],\n \"generic_list_ids\": [\n \"<string>\"\n ],\n \"form_name\": \"<string>\",\n \"sku\": \"<string>\",\n \"schedule_code\": \"<string>\",\n \"custom_type\": \"<string>\",\n \"therapy_class\": \"<string>\",\n \"therapy_class_id\": \"<string>\",\n \"action_class\": \"<string>\",\n \"action_class_id\": \"<string>\",\n \"manufacturer\": \"<string>\",\n \"otc\": true,\n \"is_active\": true\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/admin/datasets/v1/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"medication_id\": \"<string>\",\n \"name\": \"<string>\",\n \"aliases\": [\n \"<string>\"\n ],\n \"display_name\": \"<string>\",\n \"strength\": \"<string>\",\n \"generic_name\": \"<string>\",\n \"generic_id\": \"<string>\",\n \"generic_list\": [\n \"<string>\"\n ],\n \"generic_list_ids\": [\n \"<string>\"\n ],\n \"form_name\": \"<string>\",\n \"sku\": \"<string>\",\n \"schedule_code\": \"<string>\",\n \"custom_type\": \"<string>\",\n \"therapy_class\": \"<string>\",\n \"therapy_class_id\": \"<string>\",\n \"action_class\": \"<string>\",\n \"action_class_id\": \"<string>\",\n \"manufacturer\": \"<string>\",\n \"otc\": true,\n \"is_active\": true\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "2 medication upserted",
"data": {
"upserted": 2,
"inserted": 1,
"updated": 1,
"reactivated": 0,
"deactivated": 0,
"dry_run": false
}
}Authorizations
Access token for your workspace.
Query Parameters
Which catalog to act on.
medication, lab_test, symptom, diagnosis upsert leaves records not in the request alone; reconcile deactivates them.
upsert, reconcile Validate and count without writing.
Allow a reconcile that deactivates more than half of the catalog.
CSV only. Replace the whole catalog with the file. Not allowed with mode=reconcile.
Body
1- Medication
- LabTest
- Symptom
- Diagnosis
Your id for the drug.
200200Alternate names and short forms, used by search.
200Shown to end users. Defaults to name.
2003230064All generic (salt) components.
10064Dosage form. Matched case-insensitively against the accepted drug forms; a match links the drug to Eka's form, and any other value is stored as text without that link.
646432641286412864200Defaults to true on write.
Was this page helpful?

