CasePrimus.aiby Attestr
Documentation menu
GET/historical-search/{searchId}

Status of a search

Status and counters.

Overview

Status and counters. status is ACTIVE (more may exist), COMPLETE (every source read to its end or to the results-per-search cap) or EXPIRED (the results have been deleted; only the counts remain). An asynchronous search (mode: ASYNC) is RUNNING while it collects, then COMPLETE or FAILED; collected is how many results are stored so far (final once COMPLETE) and a FAILED search carries a failureReason. Does not contact a data source. Requires historicalSearch.read.

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
searchId
string
Required
pathThe 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 "$BASE/historical-search/SEARCH_ID" \
  -H "X-CasePrimus-Api-Key: $CASEPRIMUS_API_KEY"

Responses

200The search.
FieldDescription
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
code
enum
RESULT_CAP_REACHEDSOURCE_UNAVAILABLE
message
string
createdAt
integer

Epoch ms.

expiresAt
integer

Epoch ms. Results are deleted at this time.

Response 200
{
  "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
}
404Unknown or 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.