For the complete documentation index, see llms.txt. This page is also available as Markdown.

Reading fraud and control checks

Gate downstream work on the document's integrity signals.

Goal. Read the fraud-detection signals attached to a completed extraction, and use them to decide whether downstream processing should continue.

Fraud rules are configured in the portal. The API does not expose rule management — but a completed extraction record carries the results, which is what an automated gate actually needs.

Before you start

  • An API key, exported as $DOCAI_API_KEY.

  • A completed asynchronous extraction and its _id — see Extract asynchronously and poll. The record retrieved by GET /document-extractions/{id} carries fraud results; the synchronous response does not.

  • Fraud rules configured for the document type — see Fraud Detection.

Step 1 — Retrieve the extraction record

curl -s "https://api-docai-uat.uptiq.ai/document-extractions/$ID" \
  -H "X-Api-Key: $DOCAI_API_KEY" -o record.json

jq '.extraction.fraudResults' record.json
{
  "fraudId": "d40f8b63-15ce-42a9-b806-9f37c2e6a851",
  "extractionId": "3f2a91c4-7b58-4e12-9d63-0a5e8c1b74df",
  "documentType": "BalanceSheet",
  "fraudStatus": "processing",
  "analysisStatus": "pending",
  "preflight": {
    "phase": "pre_ocr",
    "overallScore": 100.0,
    "genericRulesEvaluated": 15,
    "processingTimeMs": 25549,
    "categoryScores": {
      "compliance":         { "total": 6, "passed": 0, "failed": 0, "skipped": 6, "score": 0.0 },
      "social_engineering": { "total": 3, "passed": 1, "failed": 0, "skipped": 2, "score": 33.33 },
      "visual_forensic":    { "total": 9, "passed": 4, "failed": 0, "skipped": 5, "score": 44.44 }
    },
    "results": [ ],
    "errors": []
  }
}

Step 2 — Wait for fraud analysis to finish

This is the part that catches people out.

Check the fraud state separately from the extraction state:

Treat fraudStatus values other than a terminal one as "not yet decided", and re-poll the record. If your gate cannot wait, fail closed — hold the document for review rather than passing it on an incomplete signal.

Step 3 — Read the category scores

Preflight checks are grouped into three categories:

Category
Looks for

visual_forensic

Tampering evidence — inconsistent fonts, edited regions, missing print or export artifacts

compliance

Whether the document carries what its type is required to carry

social_engineering

Patterns associated with documents constructed to deceive

Each reports total, passed, failed, skipped and a score.

Step 4 — Read individual rule results

status is PASS, FAIL or SKIP. details.explanation is written for a human — surface it in your review queue rather than paraphrasing it, and keep riskFactors where a reviewer can see them.

Step 5 — Build the gate

A defensible policy has three outcomes rather than two: pass when nothing failed and coverage was adequate, review when rules failed or too many skipped to be meaningful, and reject only on the failures your risk team has agreed warrant it.

What you cannot do through the API

Not available
Do it here

Create or edit fraud rules

Document Types → Fraud Detection — see Fraud Detection

Enable or disable rules per document type

Same screen

Export a certification report

Document Types screen

Query fraud results independently of an extraction

Retrieve the extraction record

There is no fraud endpoint in the published API. Everything above reads results that ride along on the extraction record.

Last updated