DELETE
/historical-search/{searchId}Delete a search now
Deletes the search's results immediately.
Overview
Deletes the search's results immediately. Only the minimal record needed for billing remains. On an asynchronous search that is still collecting this also cancels it (nothing is charged). Requires historicalSearch.write.
Auth API key
Send your API key in the
X-CasePrimus-Api-Key header. See Authentication for how to create a key, and Rate limits & errors for how requests are counted.Parameters
| Name | In | Description |
|---|---|---|
searchIdstring Required | path | The id returned when the resource was created. |
Example request
Replace CASEPRIMUS_API_KEY with your key.
Request
BASE="https://api.caseprimus.ai/api/caseprimus/v1" curl -X DELETE "$BASE/historical-search/SEARCH_ID" \ -H "X-CasePrimus-Api-Key: $CASEPRIMUS_API_KEY"
const BASE = "https://api.caseprimus.ai/api/caseprimus/v1"; const res = await fetch(BASE + "/historical-search/SEARCH_ID", { method: "DELETE", headers: { "X-CasePrimus-Api-Key": process.env.CASEPRIMUS_API_KEY, }, }); const data = await res.json();
import os import requests BASE = "https://api.caseprimus.ai/api/caseprimus/v1" res = requests.request( "DELETE", BASE + "/historical-search/SEARCH_ID", headers={"X-CasePrimus-Api-Key": os.environ["CASEPRIMUS_API_KEY"]}, ) data = res.json()
Responses
200Deleted.
Response 200
{}404Unknown or already deleted search.
Response 404
{
"httpStatusCode": 404,
"code": 61449,
"message": "This search was not found",
"appError": true
}Error responses share one shape, listed on Rate limits & errors.