CasePrimus.aiby Attestr
Documentation menu
GET/historical-search

List 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.

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

NameInDescription
limit
integer
Optional
queryHow many searches to return.

Example request

Replace CASEPRIMUS_API_KEY with your key.

Request
BASE="https://api.caseprimus.ai/api/caseprimus/v1"

curl "$BASE/historical-search" \
  -H "X-CasePrimus-Api-Key: $CASEPRIMUS_API_KEY"

Responses

200Searches.
FieldDescription
searches
array of object
searchId
string
mode
enum

ASYNC: collected in the background (see POST /historical-search).

SYNCASYNC
status
enum

SYNC searches are ACTIVE, COMPLETE or EXPIRED. ASYNC searches are RUNNING, COMPLETE, FAILED or EXPIRED.

ACTIVECOMPLETEEXPIREDRUNNINGFAILED
name
string
partyType
enum
PETITIONERRESPONDENTBOTH
filters
object
clientReference
string or null
delivered
integer

Results delivered so far. For a COMPLETE asynchronous search: all of them (reading its pages is free and repeatable).

collected
integer

ASYNC only. Results stored so far; final once COMPLETE.

completedAt
integer or null

ASYNC only. Epoch ms the search finished (COMPLETE or FAILED); null while RUNNING.

failureReason
string

ASYNC only, present when FAILED: why, in words for a person. Nothing was charged.

warnings
array of object
createdAt
integer

Epoch ms.

expiresAt
integer

Epoch ms. Results are deleted at this time.

Response 200
{
  "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
    }
  ]
}
403Caller lacks historicalSearch.read.

Error responses share one shape, listed on Rate limits & errors.