Create a relationship between two resources in the registry
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType} \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"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"
}
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}"
payload = {
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"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"
}
}
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({
from: {id: '<string>', type: '<string>'},
to: {id: '<string>', type: '<string>'},
data: {},
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'
}
})
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}', 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/relationships/{relationshipType}",
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([
'from' => [
'id' => '<string>',
'type' => '<string>'
],
'to' => [
'id' => '<string>',
'type' => '<string>'
],
'data' => [
],
'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'
]
]),
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/relationships/{relationshipType}"
payload := strings.NewReader("{\n \"from\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"data\": {},\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}")
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/relationships/{relationshipType}")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"data\": {},\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}")
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 \"from\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"data\": {},\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}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"relationship": {
"id": "<string>",
"type": "<string>",
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"source": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"taskId": "<string>",
"relationship": {
"id": "<string>",
"type": "<string>",
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"source": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Relationships
Create a relationship between two resources in the registry
Create a relationship between two resources in the registry.
POST
/
sources
/
{sourceKey}
/
v1
/
relationships
/
{relationshipType}
Create a relationship between two resources in the registry
curl --request POST \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType} \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
{
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"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"
}
}
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}"
payload = {
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"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"
}
}
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({
from: {id: '<string>', type: '<string>'},
to: {id: '<string>', type: '<string>'},
data: {},
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'
}
})
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}', 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/relationships/{relationshipType}",
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([
'from' => [
'id' => '<string>',
'type' => '<string>'
],
'to' => [
'id' => '<string>',
'type' => '<string>'
],
'data' => [
],
'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'
]
]),
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/relationships/{relationshipType}"
payload := strings.NewReader("{\n \"from\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"data\": {},\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}")
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/relationships/{relationshipType}")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"from\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"data\": {},\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}")
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 \"from\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"to\": {\n \"id\": \"<string>\",\n \"type\": \"<string>\"\n },\n \"data\": {},\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}"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"relationship": {
"id": "<string>",
"type": "<string>",
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"source": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"taskId": "<string>",
"relationship": {
"id": "<string>",
"type": "<string>",
"from": {
"id": "<string>",
"type": "<string>"
},
"to": {
"id": "<string>",
"type": "<string>"
},
"data": {},
"meta": {
"createdAt": "2023-11-07T05:31:56Z",
"identifier": [
{
"id": "<string>",
"system": "<string>",
"value": "<string>",
"use": "<string>",
"period": {
"id": "<string>",
"start": "<string>",
"end": "<string>"
}
}
],
"source": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}{
"message": "<string>",
"details": "<array>",
"additionalContext": {}
}Authorizations
apiKeybasicHttpAuthbearerHttpAuth
Path Parameters
The key of the source.
Key of the relationship definition.
Body
application/json
Response
Returned when the relationship was created successfully with a status 'PERSISTED'.
- Option 1
- Option 2
Response when a task has been executed synchronously and the results are immediately persisted.
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.
Available options:
ACCEPTED, PERSISTED Show child attributes
Show child attributes
Was this page helpful?
⌘I