Update a relationship between two resources in the registry
curl --request PATCH \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id} \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
[
{
"op": "replace",
"path": "/name",
"value": "New Clinic"
}
]
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}"
payload = [
{
"op": "replace",
"path": "/name",
"value": "New Clinic"
}
]
headers = {
"X-Clinia-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{op: 'replace', path: '/name', value: 'New Clinic'}])
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}', 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}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'op' => 'replace',
'path' => '/name',
'value' => 'New Clinic'
]
]),
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}/{id}"
payload := strings.NewReader("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"New Clinic\"\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"New Clinic\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"New Clinic\"\n }\n]"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"status": "ACCEPTED",
"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>",
"status": "ACCEPTED",
"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"
}
}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {},
"applicationErrorCode": "REGISTRY_DUPLICATE_IDENTIFIER"
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}Relationships
Update a relationship between two resources in the registry
Update a relationship between two resources in the registry.
The from and to fields in the body are ignored in favor of respecting the id path argument.
PATCH
/
sources
/
{sourceKey}
/
v1
/
relationships
/
{relationshipType}
/
{id}
Update a relationship between two resources in the registry
curl --request PATCH \
--url https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id} \
--header 'Content-Type: application/json' \
--header 'X-Clinia-API-Key: <api-key>' \
--data '
[
{
"op": "replace",
"path": "/name",
"value": "New Clinic"
}
]
'import requests
url = "https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}"
payload = [
{
"op": "replace",
"path": "/name",
"value": "New Clinic"
}
]
headers = {
"X-Clinia-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Clinia-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{op: 'replace', path: '/name', value: 'New Clinic'}])
};
fetch('https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}', 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}/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'op' => 'replace',
'path' => '/name',
'value' => 'New Clinic'
]
]),
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}/{id}"
payload := strings.NewReader("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"New Clinic\"\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}")
.header("X-Clinia-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"New Clinic\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/relationships/{relationshipType}/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Clinia-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"op\": \"replace\",\n \"path\": \"/name\",\n \"value\": \"New Clinic\"\n }\n]"
response = http.request(request)
puts response.read_body{
"taskId": "<string>",
"status": "ACCEPTED",
"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>",
"status": "ACCEPTED",
"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"
}
}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {},
"applicationErrorCode": "REGISTRY_DUPLICATE_IDENTIFIER"
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}{
"code": 400,
"message": "<string>",
"type": "ALREADY_EXISTS",
"details": "<array>",
"additionalContext": {}
}Authorizations
apiKeybasicHttpAuthbearerHttpAuth
Path Parameters
The key of the source.
The key of the relationship definition.
The id of the relationship.
The unique identifier of the relationship.
This is a key with the shape {fromID}.{toID}.
Pattern:
^[^.]+.[^.]+$Body
application/json
Response
The relationship was updated 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?