Credit File Assembly API
Local case storage, document extraction, assembly checks and officer review. No KYC deployment, bank connection or language model is required.
Download OpenAPI specification ↓
Evaluation boundary
Use fictional data only. Bound to loopback with matching Host and Origin validation. There is no institutional authentication, encryption at rest, tenant isolation or verified reviewer identity. This is not a production bank endpoint. Case details, extracted text and original files persist in local SQLite.
API calls
| Method | Path | Purpose |
|---|---|---|
| GET | /api/config | Module configuration; no KYC dependency |
| GET | /api/cases | List locally stored cases |
| POST | /api/cases | Create an independent credit case |
| POST | /api/sample | Load fictional sample evidence |
| GET | /api/cases/{caseId} | Retrieve case, evidence metadata and history |
| POST | /api/cases/{caseId}/details | Save officer-verified borrower and financial inputs |
| POST | /api/cases/{caseId}/config | Configure case evidence requirements; KYC reference is optional |
| POST | /api/cases/{caseId}/kyc-reference | Attach an officer-entered reference; not authenticated approval |
| POST | /api/cases/{caseId}/documents | Upload and locally extract evidence |
| POST | /api/cases/{caseId}/documents/{documentId} | Confirm document review/reconciliation, or remove evidence |
| GET | /api/cases/{caseId}/documents/{documentId} | Download original evidence bytes |
| POST | /api/cases/{caseId}/process | Compute deterministic checks, clear prior review and model draft |
| POST | /api/cases/{caseId}/review | Record human disposition; acceptance blocked by findings |
| POST | /api/cases/{caseId}/advisory | Explicit optional loopback model draft; no change to checks or approval |
| GET | /api/cases/{caseId}/memo | Download printable HTML memorandum |
| GET | /api/cases/{caseId}/export | Download ZIP of memorandum, record and original evidence |
Request sequence
- Create a case with an empty JSON object.
- Upload documents to their node, then verify extracted inputs and document review.
- Include the current integer
versionin every case mutation. A stale version returns409; reload rather than blindly retrying. - Run checks and inspect findings/cited illustrative sources.
- Record a disposition. Acceptance is rejected while blocking findings remain.
- Export the evidence ZIP. Any input/evidence/settings change clears the prior assessment/review.
Uploads & extraction
Base64 JSON uploads:10MB per file,50MB and30 documents per case. Text PDF extraction uses pypdf, with a30-page limit. Optional Apple Vision image/scanned-PDF extraction is local to this Mac (10 scanned PDF pages). Source page references accompany labelled-field suggestions. Reviewing/correcting extraction does not verify document authenticity.
Optional integrations
KYC is disabled by default. Enabling a KYC reference accepts only an officer-entered source and case ID; it does not call a KYC API or trust an external approval. An optional loopback Ollama adapter sends only check facts and illustrative source texts. No bank identifiers or raw documents enter that prompt. A model cannot clear findings, record a review or approve a facility.
Rules and calculations
The four ASSEMBLY source records are illustrative file-assembly requirements, not a regulatory corpus or bank-approved lending policy. Ratios use Decimal arithmetic; missing/non-positive denominators return unavailable. No automatic credit threshold is invented. Accepting a file does not sanction credit or write a facility to core banking.
Modularity
Domain, extraction, store, optional adapters and export are separate Python modules. Each is owned by the credit assembler. Removing or stopping the KYC application does not affect this module.
Tool-selecting evidence agent
Select Run evidence agent in the workspace. Private Qwen chooses evidence inspection, deterministic checks and reference retrieval tools. Execution is asynchronous, with real tool events and a cited advisory draft. Human approval remains separate; the agent has no customer, account or credit authorisation tools.
POST /api/cases/{caseId}/agent— Start read-only tool-selecting credit evidence agentGET /api/cases/{caseId}/agent/{jobId}— Poll case-scoped agent events and advisory draft
Use fictional data. Public deployments require the same session cookie when polling. Credit requests require the current case version. KYC accepts only a minimised evidence summary. Illustrative references do not establish regulatory compliance.