Skip to main content
POST
/
sources
/
{sourceKey}
/
v1
/
bundle
Bundle resource and relationship operations to be processed
curl --request POST \
  --url https://{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/bundle \
  --header 'Content-Type: application/json' \
  --header 'X-Clinia-API-Key: <api-key>' \
  --data '{
  "resourceOperations": [
    {
      "action": "CREATE",
      "create": {
        "id": "<string>",
        "type": "<string>",
        "meta": {
          "createdAt": "2023-11-07T05:31:56Z",
          "identifier": [
            "<any>"
          ],
          "updatedAt": "2023-11-07T05:31:56Z"
        },
        "data": {},
        "contained": {}
      }
    }
  ],
  "relationshipOperations": [
    {
      "action": "CREATE",
      "create": {
        "type": "<string>",
        "from": {
          "id": "<string>",
          "type": "<string>"
        },
        "to": {
          "id": "<string>",
          "type": "<string>"
        },
        "meta": {
          "createdAt": "2023-11-07T05:31:56Z",
          "identifier": [
            "<any>"
          ],
          "updatedAt": "2023-11-07T05:31:56Z"
        },
        "data": {}
      }
    }
  ]
}'
{
  "taskId": "<string>",
  "status": "ACCEPTED"
}

Authorizations

X-Clinia-API-Key
string
header
required

Path Parameters

sourceKey
string
required

The source key.

Body

application/json

The request body should contain a list of resources and relationships operations.

Contains a list of resource and relationship operations to be processed atomically by the system. Note:

  • Multiple unique @rootId token could be defined by suffixing the token with a number. For example, @rootId1, @rootId2, etc...
  • @rootId token could be used in any properties of type reference to refer to a created resources in the same bundle.
  • @rootId token could be used in the from and to fields of the relationship operations to refer to created resources in the same bundle.
resourceOperations
object[]
required

List of resource operations for the bundle.

  • Option 1
  • Option 2
  • Option 3
relationshipOperations
object[]
required

List of relationships operations for the bundle.

  • Option 1
  • Option 2
  • Option 3

Response

The bundle operation is valid and returns the list of persisted operations with a status 'PERSISTED'.

  • Option 1
  • Option 2

Response when a task has been accepted for asynchronous processing. The task will be executed in the background.

taskId
string
required

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
enum<string>
required

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
I