API Reference
Complete REST API documentation for AuditCore's Auditable Decision Engine.
Every endpoint is designed for regulated industries requiring full decision traceability.
Base URL
Authentication
The current demo API is open for evaluation. Production deployments support API key authentication via the Authorization: Bearer <key> header.
Quick Start
Run a fully auditable decision in one API call:
Core Endpoints
Returns all supported decision domains with metadata including rule counts, evidence sources, and UI configuration.
200 Response
Returns pre-configured test scenarios for a specific domain. Useful for demos and integration testing.
| Parameter | Type | Description |
|---|---|---|
| domain | string required | Domain ID: health, insurance, or finance |
200 Response
Runs a full 7-stage decision pipeline: Risk Classification → Evidence Gathering → Rule Checking → Structured Reasoning → Confidence Scoring → Decision Gate → Audit Chain. Returns the complete decision record with full explainability.
Request Body
| Field | Type | Description |
|---|---|---|
| domain | string required | health, insurance, or finance |
| query | string optional | Natural language description of the decision request |
| context | object required | Domain-specific input data (see domain schemas below) |
Finance Context Schema
| Field | Type | Description |
|---|---|---|
| credit_score | int | Credit score (300–850) |
| dti_ratio | float | Debt-to-income ratio (0–1) |
| ltv_ratio | float | Loan-to-value ratio (0–1+) |
| loan_type | string | conventional, fha, va, jumbo |
| employment_years | float | Years of employment |
| loan_amount | int | Requested loan amount in USD |
Health Context Schema
| Field | Type | Description |
|---|---|---|
| patient_age | int | Patient age in years |
| conditions | string[] | Active medical conditions |
| current_medications | string[] | Current medications |
| proposed_treatment | string | Treatment being evaluated |
| allergies | string[] | Known allergies |
| informed_consent | bool | Whether patient consent has been obtained |
Insurance Context Schema
| Field | Type | Description |
|---|---|---|
| policy_status | string | active, lapsed, cancelled, expired |
| claim_type | string | collision, comprehensive, liability, etc. |
| covered_types | string[] | Types covered by the policy |
| claim_amount | int | Claim amount in USD |
| max_per_claim | int | Maximum payout per claim |
| deductible | int | Policy deductible in USD |
200 Response
Tier 3: AI-Autonomous Conversation
The Conversation Engine conducts a guided, multi-turn dialogue to gather all inputs needed for a decision. The AI asks domain-specific questions, validates answers, and proposes a decision — the human approves or sends it back. Every exchange is auditable.
Starts a new AI-driven conversation session for a given domain. Returns a greeting, the first question, and a session ID for subsequent replies.
Request Body
| Field | Type | Description |
|---|---|---|
| domain | string required | health, insurance, or finance |
Response
Sends the user's answer. The engine parses, validates, acknowledges, and returns either the next question or a decision proposal (when all required fields are collected).
Request Body
| Field | Type | Description |
|---|---|---|
| session_id | string required | Session ID returned from /api/conversation/start |
| answer | string required | User's free-text answer (parsed automatically based on question type) |
Question Types
| Type | Parsing | Example Input |
|---|---|---|
| text | Raw text | "Evaluate mortgage application" |
| number | Extracts first number (strips $ and ,) | "$300,000" → 300000 |
| boolean | yes/no/true/false detection | "Yes, confirmed" → true |
| choice | Fuzzy match against options | "conventional" or "FHA" |
| list | Multi-match against options | "hypertension, diabetes" |
Response (Next Question)
Response (Proposal)
Explainability
Compare two decision outcomes by modifying input parameters. Essential for EU AI Act compliance, ECOA adverse-action explanations, and sensitivity analysis.
Request Body
200 Response
Returns original vs. modified decision summaries, input deltas, outcome shift analysis, and a pivotal flag indicating whether the change flipped the decision.
Audit & Compliance
Returns the complete audit trail for a domain — every decision record with full SHA-256 hash chain linking.
| Parameter | Type | Description |
|---|---|---|
| domain | string optional | Domain ID. Defaults to health |
200 Response
Array of decision records with record_hash and previous_record_hash fields forming a verifiable chain.
Performs full cryptographic verification of the audit chain. Detects any tampered, modified, or missing records.
200 Response
Generates and downloads a compliance-ready PDF audit report. Includes cover page with executive summary, per-record detail pages with confidence breakdowns, rule results, evidence, and cryptographic chain verification status.
200 Response
Returns application/pdf binary with Content-Disposition: attachment.
Returns aggregate statistics about decisions: total count, escalation rate, average confidence, and chain integrity status.
200 Response
Integrity Testing
Deliberately corrupts a record in the audit trail to demonstrate tamper detection. For demo/testing purposes only.
Request Body
Restores a previously tampered record and re-verifies the chain integrity.
Request Body
Configuration
Returns the current rule thresholds and escalation policy for a domain. All thresholds can be adjusted without code changes.
200 Response
Update decision thresholds and escalation settings. Changes are applied immediately to the live agent — no restart required.
Request Body
Resets the agent for the specified domain — clears audit trail, restores default policy, and re-initializes the decision pipeline.
Error Handling
All errors return a JSON object with an error field:
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad request — invalid JSON, missing fields, or unknown domain |
| 404 | Endpoint not found |
| 500 | Internal server error — check request body format |