---
title: "Clear all search history"
method: DELETE
path: "/search"
tags: ["Semantic Search"]
---

# Clear all search history

`DELETE /search`

Permanently delete every persisted search row owned by, or shared
with, the authenticated user, along with the citation rows those
searches reference. The action cannot be undone.

Scoped to the caller's org and limited to rows where
`isDeleted: false` and `isArchived: false`. If nothing matches
(including the case where every row is already archived), the
endpoint returns `404` rather than a successful no-op.

## Query parameters

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

## Response `200`

Search history deleted successfully.

- object
  - `message` string, required

## Other responses

- `400` — Invalid request, raised from the shared filter helper when a query parameter fails validation — for example a malformed `startDate` / `endDate`, a `search` value over 1000 characters, or a `search` value that trips the XSS guard.
- `401` — Missing or invalid bearer token.
- `403` — Bearer token lacks the `semantic:delete` scope.
- `404` — No matching rows. Returned when the caller has no owned or shared searches that satisfy the filter.
- `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)
