/historical-searchList recent searches
This account's searches, newest first, with their status and counts.
Overview
This account's searches, newest first, with their status and counts. Requires historicalSearch.read. Does not contact a data source.
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 |
|---|---|---|
limitinteger Optional | query | How many searches to return. |
Example request
Replace CASEPRIMUS_API_KEY with your key.
BASE="https://api.caseprimus.ai/api/caseprimus/v1" curl "$BASE/historical-search" \ -H "X-CasePrimus-Api-Key: $CASEPRIMUS_API_KEY"
const BASE = "https://api.caseprimus.ai/api/caseprimus/v1"; const res = await fetch(BASE + "/historical-search", { method: "GET", 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( "GET", BASE + "/historical-search", headers={"X-CasePrimus-Api-Key": os.environ["CASEPRIMUS_API_KEY"]}, ) data = res.json()
Responses
| Field | Description |
|---|---|
searchesarray of object | |
searchIdstring | |
modeenum | ASYNC: collected in the background (see POST /historical-search). SYNCASYNC |
statusenum | SYNC searches are ACTIVE, COMPLETE or EXPIRED. ASYNC searches are RUNNING, COMPLETE, FAILED or EXPIRED. ACTIVECOMPLETEEXPIREDRUNNINGFAILED |
namestring | |
partyTypeenum | PETITIONERRESPONDENTBOTH |
filtersobject | |
clientReferencestring or null | |
deliveredinteger | Results delivered so far. For a COMPLETE asynchronous search: all of them (reading its pages is free and repeatable). |
collectedinteger | ASYNC only. Results stored so far; final once COMPLETE. |
completedAtinteger or null | ASYNC only. Epoch ms the search finished (COMPLETE or FAILED); null while RUNNING. |
failureReasonstring | ASYNC only, present when FAILED: why, in words for a person. Nothing was charged. |
warningsarray of object | |
createdAtinteger | Epoch ms. |
expiresAtinteger | Epoch ms. Results are deleted at this time. |
{
"searches": [
{
"searchId": "CPHS0exampledemo0001",
"mode": "SYNC",
"status": "ACTIVE",
"name": "Acme Logistics Private Limited",
"partyType": "BOTH",
"filters": {
"caseStatus": "ALL"
},
"clientReference": "vendor-onboarding-4821",
"delivered": 100,
"warnings": [],
"createdAt": 1791600000000,
"expiresAt": 1792204800000
},
{
"searchId": "CPHS0exampledemo0002",
"status": "COMPLETE",
"name": "Bluestar Foods Limited",
"partyType": "BOTH",
"filters": {
"caseStatus": "ALL"
},
"clientReference": null,
"delivered": 42,
"warnings": [],
"createdAt": 1791513600000,
"expiresAt": 1792118400000
}
]
}Error responses share one shape, listed on Rate limits & errors.