# Delete a collection (soft by default, restorable)

> Schedules a durable cascade delete — all faces and selfies are removed asynchronously. (DELETE /v1/collections/{id})

Source: https://sightradar.com/docs/api/collections/delete-a-collection

Schedules a durable cascade delete — all faces and selfies are removed
asynchronously. Returns 202 with a workflow id. Free.

Two modes:

* **Soft (default, no flag)** — the collection is tagged
`deletion_pending` and stops accepting index/search operations
*immediately*, but nothing is erased until the grace window elapses.
Undo with `POST /v1/collections/{id}/restore` any time before the purge
starts. This is the safe default: an accidental mass-delete from your
own automation is recoverable.
* **Immediate (`?immediate=true`)** — skips the grace window and starts
erasing now. NOT restorable.

`?compliance=true` is an alias for `immediate=true` that additionally
records the erasure as compliance-class for your own audit trail.

Poll `GET /v1/collections/{id}/deletion` for authoritative progress.

### Example request

```bash
curl -X DELETE "https://api.sightradar.com/v1/collections/$ID" \
  -H "Authorization: Bearer $SR_API_KEY"
```

### Parameters

| Name              | In    | Type      | Description                                                                      |
| ----------------- | ----- | --------- | -------------------------------------------------------------------------------- |
| `id` **required** | path  | `string`  | Collection id.                                                                   |
| `immediate`       | query | `boolean` | Skip the grace window and begin erasing now. Not restorable.                     |
| `compliance`      | query | `boolean` | Alias for `immediate=true`, additionally recorded as a compliance-class erasure. |

### Response body

| Field         | Type                               | Description                                                                                           |
| ------------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `status`      | `"deletion_pending" \| "deleting"` | `deletion_pending` for a soft delete (still restorable); `deleting` once erasure has been scheduled.  |
| `mode`        | `"soft" \| "immediate"`            |                                                                                                       |
| `workflow_id` | `string`                           |                                                                                                       |
| `restorable`  | `boolean`                          | True for a soft delete (undo via `POST /v1/collections/{id}/restore`); false for an immediate delete. |
| `purge_after` | `string`                           | When the grace window elapses and erasure begins. Soft deletes only.                                  |
| `message`     | `string`                           |                                                                                                       |

### Status codes

| Status | Meaning                                    |
| ------ | ------------------------------------------ |
| `202`  | Deletion scheduled.                        |
| `401`  | Missing or invalid API key.                |
| `404`  | Resource not found.                        |
| `409`  | Collection is already deleting or deleted. |
