# Undo a soft collection delete

> Restores a collection that is still inside its grace window (status=deletion_pending) back to active, cancelling the… (POST /v1/collections/{id}/restore)

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

Restores a collection that is still inside its grace window
(`status=deletion_pending`) back to `active`, cancelling the scheduled
purge. The collection keeps the same incarnation, and any batch work that
was paused by the delete resumes. Free and idempotent.

Returns 409 once the purge has actually started (`status=deleting`) —
vectors are being erased at that point, so a restore could not honestly
return the collection intact. Also 409 for a compliance-class erasure,
which is deliberately not restorable.

### Example request

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

Put each id in the path percent-encoded, as a single path segment. An id with `/`, `?`, `#`, `%` or a space otherwise addresses a different URL. In code, use your HTTP library's path encoding (for example `encodeURIComponent` in JavaScript or `urllib.parse.quote(id, safe="")` in Python).

### Parameters

| Name              | In   | Type     | Description    |
| ----------------- | ---- | -------- | -------------- |
| `id` **required** | path | `string` | Collection id. |

### Response body

| Field     | Type     | Description |
| --------- | -------- | ----------- |
| `status`  | `string` |             |
| `message` | `string` |             |

### Status codes

| Status | Meaning                                                                                 |
| ------ | --------------------------------------------------------------------------------------- |
| `200`  | Collection restored.                                                                    |
| `401`  | Missing or invalid API key.                                                             |
| `403`  | Account is read-only.                                                                   |
| `404`  | Resource not found.                                                                     |
| `409`  | Not restorable — the purge has already started, or this was a compliance-class erasure. |
