Skills › Forensic
Forensic Investigation
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_idstring · uuidRequired
UUID of the client whose ledger is investigated.
investigation_scopeobject
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_testboolean · default true
When true, compare first-digit frequencies with Benford's Law.
round_number_testboolean · default true
When true, flag an unusual share of round-number transactions.
duplicate_testboolean · default true
When true, look for duplicate or near-duplicate payments and invoices.
vendor_abr_checkboolean · default true
When true, check supplier Australian Business Numbers against the register.
threshold_overrideobject
Optional overrides for the default detection thresholds, as a JSON object keyed by test name; an empty object keeps the defaults.
jurisdictionenum
ISO 3166-1 alpha-2 code of the jurisdiction whose rules apply, if known.
AUGBCAUSNZ
alert_levelenum · default standard
How readily the investigation raises a red flag: conservative, standard or aggressive.
conservativestandardaggressive
Returns
Skill executed successfully
skillstringRequired
Example investigate_anomaly
outputobjectRequired
output.artifact_idstring · uuid
output.download_urlstring · default
output.summarystring · default
output.citationsarray of values
output.warningsarray of strings
output.stub_fieldsarray of strings
output.investigation_idstring · uuid
output.risk_ratingenum · default LOW
LOWMEDIUMHIGHCRITICAL
output.red_flagsarray of values
output.benford_result
output.duplicate_analysisobject
output.evidence_checklistarray of strings
output.referral_pathwaysarray of strings
output.limitationsarray of strings
output.forensic_narrativestring · default
correlation_idstringRequired
Errors
StatusTypeWhen
401AUTH.TOKEN_INVALID Authentication required
403PERMISSION.CAPABILITY_DENIED Insufficient permissions
404SKILL.NOT_FOUND Skill not found
422VALIDATION.INVALID_FORMAT Validation error
429RATE_LIMIT.USER Rate limit exceeded
5XXINTERNAL.UNKNOWN Internal server error
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>"
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"param": "<string>",
"retry_after_seconds": "<integer>"
}
}{
"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.