---
title: "Bulk create, upsert, or delete resources"
method: POST
path: "/sources/{sourceKey}/v1/resources/bulk"
tags: ["Bulk"]
---

# Bulk create, upsert, or delete resources

`POST /sources/{sourceKey}/v1/resources/bulk`

Bulk create, upsert, or delete resources. The request body should contain a list of operations.
All operations will be processed even if some of them fail.

## Path parameters

- `sourceKey` string, required

## Request body

- object
  - `operations` V1ResourceOperation[], required
    - 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.

## Response `202`

The bulk operation is valid and accepted with a status 'ACCEPTED'.

- V1BulkResourceResponse — 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` '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.
  - `bulkId` string, required — The task identifier. This is deprecated, please use the taskId field instead.

## Other responses

- `400` — Returned when the request is malformed or invalid.
- `413` — The request body exceeds the 5 GB 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)
