curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"operations": [
{
"create": {
"type": "<string>",
"data": {},
"id": "<string>",
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"contained": {}
}
}
]
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk"
payload = { "operations": [{ "create": {
"type": "<string>",
"data": {},
"id": "<string>",
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"contained": {}
} }] }
headers = {
"X-Clinia-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-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
create: {
type: '<string>',
data: {},
id: '<string>',
meta: {
createdAt: '2023-11-07T05:31:56Z',
identifier: [
{
id: '<string>',
system: '<string>',
value: '<string>',
use: '<string>',
period: {id: '<string>', start: '<string>', end: '<string>'}
}
],
updatedAt: '2023-11-07T05:31:56Z'
},
contained: {}
}
}
]
})
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk', 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.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk",
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([
'operations' => [
[
'create' => [
'type' => '<string>',
'data' => [
],
'id' => '<string>',
'meta' => [
'createdAt' => '2023-11-07T05:31:56Z',
'identifier' => [
[
'id' => '<string>',
'system' => '<string>',
'value' => '<string>',
'use' => '<string>',
'period' => [
'id' => '<string>',
'start' => '<string>',
'end' => '<string>'
]
]
],
'updatedAt' => '2023-11-07T05:31:56Z'
],
'contained' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clinia-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.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"create\": {\n \"type\": \"<string>\",\n \"data\": {},\n \"id\": \"<string>\",\n \"meta\": {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"identifier\": [\n {\n \"id\": \"<string>\",\n \"system\": \"<string>\",\n \"value\": \"<string>\",\n \"use\": \"<string>\",\n \"period\": {\n \"id\": \"<string>\",\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n }\n ],\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"contained\": {}\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clinia-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.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"create\": {\n \"type\": \"<string>\",\n \"data\": {},\n \"id\": \"<string>\",\n \"meta\": {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"identifier\": [\n {\n \"id\": \"<string>\",\n \"system\": \"<string>\",\n \"value\": \"<string>\",\n \"use\": \"<string>\",\n \"period\": {\n \"id\": \"<string>\",\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n }\n ],\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"contained\": {}\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"create\": {\n \"type\": \"<string>\",\n \"data\": {},\n \"id\": \"<string>\",\n \"meta\": {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"identifier\": [\n {\n \"id\": \"<string>\",\n \"system\": \"<string>\",\n \"value\": \"<string>\",\n \"use\": \"<string>\",\n \"period\": {\n \"id\": \"<string>\",\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n }\n ],\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"contained\": {}\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>"
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Bulk create, upsert, or delete resources
Bulk create, upsert, or delete resources. The request body should contain a list of operations. All operations will be processed even if some of them fail.
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"operations": [
{
"create": {
"type": "<string>",
"data": {},
"id": "<string>",
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"contained": {}
}
}
]
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk"
payload = { "operations": [{ "create": {
"type": "<string>",
"data": {},
"id": "<string>",
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"updatedAt": "2023-11-07T05:31:56Z"
},
"contained": {}
} }] }
headers = {
"X-Clinia-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-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
operations: [
{
create: {
type: '<string>',
data: {},
id: '<string>',
meta: {
createdAt: '2023-11-07T05:31:56Z',
identifier: [
{
id: '<string>',
system: '<string>',
value: '<string>',
use: '<string>',
period: {id: '<string>', start: '<string>', end: '<string>'}
}
],
updatedAt: '2023-11-07T05:31:56Z'
},
contained: {}
}
}
]
})
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk', 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.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk",
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([
'operations' => [
[
'create' => [
'type' => '<string>',
'data' => [
],
'id' => '<string>',
'meta' => [
'createdAt' => '2023-11-07T05:31:56Z',
'identifier' => [
[
'id' => '<string>',
'system' => '<string>',
'value' => '<string>',
'use' => '<string>',
'period' => [
'id' => '<string>',
'start' => '<string>',
'end' => '<string>'
]
]
],
'updatedAt' => '2023-11-07T05:31:56Z'
],
'contained' => [
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clinia-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.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk"
payload := strings.NewReader("{\n \"operations\": [\n {\n \"create\": {\n \"type\": \"<string>\",\n \"data\": {},\n \"id\": \"<string>\",\n \"meta\": {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"identifier\": [\n {\n \"id\": \"<string>\",\n \"system\": \"<string>\",\n \"value\": \"<string>\",\n \"use\": \"<string>\",\n \"period\": {\n \"id\": \"<string>\",\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n }\n ],\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"contained\": {}\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clinia-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.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"operations\": [\n {\n \"create\": {\n \"type\": \"<string>\",\n \"data\": {},\n \"id\": \"<string>\",\n \"meta\": {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"identifier\": [\n {\n \"id\": \"<string>\",\n \"system\": \"<string>\",\n \"value\": \"<string>\",\n \"use\": \"<string>\",\n \"period\": {\n \"id\": \"<string>\",\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n }\n ],\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"contained\": {}\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"operations\": [\n {\n \"create\": {\n \"type\": \"<string>\",\n \"data\": {},\n \"id\": \"<string>\",\n \"meta\": {\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"identifier\": [\n {\n \"id\": \"<string>\",\n \"system\": \"<string>\",\n \"value\": \"<string>\",\n \"use\": \"<string>\",\n \"period\": {\n \"id\": \"<string>\",\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n }\n }\n ],\n \"updatedAt\": \"2023-11-07T05:31:56Z\"\n },\n \"contained\": {}\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>"
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Authorizations
Path Parameters
The source key.
Body
The request body should contain a list of resources to create, upsert, or delete. Operations of different types (e.g., "CREATE", "UPSERT") can be mixed and will be processed in the order they are provided.
- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Response
The bulk operation is valid and accepted with a status 'ACCEPTED'.
Response when a task has been accepted for asynchronous processing. The task will be executed in the background.
The task identifier. Used to track an async task in the system. Use the task ID to poll for completion status. The taskId holds different prefix to represent different tasks.
- oneOf task:
s_<id>. - bulk task:
bk_<id>(deprecated:<id>only). - bundle task:
bd_<id>(deprecated:<id>only). - purge task:
pg_<id>(deprecated:purge:<id>).
Status of the task submission.
ACCEPTED: The task has been accepted for asynchronous processing. The task will be executed in the background.PERSISTED: The task has been executed synchronously and the results are immediately persisted.
ACCEPTED, PERSISTED Was this page helpful?