---
title: "Bundle resource and relationship operations to be processed"
method: POST
path: "/sources/{sourceKey}/v1/bundle"
tags: ["Bundle"]
---

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

## Path parameters

- `sourceKey` string, required

## Request body

- V1Bundle — 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` V1ResourceOperation[], required — List of resource operations for the bundle.
    - union
      - object
        - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
        - `create` V1ResourceOperationCreateContent, required — The resource to create.
          - `id` string — Id of the resource to create (optional). When not provided or equal to the special `@rootId` token, the id will be generated. When provided and not equal to `@rootId` token, id must follow pattern: `^[a-zA-Z0-9-][\w-]{1,92}$`. Note: - The `@rootId` token can be used in any properties of type `reference` and, when provided, will be replaced by the actual id of the created resource.
          - `type` string, required — The type of resource to create.
          - `meta` V1Meta
            - `createdAt` string, date-time — Instant of creation of the resource.
            - `identifier` V1Identifier[] — Identifiers of the resource. Note: Combination of `source`, `value` and `use` must be unique.
              - …
            - `source` string — The source of the resource.
            - `updatedAt` string, date-time — Last update of the resource.
          - `data` object, required — Dynamic data attributes, based on the resource type.
          - `contained` object — Resources contained in this top-level resource. Contained resources exists only within the context of this top-level resource.
      - object
        - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
        - `upsert` V1ResourceOperationUpsertContent, required — The resource to upsert. Note: - The `@rootId` token can be used in any properties of type `reference` and, when provided, will be replaced by the actual id of the resource.
          - `id` string, required — The ID of the resource to upsert.
          - `type` string, required — The type of resource to upsert.
          - `data` object, required — Dynamic data attributes, based on the resource type.
          - `contained` object — Resources contained in this top-level resource. Contained resources exists only within the context of this top-level resource.
          - `meta` V1Meta
            - `createdAt` string, date-time — Instant of creation of the resource.
            - `identifier` V1Identifier[] — Identifiers of the resource. Note: Combination of `source`, `value` and `use` must be unique.
              - …
            - `source` string — The source of the resource.
            - `updatedAt` string, date-time — Last update of the resource.
      - object
        - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
        - `delete` V1ResourceOperationDeleteContent, required
          - `id` string, required — The ID of the resource to delete.
          - `type` string, required — The type of resource to delete.
  - `relationshipOperations` V1RelationshipOperation[], required — List of relationships operations for the bundle.
    - union
      - object
        - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
        - `create` V1RelationshipOperationCreateContent, required — The relationship to create.
          - `type` string, required
          - `from` V1RelationshipRef, required
            - `id` string, required
            - `type` string, required
          - `to` V1RelationshipRef, required
            - `id` string, required
            - `type` string, required
          - `meta` V1Meta
            - `createdAt` string, date-time — Instant of creation of the resource.
            - `identifier` V1Identifier[] — Identifiers of the resource. Note: Combination of `source`, `value` and `use` must be unique.
              - …
            - `source` string — The source of the resource.
            - `updatedAt` string, date-time — Last update of the resource.
          - `data` object
      - object
        - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
        - `upsert` V1RelationshipOperationUpsertContent, required — The relationship to upsert.
          - `type` string, required
          - `from` V1RelationshipRef, required
            - `id` string, required
            - `type` string, required
          - `to` V1RelationshipRef, required
            - `id` string, required
            - `type` string, required
          - `data` object
          - `meta` V1Meta
            - `createdAt` string, date-time — Instant of creation of the resource.
            - `identifier` V1Identifier[] — Identifiers of the resource. Note: Combination of `source`, `value` and `use` must be unique.
              - …
            - `source` string — The source of the resource.
            - `updatedAt` string, date-time — Last update of the resource.
      - object
        - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
        - `delete` V1RelationshipOperationDeleteContent, required
          - `from` V1RelationshipRef, required
            - `id` string, required
            - `type` string, required
          - `to` V1RelationshipRef, required
            - `id` string, required
            - `type` string, required
          - `type` string, required — The type of relationship to delete.

## Response `200`

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

- union
  - V1BundleAcceptedResponse
    - `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` 'ACCEPTED' | 'PERSISTED', 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.
  - V1BundlePersistedResponse — Response when a task has been executed synchronously and the results are immediately persisted.
    - `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` 'ACCEPTED' | 'PERSISTED', 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.
    - `resourceOperationReceipts` V1ResourceOperationReceipt[], required — List of resource operations for the bundle.
      - `receivedAt` string, date-time, required — The time the operation was received.
      - `completedAt` string, date-time — The time the operation was completed (whether successfully or not).
      - `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>`).
      - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
      - `status` 'SUCCESS' | 'PENDING' | 'CANCELLED' | 'FAILURE', required — Status of the operation. * `SUCCESS`: The operation was persisted in the source, or was dropped by a reject action of the user. * `PENDING`: The operation is being processed asyncronously by the system or is in a pipeline IN_REVIEW status. * `CANCELLED`: The operation was cancelled by the system due to a concurrent operation. * `FAILURE`: The operation failed due to validation or processing error.
      - `error` V1Error
        - `code` 400 | 401 | 403 | 404 | 408 | 409 | 413 | 500 | 501, required
        - `message` string, required
        - `type` 'ALREADY_EXISTS' | 'FAILED_PRECONDITION' | 'INTERNAL' | 'INVALID_ARGUMENT' | 'NOT_FOUND' | 'OUT_OF_RANGE' | 'UNIMPLEMENTED' | 'PERMISSION_DENIED' | 'UNAUTHENTICATED' | 'CONTENT_TOO_LARGE' | 'REQUEST_TIMEOUT', required
        - `details` V1Error[] — list of errors that occurred if applicable.
      - `pipelineExecution` V1PipelineExecutionInfo
        - `id` string, required — The id of the pipeline execution.
        - `pipelineDefinitionId` string, required — The id with version in the format `<id>.<version>`.
        - `status` 'SUCCESSFUL' | 'ERROR' | 'IN_PROGRESS' | 'IN_REVIEW' | 'CANCELLED' | 'DROPPED', required — Status of the pipeline execution. * `SUCCESSFUL`: The pipeline execution completed successfully. Every step of the pipeline was executed successfully and the change has been accepted in the system. * `ERROR`: The pipeline execution failed at a step due to a system error. * `IN_PROGRESS`: The pipeline execution is being processed by the system. * `IN_REVIEW`: The pipeline execution is waiting for a manual action. Refer to the ActOnPipelineExecution endpoint. * `CANCELLED`: The pipeline execution has been short-circuited by the system and never completed. * `DROPPED`: The pipeline execution has been dropped because the change has been rejected by the user following review.
      - `targetType` 'RELATIONSHIP' | 'RESOURCE' | 'OBJECT', required
      - `id` string, required — The ID of the resource created, upserted, or deleted.
      - `type` string, required — The type of resource created, upserted, or deleted.
    - `relationshipOperationReceipts` V1RelationshipOperationReceipt[], required — List of relationships operations for the bundle.
      - `receivedAt` string, date-time, required — The time the operation was received.
      - `completedAt` string, date-time — The time the operation was completed (whether successfully or not).
      - `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>`).
      - `action` 'CREATE' | 'UPSERT' | 'DELETE' | 'UPDATE', required — The action to perform.
      - `status` 'SUCCESS' | 'PENDING' | 'CANCELLED' | 'FAILURE', required — Status of the operation. * `SUCCESS`: The operation was persisted in the source, or was dropped by a reject action of the user. * `PENDING`: The operation is being processed asyncronously by the system or is in a pipeline IN_REVIEW status. * `CANCELLED`: The operation was cancelled by the system due to a concurrent operation. * `FAILURE`: The operation failed due to validation or processing error.
      - `error` V1Error
        - `code` 400 | 401 | 403 | 404 | 408 | 409 | 413 | 500 | 501, required
        - `message` string, required
        - `type` 'ALREADY_EXISTS' | 'FAILED_PRECONDITION' | 'INTERNAL' | 'INVALID_ARGUMENT' | 'NOT_FOUND' | 'OUT_OF_RANGE' | 'UNIMPLEMENTED' | 'PERMISSION_DENIED' | 'UNAUTHENTICATED' | 'CONTENT_TOO_LARGE' | 'REQUEST_TIMEOUT', required
        - `details` V1Error[] — list of errors that occurred if applicable.
      - `pipelineExecution` V1PipelineExecutionInfo
        - `id` string, required — The id of the pipeline execution.
        - `pipelineDefinitionId` string, required — The id with version in the format `<id>.<version>`.
        - `status` 'SUCCESSFUL' | 'ERROR' | 'IN_PROGRESS' | 'IN_REVIEW' | 'CANCELLED' | 'DROPPED', required — Status of the pipeline execution. * `SUCCESSFUL`: The pipeline execution completed successfully. Every step of the pipeline was executed successfully and the change has been accepted in the system. * `ERROR`: The pipeline execution failed at a step due to a system error. * `IN_PROGRESS`: The pipeline execution is being processed by the system. * `IN_REVIEW`: The pipeline execution is waiting for a manual action. Refer to the ActOnPipelineExecution endpoint. * `CANCELLED`: The pipeline execution has been short-circuited by the system and never completed. * `DROPPED`: The pipeline execution has been dropped because the change has been rejected by the user following review.
      - `targetType` 'RELATIONSHIP' | 'RESOURCE' | 'OBJECT', required
      - `id` string, required — The unique identifier of the relationship. This is a key with the shape `{fromID}.{toID}`.
      - `type` string, required — The type of relationship created, upserted, or deleted.

## Other responses

- `202` — The bundle operation is valid and is accepted with a status 'ACCEPTED'.
- `400` — Returned when the request is malformed or invalid.
- `404` — Returned when the source key is not found.
- `409` — Returned when more than one operation per id in the bundle.
- `413` — The request body exceeds the 500 kB limit.

---

[API](https://skmtc.dev/clinia/apis/registry-api.md) · [All operations](https://skmtc.dev/clinia/apis/registry-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/clinia/registry-api/revisions/3a9197b11351/schema)
