---
title: "Remove target from collection"
method: DELETE
path: "/public/v1/collections/{collectionId}/targets/{targetId}"
tags: ["Collections - Targets"]
---

# Remove target from collection

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

Remove a single target from a collection.

The target is identified by its `prewaveTargetId` (target's `infotag_id`) in the URL path. If the target is not
currently in the collection, the operation will complete successfully without error (idempotent operation).

**Getting Collection ID:**
- To find available collections and their IDs, use the Collections Management API:
  - `GET /public/v1/collections` - List all collections accessible to you (returns collections with `id` field)
  - `GET /public/v1/collections/{collectionId}` - Get a specific collection by ID
- The `id` field in collection responses is the `collectionId` used in this endpoint's path parameter

**Getting Target ID (prewaveTargetId):**
- To get the current target ID, use the Supplier Sites API or the collection targets endpoint:
  - `GET /public/v1/collections/{collectionId}/targets` - List all targets in the collection with their current `prewaveTargetId` values
  - `GET /public/v2/suppliers/sites` - List all suppliers with their current `prewaveTargetId` values
  - `GET /public/v2/suppliers/sites/find-by-identifier?prewaveId={prewaveTargetId}` - Get a specific supplier by `prewaveTargetId`
- The `id` field in target/supplier responses is the `prewaveTargetId` used in this endpoint's path parameter

**Important: Target ID Stability**

⚠️ **The target `id` (prewaveTargetId) may change** due to target merges or data consolidation. When this happens:
- The target's edge numbers, edge data, and collection memberships are automatically moved to a new target
- Using an outdated target ID will result in a `404 Not Found` error

💡 **Best Practice for Integrations:**
- **Always use current target IDs** when removing targets from collections
- Use `GET /public/v1/collections/{collectionId}/targets` to get the current target IDs in the collection before removing them
- Alternatively, use `GET /public/v2/suppliers/sites` to find the current `prewaveTargetId` by matching your supplier identifiers
- If you receive a `404 Not Found` error, use `GET /public/v2/suppliers/sites` to find the current `prewaveTargetId` by matching your supplier identifiers

**Audit Trail:**
- All changes are audited for compliance and tracking purposes
- Every action is recorded in the audit log with:
  - The user who performed the operation
  - Timestamp of the operation
  - Details about which target was removed from the collection
  - Reference to the public API endpoint used

**Required Permissions**: `manage_collection` and `update` on the collection.

## Path parameters

- `collectionId` integer, required
- `targetId` integer, required

## Response `204`

Target removed from collection successfully (or was not in collection). All changes have been audited.

## Other responses

- `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` — Collection not found, target not found, or not accessible to the user. This may occur if: (1) the collection doesn't exist or is not accessible to your organization, (2) the target ID doesn't exist, (3) the target ID is not accessible to your organization, or (4) the target ID has changed due to a target merge (in which case, use GET /public/v2/suppliers/sites to find the new ID by matching supplier identifiers).
- `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)
