Move a saved search to the Trash and return its journal identity for Undo.
const url = 'https://example.com/api/v1/search/saved/example/trash';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/search/saved/example/trash \ --header 'Authorization: Bearer <token>'Route: /api/v1/search/saved/{id}/trash. Inputs: id. Do not automatically replay this operation after an uncertain result.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Saved search id
Responses
Section titled “Responses”The saved search and its Trash identity
Trash identity and content hash returned by the existing calternal-fs journal.
object
A saved search: a named query that works like a smart folder (DESIGN §32
S10). It is user data, stored as one JSON file per search in
<home>/.calternal/saved-searches/<id>.json.
object
Creation time (RFC 3339, UTC).
Stable identifier (a lowercase UUID). Links use it, so a rename never breaks them.
Display name chosen by the user.
True when the search shows in the sidebar.
The raw query, operators included, exactly as the search field shows it.
Last change time (RFC 3339, UTC).
Examplegenerated
{ "expected_hash": "example", "saved_search": { "created": "example", "id": "example", "name": "example", "pinned": true, "query": "example", "updated": "example" }, "trash_name": "example"}No such saved search
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}The search changed before it was moved
The standard API error response: { "error": { ... } }.
object
Example
{ "error": { "code": "bad_request" }}