---
title: "Unarchive a search"
method: PATCH
path: "/search/{searchId}/unarchive"
tags: ["Semantic Search"]
---

# Unarchive a search

`PATCH /search/{searchId}/unarchive`

Restore a previously archived search result back to the active search history.

## Path parameters

- `searchId` string, objectId, required

## Response `200`

Search unarchived successfully

- object
  - `id` string, objectId, required — Unique identifier of the unarchived search.
  - `status` 'unarchived', required — Resulting status of the search after the operation.
  - `unarchivedBy` string, objectId, required — User ID of the user who unarchived the search.
  - `unarchivedAt` string, date-time, required — Timestamp when the search was unarchived.
  - `meta` object, required
    - `requestId` string — Server-assigned request identifier for tracing. Omitted when not available.
    - `timestamp` string, date-time, required — Server timestamp when the response was produced.
    - `duration` integer, required — Time taken to process the request, in milliseconds.

## Other responses

- `400` — Invalid request. Possible causes: - `searchId` failed Zod validation (not a valid ObjectId). - The target search is not currently archived and therefore cannot be unarchived.
- `401` — Missing or invalid bearer token.
- `403` — Bearer token lacks the `semantic:write` scope.
- `404` — No archived search matches `searchId` within the caller's org, or the row is already active / deleted.
- `500` — Unexpected server error while unarchiving the search.

---

[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/revisions/abd27cfefc73/schema)
