Skip to main content
POST
/
sources
/
{sourceKey}
/
v1
/
resources
/
bulk
Bulk create, upsert, or delete resources
curl --request POST \
  --url https://{workspaceId}.clinia.cloud/sources/{sourceKey}/v1/resources/bulk \
  --header 'Content-Type: application/json' \
  --header 'X-Clinia-API-Key: <api-key>' \
  --data '{
  "operations": [
    {
      "action": "CREATE",
      "create": {
        "id": "<string>",
        "type": "<string>",
        "meta": {
          "createdAt": "2023-11-07T05:31:56Z",
          "identifier": [
            "<any>"
          ],
          "updatedAt": "2023-11-07T05:31:56Z"
        },
        "data": {},
        "contained": {}
      }
    }
  ]
}'
{
  "taskId": "<string>",
  "status": "ACCEPTED",
  "bulkId": "<string>"
}

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 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.

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

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.

bulkId
string
required

The task identifier. This is deprecated, please use the taskId field instead.

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