# Forensic Investigation

> Runs a forensic review of a client's ledger for signs of error or fraud, using Benford's Law, round-number and duplicate-payment tests and a supplier ABN…

POST /api/v1/skills/anomalies.investigate/invoke

Runs a forensic review of a client's ledger for signs of error or fraud, using Benford's Law, round-number and duplicate-payment tests and a supplier ABN check. Supply the client_id, and optionally a scope, a jurisdiction and an alert level. It returns a risk rating, classified red flags, the Benford's Law result, an evidence checklist and a written forensic narrative.

Body parameters

client_id string · uuid Required

UUID of the client whose ledger is investigated.

investigation_scope object

Optional limits on what is examined, as a JSON object such as a period or a ledger; an empty object examines everything available for the client.

benford_test boolean · default true

When true, compare first-digit frequencies with Benford's Law.

round_number_test boolean · default true

When true, flag an unusual share of round-number transactions.

duplicate_test boolean · default true

When true, look for duplicate or near-duplicate payments and invoices.

vendor_abr_check boolean · default true

When true, check supplier Australian Business Numbers against the register.

threshold_override object

Optional overrides for the default detection thresholds, as a JSON object keyed by test name; an empty object keeps the defaults.

jurisdiction enum

ISO 3166-1 alpha-2 code of the jurisdiction whose rules apply, if known.

AU GB CA US NZ

alert_level enum · default standard

How readily the investigation raises a red flag: conservative, standard or aggressive.

conservative standard aggressive

Returns

Skill executed successfully

skill string Required

Example investigate_anomaly

output object Required

output.artifact_id string · uuid

output.download_url string · default

output.summary string · default

output.citations array of values

output.warnings array of strings

output.stub_fields array of strings

output.investigation_id string · uuid

output.risk_rating enum · default LOW

LOW MEDIUM HIGH CRITICAL

output.red_flags array of values

output.benford_result

output.duplicate_analysis object

output.evidence_checklist array of strings

output.referral_pathways array of strings

output.limitations array of strings

output.forensic_narrative string · default

correlation_id string Required

Errors

Status Type When

401 AUTH.TOKEN_INVALID Authentication required

403 PERMISSION.CAPABILITY_DENIED Insufficient permissions

404 SKILL.NOT_FOUND Skill not found

422 VALIDATION.INVALID_FORMAT Validation error

429 RATE_LIMIT.USER Rate limit exceeded

5XX INTERNAL.UNKNOWN Internal server error

[Next Forensic Asset Tracing →](https://heyarchie.com/en-gb/developers/api-reference/forensic/forensic-asset-tracing/)

```
curl https://uk.heyarchie.com/api/v1/skills/anomalies.investigate/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "client_id": "00000000-0000-0000-0000-000000000000",
       "investigation_scope": {},
       "benford_test": false,
       "round_number_test": false,
       "duplicate_test": false,
       "vendor_abr_check": false,
       "threshold_override": {},
       "jurisdiction": null,
       "alert_level": "conservative"
     }'
```

```
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "anomalies.investigate",
    client_id="00000000-0000-0000-0000-000000000000",
    investigation_scope={},
    benford_test=False,
    round_number_test=False,
    duplicate_test=False,
    vendor_abr_check=False,
    threshold_override={},
    jurisdiction=None,
    alert_level="conservative",
)
print(result)
```

```
import { Archie } from "heyarchie";

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("anomalies.investigate", {
  "client_id": "00000000-0000-0000-0000-000000000000",
  "investigation_scope": {},
  "benford_test": false,
  "round_number_test": false,
  "duplicate_test": false,
  "vendor_abr_check": false,
  "threshold_override": {},
  "jurisdiction": null,
  "alert_level": "conservative"
});
console.log(result);
```

Response

```
{
  "skill": "investigate_anomaly",
  "output": {
    "artifact_id": "a9d4f6b2-17c8-4e35-b0a1-8f3d2c6e9b74",
    "benford_result": {
      "applied": true,
      "chi_square_statistic": 9.7,
      "interpretation": "First-digit frequencies are consistent with Benford's Law.",
      "p_value": 0.29,
      "significant": false,
      "transactions_analysed": 1842
    },
    "evidence_checklist": [
      "Original invoice 4471",
      "Both remittance advices",
      "Supplier statement for March 2026"
    ],
    "forensic_narrative": "The accounts payable ledger for the year to 30 June 2026 was tested for first-digit conformity and duplicate payments. One duplicate payment and one supplier with an unverifiable ABN were found.",
    "investigation_id": "5f8c1b3a-6d29-4a7e-93b4-e1d07c2a8f56",
    "limitations": [
      "Only the accounts payable ledger was examined."
    ],
    "red_flags": [
      {
        "amount_at_risk": 18450,
        "classification": "billing_scheme_duplicate_payment",
        "description": "Invoice 4471 from Harbourline Supplies Pty Ltd was paid twice within nine days.",
        "evidence": [
          "Bank payments of 12 March and 21 March 2026"
        ],
        "flag_id": "RF-001",
        "recommended_action": "Ask the supplier to refund the second payment.",
        "severity": "MODERATE"
      }
    ],
    "referral_pathways": [
      "Raise with the client's finance director first."
    ],
    "risk_rating": "MEDIUM",
    "summary": "Two payment patterns in accounts payable need follow-up: a likely duplicate invoice and a supplier with an invalid ABN."
  },
  "correlation_id": "<string>"
}
```

```
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
```

Every response also carries X-Request-ID. Quote it if you write to us about a call.
