{"openapi":"3.1.0","info":{"title":"Ironbark","summary":"AU compliance intelligence — machine-to-machine, per query.","description":"Ironbark is the AU business trust scoring platform. AI agents and humans\ncall the same API to verify Australian business entities, score them against\nsix public-register sources, and check AUSTRAC Tranche 2 obligations.\n\n## Free, no auth (rate-limited per IP)\n- `GET /v1/trust-score/{abn}` — composite Trust Score + six sub-scores\n- `POST /v1/trust-score/{abn}` — same with optional entity_name_hint\n- `POST /v1/ask` — natural-language AU compliance Q&A with citations\n- `POST /v1/eligibility/check` — AUSTRAC Tranche 2 rule-engine determination\n- `GET /v1/eligibility/services` — catalogue of designated services\n- `GET /v1/credits/pricing` — current pricing (ex-GST + inc-GST)\n- `GET /.well-known/agent.json` — machine-readable capabilities manifest\n\n## Authenticated (OAuth 2.0 client credentials, scoped tokens)\n- `POST /v1/scans/full` — PEP/sanctions scan with risk assessment in one call\n- `POST /v1/scans/batch` — batched scan submission\n- `POST /v1/cases` — create a compliance case from a scan\n- `POST /v1/monitoring` — enrol an entity for ongoing monitoring\n\nGet a token: POST `/v1/oauth/token` with `grant_type=client_credentials`.\n\n## Methodology\nTrust Score methodology v1.1 is published at\n[ironbarkaml.com.au/methodology](https://ironbarkaml.com.au/methodology).\nEvery weight, source, and refresh cadence is auditable. Published beats proprietary.\n\n## Disclaimer\nIronbark outputs are produced by automated systems and do not constitute\nlegal advice. Confirm all compliance obligations with a qualified AML/CTF\ncompliance officer or solicitor.","contact":{"name":"Ironbark API","url":"https://ironbarkaml.com.au/api","email":"support@ironbark.ai"},"license":{"name":"Terms of Service","url":"https://ironbarkaml.com.au/legal/terms"},"version":"0.1.0"},"servers":[{"url":"https://api.ironbarkaml.com.au","description":"Production"}],"paths":{"/v1/oauth/token":{"post":{"tags":["auth"],"summary":"Token","description":"Issue an OAuth 2.0 access token via client credentials grant.\n\nOnly grant_type=client_credentials is supported.\nScopes are determined by the client registration — callers cannot request\na broader set than was granted at registration time.","operationId":"token_v1_oauth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_token_v1_oauth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/acp/jobs":{"post":{"tags":["acp"],"summary":"Submit Job","description":"Accept an ACP job from a buyer agent.\nValidates service exists, creates DB record, executes service, evaluates result.\nReturns structured result for evaluator contract to validate on-chain.","operationId":"submit_job_acp_jobs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/acp/jobs/{acp_job_id}":{"get":{"tags":["acp"],"summary":"Get Job","description":"Retrieve job status and result by ACP job ID.","operationId":"get_job_acp_jobs__acp_job_id__get","parameters":[{"name":"acp_job_id","in":"path","required":true,"schema":{"type":"string","title":"Acp Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scans/full":{"post":{"tags":["scans"],"summary":"Full Scan","description":"Combined scan + AML risk assessment in a single call.\n\nCreates a persistent scan record immediately — the scan_id in the response\ncan be used with GET /v1/scans/{scan_id} for idempotent retrieval.\n\nGraceful degradation: if the sanctions list has not been populated yet\n(no pipeline run), returns empty matches with source_staleness=\"no_data\".\nThe risk assessment still runs on supplied risk_profile fields.","operationId":"full_scan_v1_scans_full_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/scans/{scan_id}":{"get":{"tags":["scans"],"summary":"Get Scan","description":"Idempotent scan retrieval by scan_id.\n\nNameScan added GET-by-scanId in v3.1 only. Ironbark has this from day 1\non all entity types (person + organisation).\n\nReturns the full scan result + risk assessment exactly as delivered at\nscan time. Safe to call multiple times — no re-billing, no re-execution.","operationId":"get_scan_v1_scans__scan_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"scan_id","in":"path","required":true,"schema":{"type":"string","title":"Scan Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scans/batch":{"post":{"tags":["batch"],"summary":"Create Batch Scan","description":"Submit a batch of up to 100 entities for async scanning.\n\nReturns 202 Accepted immediately with a job_id.\nProcessing runs in the background — poll GET /v1/scans/batch/{job_id} for status.\nOptional webhook_url receives a batch.completed event when all items finish.","operationId":"create_batch_scan_v1_scans_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchScanRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/scans/batch/{job_id}":{"get":{"tags":["batch"],"summary":"Get Batch Job","description":"Poll batch job status and per-item results.\n\nReturns the job status plus all item scan_ids once processing is complete.\nSafe to poll repeatedly — idempotent.","operationId":"get_batch_job_v1_scans_batch__job_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/cases":{"post":{"tags":["cases"],"summary":"Create Case","description":"Create a compliance case from an existing scan.\n\nLooks up the scan, creates the case with decision=pending, and seeds\nthe audit log with a case_created event. Returns the full case response.","operationId":"create_case_v1_cases_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCaseRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/cases/{case_id}":{"get":{"tags":["cases"],"summary":"Get Case","description":"Retrieve a compliance case with its full audit log.","operationId":"get_case_v1_cases__case_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/cases/{case_id}/decision":{"patch":{"tags":["cases"],"summary":"Log Decision","description":"Record a compliance decision on an existing case.\n\nAppends a decision_logged event to the audit log.\nMultiple decisions are allowed — each creates a new audit row.\nThe case.decision field reflects the most recent ruling.","operationId":"log_decision_v1_cases__case_id__decision_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/cases/{case_id}/report":{"get":{"tags":["cases"],"summary":"Get Case Report","description":"Generate a regulator-ready PDF report for a compliance case.\n\nThe PDF includes:\n- Case details (ID, entity, reviewer, decision)\n- Scan summary (risk level, match count)\n- Chronological audit log\n- SHA-256 integrity hash in the footer\n\nReturns application/pdf with Content-Disposition: attachment.","operationId":"get_case_report_v1_cases__case_id__report_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/eligibility/check":{"post":{"tags":["eligibility"],"summary":"AUSTRAC Tranche 2 eligibility check","description":"Public, no auth. Pure rule-engine evaluation against the AML/CTF Act 2006 (as amended by the Tranche 2 expansion). Returns whether the entity must register with AUSTRAC, the triggering services, obligations, rule references, and the enrolment URL. Rate-limited 60 requests / 60s per IP.","operationId":"check_austrac_eligibility_v1_eligibility_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EligibilityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EligibilityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/eligibility/services":{"get":{"tags":["eligibility"],"summary":"List AUSTRAC designated services","description":"Public, no auth. Returns the catalogue of designated service keys an agent or human can pass to POST /v1/eligibility/check. Filter by profession_type to scope the list. Rate-limited 60 requests / 60s per IP.","operationId":"get_designated_services_v1_eligibility_services_get","parameters":[{"name":"profession_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profession Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Designated Services V1 Eligibility Services Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/pricing":{"get":{"tags":["credits"],"summary":"Get Pricing","description":"Return all pricing tiers and PAYG packs with ex-GST and inc-GST prices.\n\nNo auth required — this is a public marketing endpoint.\nNameScan shows ex-GST only with a confusing disclaimer.\nIronbark shows both on every pricing surface.","operationId":"get_pricing_v1_credits_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Pricing V1 Credits Pricing Get"}}}}}}},"/v1/credits/balance":{"get":{"tags":["credits"],"summary":"Get Balance","description":"Return balance summary for an account.","operationId":"get_balance_v1_credits_balance_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"query","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Balance V1 Credits Balance Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/credits/ledger":{"get":{"tags":["credits"],"summary":"Get Ledger Endpoint","description":"Return paginated ledger history for an account, newest first.\nThe ledger is the authoritative source of truth for all credit movements.","operationId":"get_ledger_endpoint_v1_credits_ledger_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"account_id","in":"query","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Ledger Endpoint V1 Credits Ledger Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stripe/checkout":{"post":{"tags":["stripe"],"summary":"Create Checkout Session","description":"Create a Stripe-hosted Checkout Session for a PAYG credit pack purchase.\n\nReturns a Stripe checkout URL — redirect the user there to complete payment.\nCredits are only granted after the webhook confirms payment (not here).\nPrices are charged in AUD inc-GST (10% AU GST applied at checkout).","operationId":"create_checkout_session_v1_stripe_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Create Checkout Session V1 Stripe Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/monitoring":{"get":{"tags":["monitoring"],"summary":"List Enrolments","description":"List active monitoring enrolments for the account.","operationId":"list_enrolments_v1_monitoring_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EnrolmentResponse"},"type":"array","title":"Response List Enrolments V1 Monitoring Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["monitoring"],"summary":"Enrol","description":"Enrol an entity for ongoing monitoring.","operationId":"enrol_v1_monitoring_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrolmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/monitoring/{enrolment_id}":{"delete":{"tags":["monitoring"],"summary":"Unenrol","description":"Unenrol an entity from ongoing monitoring.","operationId":"unenrol_v1_monitoring__enrolment_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"enrolment_id","in":"path","required":true,"schema":{"type":"string","title":"Enrolment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/trust-score/{abn}":{"post":{"tags":["trust-score"],"summary":"Compute Trust Score for an ABN","description":"Returns a 0-100 composite plus six sub-scores following the Ironbark Trust Score methodology (v1.1). The algorithm is pure and documented publicly at /methodology. Sanctions matching requires an `entity_name_hint` until ABR ingestion ships in Phase 2.","operationId":"compute_v1_trust_score__abn__post","parameters":[{"name":"abn","in":"path","required":true,"schema":{"type":"string","title":"Abn"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustScoreRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["trust-score"],"summary":"Fetch Trust Score for an ABN (no name hint)","description":"Convenience endpoint — equivalent to POST with no entity_name_hint. Sanctions sub-score will default-clean since no name match can run.","operationId":"fetch_v1_trust_score__abn__get","parameters":[{"name":"abn","in":"path","required":true,"schema":{"type":"string","title":"Abn"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrustScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/trust-score/methodology/version":{"get":{"tags":["trust-score"],"summary":"Current Trust Score methodology version","operationId":"methodology_version_v1_trust_score_methodology_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Methodology Version V1 Trust Score Methodology Version Get"}}}}}}},"/v1/newsletter/subscribe":{"post":{"tags":["newsletter"],"summary":"Subscribe an email address","description":"Email capture for the trust-score soft-gate and other surfaces. DB-persisted with UPSERT on email. Provider sync (Loops) is best-effort — endpoint returns 200 even if provider fails.","operationId":"subscribe_v1_newsletter_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/ask":{"post":{"tags":["ask"],"summary":"Ask Ironbark — AU compliance Q&A","description":"Natural-language AU compliance question answered with citations and a disclaimer. Scoped to AUSTRAC, ASIC, ABR, DFAT sanctions, ATO, Fair Work, PPSR, and state trades licensing. Not legal advice.","operationId":"ask_v1_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","description":"Health check — returns status of DB, Redis, last pipeline run, ACP state.\nRailway uses this for service health gating.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AskRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":5,"title":"Question"},"context":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Context"},"freshness":{"type":"string","pattern":"^(day|week|month|year)$","title":"Freshness","default":"month"}},"type":"object","required":["question"],"title":"AskRequest"},"AskResponse":{"properties":{"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"},"citations":{"items":{"$ref":"#/components/schemas/CitationModel"},"type":"array","title":"Citations"},"disclaimer":{"type":"string","title":"Disclaimer"},"queried_at":{"type":"string","title":"Queried At"},"token_usage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Token Usage"}},"type":"object","required":["question","answer","citations","disclaimer","queried_at","token_usage"],"title":"AskResponse"},"AuditEventResponse":{"properties":{"event_type":{"type":"string","title":"Event Type"},"actor":{"type":"string","title":"Actor"},"event_data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Event Data"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["event_type","actor","event_data","created_at"],"title":"AuditEventResponse"},"BatchEntityRequest":{"properties":{"entity_type":{"$ref":"#/components/schemas/EntityType"},"name":{"type":"string","maxLength":512,"minLength":1,"title":"Name"},"dob":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dob"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"nationality_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nationality Code"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"risk_profile":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Risk Profile"}},"type":"object","required":["entity_type","name"],"title":"BatchEntityRequest"},"BatchJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"total_items":{"type":"integer","title":"Total Items"},"completed_items":{"type":"integer","title":"Completed Items"},"failed_items":{"type":"integer","title":"Failed Items"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"created_at":{"type":"string","title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"items":{"items":{"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["job_id","status","total_items","completed_items","failed_items","webhook_url","created_at","completed_at","items"],"title":"BatchJobResponse"},"BatchScanRequest":{"properties":{"entities":{"items":{"$ref":"#/components/schemas/BatchEntityRequest"},"type":"array","maxItems":100,"minItems":1,"title":"Entities"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"Called with batch.completed event when all items finish"}},"type":"object","required":["entities"],"title":"BatchScanRequest"},"Body_token_v1_oauth_token_post":{"properties":{"grant_type":{"type":"string","title":"Grant Type"},"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"}},"type":"object","required":["grant_type","client_id","client_secret"],"title":"Body_token_v1_oauth_token_post"},"CaseResponse":{"properties":{"case_id":{"type":"string","title":"Case Id"},"scan_id":{"type":"string","title":"Scan Id"},"reviewer":{"type":"string","title":"Reviewer"},"decision":{"type":"string","title":"Decision"},"decision_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision Notes"},"scan_summary":{"type":"object","title":"Scan Summary"},"audit_log":{"items":{"$ref":"#/components/schemas/AuditEventResponse"},"type":"array","title":"Audit Log"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["case_id","scan_id","reviewer","decision","decision_notes","scan_summary","audit_log","created_at","updated_at"],"title":"CaseResponse"},"CheckoutRequest":{"properties":{"account_id":{"type":"string","title":"Account Id","description":"Ironbark account ID to credit on payment"},"pack_index":{"type":"integer","maximum":3.0,"minimum":0.0,"title":"Pack Index","description":"Index into PAYG pack list (0=10 credits, 1=50, 2=200, 3=1000)"}},"type":"object","required":["account_id","pack_index"],"title":"CheckoutRequest"},"CitationModel":{"properties":{"url":{"type":"string","title":"Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"}},"type":"object","required":["url"],"title":"CitationModel"},"CreateCaseRequest":{"properties":{"scan_id":{"type":"string","title":"Scan Id","description":"UUID of an existing scan"},"reviewer":{"type":"string","maxLength":256,"minLength":1,"title":"Reviewer","description":"Reviewer identifier (email or name)"}},"type":"object","required":["scan_id","reviewer"],"title":"CreateCaseRequest"},"DecisionRequest":{"properties":{"decision":{"type":"string","pattern":"^(pending|true_match|false_positive)$","title":"Decision","description":"pending | true_match | false_positive"},"reviewer":{"type":"string","maxLength":256,"minLength":1,"title":"Reviewer"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Reviewer notes (stored in audit log)"}},"type":"object","required":["decision","reviewer"],"title":"DecisionRequest"},"EligibilityRequest":{"properties":{"profession_type":{"type":"string","title":"Profession Type","description":"Profession category. One of: real_estate_agent, accountant, lawyer, precious_metals_dealer, trust_company_service_provider.","examples":["accountant"]},"services_offered":{"items":{"type":"string"},"type":"array","title":"Services Offered","description":"List of service_key strings the entity provides. Call GET /v1/eligibility/services to discover valid keys.","examples":[["company_trust_formation","client_money_management"]]},"is_already_registered":{"type":"boolean","title":"Is Already Registered","description":"True if the entity is already registered with AUSTRAC.","default":false},"is_afsl_holder":{"type":"boolean","title":"Is Afsl Holder","description":"True if the entity holds an AFSL. Only relevant for accountants — financial planning trigger does not apply to AFSL holders.","default":false},"annual_revenue_aud":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Annual Revenue Aud","description":"Optional annual revenue in AUD. Used for risk tier calibration only."}},"type":"object","required":["profession_type"],"title":"EligibilityRequest"},"EligibilityResponse":{"properties":{"must_register":{"type":"boolean","title":"Must Register"},"registration_deadline":{"type":"string","title":"Registration Deadline"},"risk_tier":{"type":"string","title":"Risk Tier"},"obligations":{"items":{"type":"string"},"type":"array","title":"Obligations"},"triggering_services":{"items":{"type":"string"},"type":"array","title":"Triggering Services"},"triggering_service_labels":{"items":{"type":"string"},"type":"array","title":"Triggering Service Labels"},"applicable_rules":{"items":{"type":"object"},"type":"array","title":"Applicable Rules"},"exemptions_applied":{"items":{"type":"string"},"type":"array","title":"Exemptions Applied"},"recommended_actions":{"items":{"type":"string"},"type":"array","title":"Recommended Actions"},"confidence":{"type":"number","title":"Confidence"},"is_already_registered":{"type":"boolean","title":"Is Already Registered"},"profession_type":{"type":"string","title":"Profession Type"},"disclaimer":{"type":"string","title":"Disclaimer"},"enrolment_url":{"type":"string","title":"Enrolment Url"}},"type":"object","required":["must_register","registration_deadline","risk_tier","obligations","triggering_services","triggering_service_labels","applicable_rules","exemptions_applied","recommended_actions","confidence","is_already_registered","profession_type","disclaimer","enrolment_url"],"title":"EligibilityResponse"},"EnrolRequest":{"properties":{"scan_id":{"type":"string","title":"Scan Id"},"entity_name":{"type":"string","title":"Entity Name"},"entity_type":{"type":"string","title":"Entity Type"}},"type":"object","required":["scan_id","entity_name","entity_type"],"title":"EnrolRequest"},"EnrolmentResponse":{"properties":{"enrolment_id":{"type":"string","title":"Enrolment Id"},"account_id":{"type":"string","title":"Account Id"},"scan_id":{"type":"string","title":"Scan Id"},"entity_name":{"type":"string","title":"Entity Name"},"entity_type":{"type":"string","title":"Entity Type"},"active":{"type":"boolean","title":"Active"},"enrolled_at":{"type":"string","title":"Enrolled At"}},"type":"object","required":["enrolment_id","account_id","scan_id","entity_name","entity_type","active","enrolled_at"],"title":"EnrolmentResponse"},"EntityType":{"type":"string","enum":["person","organisation"],"title":"EntityType"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobRequest":{"properties":{"service_id":{"type":"string","title":"Service Id","description":"Service identifier e.g. 'austender_feed'"},"buyer_agent_address":{"type":"string","title":"Buyer Agent Address","description":"Buyer agent wallet address (EVM)"},"usdc_amount":{"type":"number","exclusiveMinimum":0.0,"title":"Usdc Amount","description":"USDC offered for this job"},"chain":{"type":"string","title":"Chain","default":"base_sepolia"},"payload":{"type":"object","title":"Payload","description":"Service-specific query payload"}},"type":"object","required":["service_id","buyer_agent_address","usdc_amount"],"title":"JobRequest"},"JobResponse":{"properties":{"acp_job_id":{"type":"string","title":"Acp Job Id"},"status":{"type":"string","title":"Status"},"service_id":{"type":"string","title":"Service Id"},"result":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["acp_job_id","status","service_id"],"title":"JobResponse"},"ScanRequest":{"properties":{"entity_type":{"$ref":"#/components/schemas/EntityType","description":"person | organisation"},"name":{"type":"string","maxLength":512,"minLength":1,"title":"Name","description":"Full name to screen"},"dob":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dob","description":"Date of birth YYYY-MM-DD (person only)"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender","description":"M | F | X (person only)"},"nationality_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nationality Code","description":"ISO 3166-1 alpha-2 (person)"},"incorporation_country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Incorporation Country Code","description":"ISO 3166-1 alpha-2 (org)"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code","description":"Country of operation"},"risk_profile":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Risk Profile","description":"PersonRiskProfile or OrgRiskProfile fields"}},"type":"object","required":["entity_type","name"],"title":"ScanRequest","description":"Unified scan request — person or organisation.\nentity_type determines which fields apply.\n\nPerson fields: name, dob, gender, nationality_code, country_code, risk_profile (PersonRiskProfile)\nOrg fields:    name, country_code, incorporation_country_code, risk_profile (OrgRiskProfile)\n\nrisk_profile is optional — scan runs without it, risk score reflects absence of context."},"ScanResponse":{"properties":{"scan_id":{"type":"string","title":"Scan Id"},"entity_type":{"type":"string","title":"Entity Type"},"entity_name":{"type":"string","title":"Entity Name"},"created_at":{"type":"string","title":"Created At"},"scan_result":{"type":"object","title":"Scan Result"},"risk_assessment":{"type":"object","title":"Risk Assessment"},"metadata":{"type":"object","title":"Metadata"}},"type":"object","required":["scan_id","entity_type","entity_name","created_at","scan_result","risk_assessment","metadata"],"title":"ScanResponse"},"SubScoreBlock":{"properties":{"REG":{"type":"integer","title":"Reg"},"DIR":{"type":"integer","title":"Dir"},"AUS":{"type":"integer","title":"Aus"},"SAN":{"type":"integer","title":"San"},"CRT":{"type":"integer","title":"Crt"},"FRS":{"type":"integer","title":"Frs"}},"type":"object","required":["REG","DIR","AUS","SAN","CRT","FRS"],"title":"SubScoreBlock"},"SubscribeRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"source":{"type":"string","title":"Source","description":"Which surface captured this email"},"turnstile_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Turnstile Token","description":"Cloudflare Turnstile client-side token. Required once TURNSTILE_SECRET_KEY is set on the server (production). Absent secret → verification skipped."}},"type":"object","required":["email","source"],"title":"SubscribeRequest"},"SubscribeResponse":{"properties":{"subscribed":{"type":"boolean","title":"Subscribed"}},"type":"object","required":["subscribed"],"title":"SubscribeResponse"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"},"expires_in":{"type":"integer","title":"Expires In"},"scope":{"type":"string","title":"Scope"}},"type":"object","required":["access_token","token_type","expires_in","scope"],"title":"TokenResponse"},"TrustScoreRequest":{"properties":{"entity_name_hint":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Entity Name Hint","description":"Entity name for sanctions name-matching. Required until ABR ingestion comes online (Phase 2). Without it, sanctions sub-score cannot prove a negative.","examples":["Example Advisory Services Pty Ltd"]},"tranche_2_profession":{"type":"boolean","title":"Tranche 2 Profession","description":"Set True if entity is a Tranche 2 profession (accountant, lawyer, real estate agent, TCSP, precious metals).","default":false},"include_adverse_media":{"type":"boolean","title":"Include Adverse Media","description":"Run an Exa adverse-media search against the entity name. Costs one Exa API call; results cached 30 days. Requires entity_name_hint to be set. Ignored if EXA_API_KEY absent.","default":false}},"type":"object","title":"TrustScoreRequest"},"TrustScoreResponse":{"properties":{"abn":{"type":"string","title":"Abn"},"composite":{"type":"integer","title":"Composite"},"band":{"type":"string","title":"Band"},"sub_scores":{"$ref":"#/components/schemas/SubScoreBlock"},"contributing_risks":{"items":{"type":"string"},"type":"array","title":"Contributing Risks"},"last_refreshed_per_source":{"additionalProperties":{"type":"string"},"type":"object","title":"Last Refreshed Per Source"},"methodology_version":{"type":"string","title":"Methodology Version"},"incomplete_sources":{"items":{"type":"string"},"type":"array","title":"Incomplete Sources","description":"Sources not yet ingested — their sub-scores use default-clean inputs and freshness penalties apply. Resolves to empty list once all pipelines are live (Phase 2 → Phase 3)."},"entity_name_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Name Used"}},"type":"object","required":["abn","composite","band","sub_scores","contributing_risks","last_refreshed_per_source","methodology_version","incomplete_sources","entity_name_used"],"title":"TrustScoreResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"tags":[{"name":"trust-score","description":"Composite 0-100 Trust Score per ABN. Public, no auth."},{"name":"ask","description":"Natural-language AU compliance Q&A. Public, rate-limited."},{"name":"eligibility","description":"AUSTRAC Tranche 2 rule-engine. Public, rate-limited."},{"name":"auth","description":"OAuth 2.0 client credentials token issuance."},{"name":"scans","description":"PEP/sanctions/adverse-media scans. Requires scans:read or scans:write."},{"name":"batch","description":"Batched scan submission. Requires scans:write."},{"name":"cases","description":"Compliance case management. Requires cases:read or cases:write."},{"name":"credits","description":"Account credit balance, pricing, and ledger."},{"name":"monitoring","description":"Ongoing entity monitoring enrolments."},{"name":"newsletter","description":"Email capture for updates."},{"name":"stripe","description":"Stripe Checkout for credit pack purchases."},{"name":"discovery","description":"Machine-readable capabilities manifest."}]}