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

Download a completed asynchronous search

For an asynchronous search whose status is COMPLETE: a fresh link (valid for 15 minutes) to ONE JSON file with the whole result set - the search, its `resultCount`, any `warnings` and every result, in the same shape and order as the pages.

Overview

For an asynchronous search whose status is COMPLETE: a fresh link (valid for 15 minutes) to ONE JSON file with the whole result set - the search, its resultCount, any warnings and every result, in the same shape and order as the pages. Ask again for a new link any time within the 7 days the file is kept; downloading is free. Before COMPLETE the call returns 409; a synchronous search has no file (404). 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/download" \
  -H "X-CasePrimus-Api-Key: $CASEPRIMUS_API_KEY"

Responses

200A link to the file.
FieldDescription
url
string

Presigned link, valid for 15 minutes.

expiresAt
integer

Epoch ms when the link stops working.

format
enum
json
resultCount
integer
sizeBytes
integer
Response 200
{
  "url": "https://files.example.com/historical-search/CPA0example/CPHS0exampleasync01.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=900&X-Amz-Signature=...",
  "expiresAt": 1791940500000,
  "format": "json",
  "resultCount": 1843,
  "sizeBytes": 2764310
}
404Unknown or deleted search, or a search with no file (synchronous).
Response 404
{
  "httpStatusCode": 404,
  "code": 61468,
  "message": "There is no download for this search: only a completed asynchronous search has one",
  "appError": true
}
409The search is still being collected, or it failed.
Response 409
{
  "httpStatusCode": 409,
  "code": 61467,
  "message": "This search is still being collected. Its results can be read once its status is COMPLETE",
  "appError": true,
  "details": {
    "status": "RUNNING"
  }
}
410The search has expired and its file was deleted.

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