Create and manage verification cases — documents, conversations, decisions, and reports
Cases
A case is a verification session tied to a specific agent goal. Documents are uploaded into a case; the agent classifies, extracts, and validates each one. Cases progress through statuses: collecting → completed / review / denied / failed. A case left untouched past the session TTL is swept to expired, which is terminal too.
Case Object
session_idstringUUID of the case.
tenant_idstringTenant that owns this case.
goalstringAgent goal this case is running against (e.g. "kyc_verification").
client_reference_idstringYour own unique reference for this case, if you supplied one at creation. Echoed back so you can correlate the case with your records. null when not provided.
statusstringCurrent status: collecting, completed, review, denied, failed, expired.
completed, review, denied, failed and expired are terminal — poll
until you see one of those, or use the completed flag on
GET /v1/cases/{id}/status, which is true for exactly that set. expired
means the case was swept for inactivity before it was completed; it cannot be
completed afterwards, but its report is still generated on demand.
extractionsobjectMerged extraction results keyed by document type.
resultobjectFinal result including decision, cross-match outcome, and validation summary.
execution_idstringUUID of the associated execution record, if present.
documentsobject[]Array of document records uploaded to this case.
progressobjectGoal progress showing which document types have been collected and which are still needed.
created_atstringupdated_atstringDocument Record Object
doc_idstringdoc_indexnumberfilenamestringobject_keystringfile_urlstring/v1/cases/{session_id}/documents/{doc_id}/filemime_typestringsize_bytesnumberlabelstringdocument_typestringconfidencestringextractedobjectcoordinatesobjectstatusstringpending, processing, done, failederrorstringfailed.created_atstringEndpoints
Create Case
POST /v1/cases
Requires scope: write. Creates a new case and routes it to the named agent. For intelligence level 2+ agents, the agent's configured greeting is stored as the first assistant message.
Request body:
goalstringrequiredAgent goal to run this case against. The agent must be deployed.
tenant_idstringTenant to associate this case with.
client_reference_idstringOptional. Your own unique identifier for this case (max 255 characters), unique per tenant. Supply it so you hold a handle to the case before the response returns — if the create call errors after the case was created, you can still recover it via List Cases (?client_reference_id=…).
It is also an idempotency key: creating a case again with the same client_reference_id returns the existing case (HTTP 200) instead of creating a duplicate, so a blind retry after an error is safe. Echoed back on the case object.
Example request:
{
"goal": "kyc_verification",
"tenant_id": "acme-corp",
"client_reference_id": "order-8f21c"
}
Response (201): Case object with empty documents array and initial progress.
Response (200): returned instead of 201 when client_reference_id matches an existing case for the tenant — the existing case is returned unchanged (idempotent replay; no new case is created).
List Cases
GET /v1/cases
Requires scope: read.
Query parameters:
tenant_idstringFilter by tenant. Returns all tenants if empty.
limitnumberNumber of records to return. Default 50, max 200.
client_reference_idstringFilter by the client-supplied reference passed at creation. Returns at most one case (the reference is unique per tenant) — use this to recover a case by your own identifier, e.g. after a create call errored.
Response (200): Array of Case objects (without document details).
Get Case
GET /v1/cases/{session_id}
Requires scope: read. Returns the full case including all document records.
session_idstringrequiredAdd Document to Case
POST /v1/cases/{session_id}/documents
Requires scope: write. Uploads a document file (multipart/form-data). The file is stored in encrypted object storage and processed immediately by the agent pipeline (classify → extract → validate).
Accepted MIME types: image/jpeg, image/png, image/webp, image/tiff, image/bmp, image/gif, application/pdf
Maximum file size: 20 MB
session_idstringrequiredForm fields:
filefilerequiredThe document file.
labelstringOptional label for this document (e.g. "front", "back").
Response (200):
doc_idstringdocument_typestringconfidencestringextractedobjectstatusstringdone or failedprogressobjectComplete Case
POST /v1/cases/{session_id}/complete
Requires scope: write. Triggers final processing — runs cross-matching, governance checks, and generates the output package. This is an atomic DB transaction.
session_idstringrequiredResponse (200):
session_idstringstatusstringcompleted, review, or failedresultobjectDecision (Approve / Deny)
PATCH /v1/cases/{session_id}/decision
Requires scope: write. Human reviewer approves or denies a case that is in review status.
session_idstringrequiredRequest body:
decisionstringrequired"approve" or "deny".
reasonstringReviewer notes.
Response (200):
{
"session_id": "...",
"status": "completed",
"decision": "approve",
"reason": "Documents verified manually"
}
Returns 409 if the case is not in review status.
Send Message
POST /v1/cases/{session_id}/message
Requires scope: write. Conversational turn for intelligence level 2+ agents. The assistant processes the message (and any attached documents) and returns a reply.
session_idstringrequiredRequest body:
messagestringrequiredUser message text.
attachmentsobject[]Optional document attachments. Each object: { "data": "<base64>", "mime_type": "image/jpeg", "filename": "id_front.jpg" }.
Response (200):
message_idstringreplystringdoc_resultsobject[]progressobjectsession_statusstringGet Messages
GET /v1/cases/{session_id}/messages
Requires scope: read. Returns the full conversation history for a case.
session_idstringrequiredResponse (200): Array of message objects.
idstringsession_idstringrolestring"user" or "assistant"contentstringattachmentsobject[]metadataobjectcreated_atstringGet Report
GET /v1/cases/{session_id}/report
Requires scope: read. Returns the investigation report for a completed case. The report is cached after first generation.
session_idstringrequiredQuery parameters:
regeneratebooleanForce report regeneration even if a cached version exists. Default false.
formatstring"json" (default) or "pdf". The PDF response has Content-Disposition: attachment; filename="report_{id}.pdf".
Returns 422 if the case is still in collecting or processing status.
Download Document File
GET /v1/cases/{session_id}/documents/{doc_id}/file
Requires scope: read. Streams the original document file from storage.
session_idstringrequireddoc_idstringrequiredResponse headers include Cache-Control: private, max-age=3600 and Content-Disposition: inline; filename="<filename>".
Replay Case
POST /v1/cases/{session_id}/replay
Requires scope: write. Creates a new case by re-downloading and re-processing all documents from an existing case against the current agent version. Useful for regression testing after an agent update.
session_idstringrequiredResponse (201): New Case object.