Clinia
RegistryBundle

Bundle resource and relationship operations to be processed

POST
/sources/{sourceKey}/v1/bundle

Send a bundle of operations, including resource and relationship operations, to be processed atomically by the system.

Notes:

  • Order of Processing: Resource operations are executed first, followed by relationship operations.
  • Atomicity: The system processes the entire bundle as a single atomic transaction.
    • If all operations succeed, the changes are committed.
    • If any operation fails, all operations are rolled back, ensuring no partial changes.
headerX-Clinia-API-Key<token>
sourceKey*string

The source key.

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

application/json
  1. body

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*array<||>

List of resource operations for the bundle.

relationshipOperations*array<||>

List of relationships operations for the bundle.

Response Body

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

application/json
  1. response

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

taskId*v1TaskId

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*v1TaskSubmissionStatus

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.
Value in"ACCEPTED""PERSISTED"
Example Request
curl -X POST 'https://api..clinia.cloud/sources/string/v1/bundle' \  -H 'Content-Type: application/json' \  -d '{  "resourceOperations": [    {      "action": "CREATE",      "create": {        "type": "string",        "data": {}      }    }  ],  "relationshipOperations": [    {      "action": "CREATE",      "create": {        "type": "string",        "from": {          "id": "string",          "type": "string"        },        "to": {          "id": "string",          "type": "string"        },        "data": {}      }    }  ]}'
Example Response
{  "taskId": "string",  "status": "ACCEPTED"}