---
title: "Purge operation request for resources or relationships"
method: POST
path: "/sources/{sourceKey}/v1/purge"
tags: ["Purge"]
---

# Purge operation request for resources or relationships

`POST /sources/{sourceKey}/v1/purge`

Purge operation request for resources or relationships.

## Path parameters

- `sourceKey` string, required

## Request body

- V1PurgeRequest
  - `collectionType` 'resources' | 'relationships' | 'objects', required
  - `collectionKey` string, required — Key of the resource or relationship collection.

## Response `202`

A successful response for a valid and accepted purge operation with status 'ACCEPTED'.

- V1PurgeResponse — 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.
  - `purgeOperation` V1PurgeOperationReceipt, required
    - `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>`).
    - `purgeId` string, required — ID of the purge operation. Deprecated, please use the taskId instead.
    - `collectionType` 'resources' | 'relationships' | 'objects', required
    - `collectionKey` string, required — Key of the resource or relationship collection.
    - `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.
    - `deletedCount` integer — Number of documents deleted in case of success status.
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400` — Returned when the request is malformed or invalid.
- `404` — Returned when the source, collection type, or item type does not exist.
- `413` — Returned when the payload exceeds the max content size (100kB).

---

[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)
