/case-lookup/summarizeGenerate an AI case summary and risk level, on demand
CasePrimus's AI summarization - resolves every order's document itself and produces a case summary, risk justification, and risk level, for a case that's only been looked up via POST /case-lookup, not added to the watchlist.
Overview
CasePrimus's AI summarization - resolves every order's document itself and produces a case summary, risk justification, and risk level, for a case that's only been looked up via POST /case-lookup, not added to the watchlist. Takes the searchId from that lookup (or GET /case-lookup/{searchId}) - reads the already-fetched case details straight off that record rather than re-fetching live. Returns immediately with an _id - poll GET /case-lookup/summarize/{id} for the result. Every call starts a new summary (use this again to regenerate) - the most recently generated one for a case is also returned as latestSummary on POST /case-lookup and GET /case-lookup/{searchId} themselves, so a customer doesn't need to keep track of summary ids across requests. Requires case.write.
X-CasePrimus-Api-Key header. See Authentication for how to create a key, and Rate limits & errors for how requests are counted.Request body
| Field | Description |
|---|---|
searchIdstring Required | The _id returned by POST /case-lookup or GET /case-lookup/{searchId}. |
{
"searchId": "CPCSH0exampledemo0001"
}Example request
Replace CASEPRIMUS_API_KEY with your key.
BASE="https://api.caseprimus.ai/api/caseprimus/v1" curl -X POST "$BASE/case-lookup/summarize" \ -H "X-CasePrimus-Api-Key: $CASEPRIMUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "searchId": "CPCSH0exampledemo0001" }'
const BASE = "https://api.caseprimus.ai/api/caseprimus/v1"; const res = await fetch(BASE + "/case-lookup/summarize", { method: "POST", headers: { "Content-Type": "application/json", "X-CasePrimus-Api-Key": process.env.CASEPRIMUS_API_KEY, }, body: JSON.stringify({ "searchId": "CPCSH0exampledemo0001" }), }); const data = await res.json();
import os import requests BASE = "https://api.caseprimus.ai/api/caseprimus/v1" res = requests.request( "POST", BASE + "/case-lookup/summarize", headers={"X-CasePrimus-Api-Key": os.environ["CASEPRIMUS_API_KEY"]}, json={ "searchId": "CPCSH0exampledemo0001", }, ) data = res.json()
Responses
| Field | Description |
|---|---|
_idstring | |
statusenum | PENDINGCOMPLETEFAILED |
{
"_id": "CPCSS0exampledemo0001",
"status": "PENDING"
}Error responses share one shape, listed on Rate limits & errors.