---
title: "Deactivate a collection"
method: DELETE
path: "/public/v1/collections/{collectionId}"
tags: ["Collections - Management"]
---

# Deactivate a collection

`DELETE /public/v1/collections/{collectionId}`

Deactivate (soft delete) an existing collection.

This operation performs a **soft deletion** by marking the collection as inactive. The collection data remains in the database but is no longer accessible through the API.

**Parameter:**
- `{collectionId}` (path parameter): The unique identifier of the collection to deactivate.

**What happens when you deactivate a collection:**

1. **Collection Deactivation**: The collection is soft-deleted (marked as inactive)
2. **API Visibility**: The collection will no longer appear in collection list queries (`GET /public/v1/collections`) or be accessible via `GET /public/v1/collections/{collectionId}`
3. **Target Relationships**: Target-collection relationships remain in the database, but since the collection is inactive, targets linked to this collection become inaccessible through the API. The targets themselves are not deleted.
4. **Cleanup**: Collection filters and tree filters associated with the collection are removed
5. **User Default Collection**: If this collection was set as the user's default collection, it will be cleared
6. **Audit Trail**: The deactivation is recorded in the audit log with:
   - The user who deactivated the collection
   - Timestamp of the operation
   - Collection details (name, scope, type, ID)
   - Reference to the public API endpoint used
   - Audit comment: "Collection deleted via Public API"

**Important Notes:**

- This is a **soft delete** - the collection is marked as inactive but data remains in the database
- Deactivated collections are filtered out from all API queries automatically
- **Only the creator of the collection can deactivate it** - even if you have `DELETE` permission through a role, you must be the collection creator
- Target-collection relationships remain in the database, but targets become inaccessible through the API since the collection is inactive
- The targets themselves are not deleted - only the collection becomes inactive
- The collection cannot be reactivated through this API (no reactivation endpoint is available)
- All collection operations are audited for compliance and tracking purposes

**Required Permissions**:
- `MANAGE_COLLECTION` permission
- `DELETE` permission on the collection
- **You must be the creator of the collection** (collection.userId must match your user ID)

## Path parameters

- `collectionId` integer, required

## Response `204`

204 No Content - Collection deactivated successfully. The collection has been soft-deleted (marked as inactive), and the deactivation has been audited with the comment 'Collection deleted via Public API'. The collection will no longer appear in API queries. Target-collection relationships remain in the database but become inaccessible since the collection is inactive.

## Other responses

- `400` — 400 Bad Request - Invalid request. This status code is returned when the request is malformed or validation fails. This may occur if: (1) the collection cannot be deleted due to validation constraints, (2) the request parameters are invalid, or (3) there are other validation errors preventing the deletion.
- `403` — 403 Forbidden - Authentication or authorization failure. This status code is returned when: (1) the request lacks valid authentication credentials (missing or invalid X-Auth-Token header), or (2) the authenticated user does not have the required permission to access this resource.
- `404` — 404 Not Found - The collection with the specified ID was not found, is inactive (deactivated), or is not accessible to your organization. This may occur if: (1) the collection ID doesn't exist, (2) the collection was deactivated (soft-deleted), (3) the collection was never accessible to your organization, or (4) you don't have read access to the collection.
- `429` — 429 Too Many Requests - API rate limit exceeded. The request has been rejected because the rate limit for this endpoint has been exceeded. Default rate limits: GET requests - 100 per 10 seconds, 500 per minute; POST/PUT/PATCH/DELETE requests - 20 per 10 seconds, 100 per minute. For increased access, please contact customer success.
- `500` — 500 Internal Server Error - An unexpected error occurred on the server. The request may or may not have been processed.

---

[API](https://skmtc.net/prewave/apis/public-prewave-api.md) · [All operations](https://skmtc.net/prewave/apis/public-prewave-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prewave/public-prewave-api/revisions/466169815b78/schema)
