Concepts
Organisation — your tenant. Every record belongs to exactly one organisation and is isolated by row-level security. Borrower — a business or individual with a minimal profile; PAN and GSTIN are encrypted and returned masked. Consent record — must cover a document category before that document is processed. Application — a credit request with a server-enforced lifecycle: draft → submitted → documents_pending → processing → analysis_complete → under_review → decision_recorded.
Document — an uploaded file, processed asynchronously. Financial analysis — the fhe-1.0 indicators, each with a status of ok, insufficient_data or not_meaningful. Risk assessment — five separate signals plus factors and reason codes. Policy version — immutable once published.
Authentication
Integrations use API keys: Authorization: Bearer clk_test_… (sandbox) or clk_live_… (production orgs only). Keys are scoped (borrowers:read, borrowers:write, applications:write, documents:write, analysis:run, risk:read, policies:read|write, portfolio:read, audit:read, webhooks:manage). The secret is shown once and stored as an HMAC.
Human-only actions are never available to keys, whatever the scope: recording credit decisions, completing reviews, approving policies, managing members, billing and key management.
Rotation: POST /v1/api-keys/{id}/rotate with {"grace_hours": 24} returns a new secret. The old one keeps working until the grace window ends.
Sandbox
Sign up to create a sandbox organisation (14 days, test keys only, synthetic data only). Load the synthetic sample borrower Aarav Components Private Limited from the app Overview, or with POST /v1/sandbox/load-sample in a signed-in session. Its outputs are deterministic: risk index 34, policy outcome refer on R2 and R4, DSCR 1.42.
Idempotency & pagination
Send Idempotency-Key on POSTs. Repeating a request with the same key and body returns the original response with Idempotent-Replayed: true. Reusing a key with a different body returns 422 IDEMPOTENCY_MISMATCH.
Lists are cursor-paginated: ?limit=25&cursor=… (max 100), and responses include has_more and next_cursor.
Errors
Errors use RFC 9457 application/problem+json, with a stable code (for example CONSENT_REQUIRED, DOC_TYPE_MISMATCH, INVALID_TRANSITION or RATE_LIMITED), a request_id and, for validation errors, an errors[] list of fields. Stack traces are never returned.
Webhooks
Events: document.processed, document.failed, analysis.completed, risk_assessment.completed, application.status_changed, decision.recorded, policy.published. URLs must use https and resolve to a public address.
Verify X-CreditLens-Signature: t=<unix>,v1=<hex> by computing HMAC-SHA256 over t + "." + raw_body with your signing secret, and reject requests where |now − t| > 300 s. Failed deliveries retry at 1 m, 5 m, 30 m, 2 h, 6 h and 24 h.
Tutorial: analyse a bank statement end-to-end
POST /v1/borrowers→ borrower idPOST /v1/borrowers/{id}/consents(signed-in user; consent is a human attestation)POST /v1/applicationswithsubmit: truePOST /v1/documents/upload(multipart: file, borrower_id, application_id, optional category) → 202- Wait for the
document.processedwebhook, or pollGET /v1/documents/{id}/status POST /v1/risk-assessments→ signals, factors and reason codes;GET /v1/financial-analysis/{id}/evidence?metric=dscr→ the transactions behind the metric
SDKs
Python and Node SDKs are planned and will be generated from the OpenAPI document. Until then, use any HTTP client. See the API reference.