---
title: "Delete search by ID"
method: DELETE
path: "/search/{searchId}"
tags: ["Semantic Search"]
---

# Delete search by ID

`DELETE /search/{searchId}`

Permanently delete a single persisted search row, plus every
citation row referenced by its `citationIds`. The caller must
either own the row or have it shared with them.

Scoped to the caller's org and limited to rows where
`isDeleted: false` and `isArchived: false`; archived or
already-deleted rows surface as `404`.

## Path parameters

- `searchId` string, objectId, required

## Query parameters

- `search` string
- `shared` 'true' | 'false'
- `startDate` string, date-time
- `endDate` string, date-time

## Response `200`

Search deleted successfully.

- object
  - `message` string, required

## Other responses

- `400` — Invalid request. Possible causes: - `searchId` failed Zod validation (not a valid ObjectId). - A query parameter passed through to the shared filter helper failed validation, e.g. a malformed `startDate` / `endDate`, or a `search` value over 1000 characters or tripping the XSS guard.
- `401` — Missing or invalid bearer token.
- `403` — Bearer token lacks the `semantic:delete` scope.
- `404` — No search matched. Returned when the id does not exist for this caller, or when the row is archived or already deleted.
- `500` — Server error. Possible causes: - Explicit `InternalServerError` or any other 500 `BaseError` thrown by the handler. - Non-`BaseError` exception caught by the global error middleware. - Response serializer fallback.

---

[API](https://skmtc.net/pipeshub-ai/apis/pipeshub-api.md) · [All operations](https://skmtc.net/pipeshub-ai/apis/pipeshub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pipeshub-ai/pipeshub-api/versions/abd27cfefc73/schema)
