Developers
Everything you need to call the Credit Engine API.
Postman collection
Import the collection, then set the base_url and api_key collection variables. Every request is pre-wired with Authorization: Bearer {{api_key}}.
Also at docs/Credit_Engine_API.postman_collection.json.
Quickstart (curl)
# 1. Sign up (or grab a key from the API keys page)
curl -X POST http://localhost:3000/api/signup \
-H "Content-Type: application/json" \
-d '{"email":"you@lender.com","org_name":"Acme Lending","password":"change-me-8+"}'
# 2. Call the Credit Engine with your key
curl -X POST http://localhost:3000/v1/evaluate \
-H "Authorization: Bearer {{api_key}}" \
-H "Content-Type: application/json" \
-d '{
"bureau": "crif",
"report": { "crif": {
"scoreData": { "score": 770 },
"demographics": { "age": 34, "employmentType": "salaried" },
"incomeAssessment": { "monthlyIncome": 60000, "foir": 28 },
"requestedAmount": 30000
}}
}'Optional intelligence blocks on
POST /v1/evaluateEvery block below is optional and purely additive. Each one derives extra inputs — it never decides anything. Omit a block and the field it would have produced is simply absent, which the engine treats as default-deny, so the decision is byte-for-byte what it would have been without it. Whether any of these fields matters is decided by your rules: reference them from a condition_ast knockout or a scorecard factor.
| Block | Module | What you get |
|---|---|---|
"features": true | F1 — feature factory | Generates ~3,500 named features (metric × window [7/30/60/90/180/365d] × product × count|sum|max|avg|trend|ratio), persists the vector against the decision, and returns the top contributors. Only the features your active policy names are merged into the decision input. |
device { … } | F2 — device intelligence | model, os_version, is_rooted, is_emulator, sim_age_days, loan_apps_installed_count, app_install_age_days → device_is_emulator, device_is_rooted, device_sim_new, device_loan_apps_excess. An emulator hard-blocks by default (KO_DEVICE_EMULATOR). |
location { … } | F4 — location intelligence | lat, lng, ip, declared_pincode, permission_denied → location_gps_pincode_match, location_ip_country, location_pincode_risk, location_permission_denied. Pincode risk is tenant-editable. |
fraud { … } | B5 — ring clustering | applicant_ref, pincode, ip, beneficiary_account, agent_id → pincode spikes, IP clusters, beneficiary reuse (mule hard-block), agent/geo anomalies. |
bank_summary { … } | M13 + F1 | Income, EMI, balance, bounces. Add declared_monthly_income / declared_emi and a transactions[] array to unlock the bank-statement feature families and the declared-vs-detected mismatch features. |
# Same call, with the optional intelligence blocks attached
curl -X POST http://localhost:3000/v1/evaluate \
-H "Authorization: Bearer {{api_key}}" \
-H "Content-Type: application/json" \
-d '{
"bureau": "crif",
"report": { "crif": { "scoreData": { "score": 770 } } },
"features": true,
"device": { "is_emulator": false, "is_rooted": false,
"sim_age_days": 820, "loan_apps_installed_count": 2 },
"location": { "lat": 12.977, "lng": 77.60, "ip": "203.0.113.9",
"declared_pincode": "560001" },
"fraud": { "applicant_ref": "BORROWER-9f2c", "pincode": "560001",
"beneficiary_account": "50100123456789" }
}'
# -> response gains "features" { count, vector_hash, top_contributors, used_by_policy }
# and "fraud" { fraud_score, score_breakdown, signals, device, location }API reference
| Method | Path | Description |
|---|---|---|
| POST | /api/signup | Create a tenant + admin user + first API key (public) |
| GET | /v1/health | Liveness / readiness |
| POST | /v1/evaluate | Bureau report → priced offer (Credit Engine) |
| POST | /v1/decisions | Deterministic decision from applicant fields |
| POST | /v1/decisions/preview | What-if, no persist |
| GET | /v1/decisions/{id} | Fetch a decision + re-explanation |
| GET | /v1/rule-sets | List policy versions |
| POST | /v1/rule-sets | Create a draft policy |
| POST | /v1/rule-sets/{id}/activate | Activate a policy |
| GET | /v1/scorecards | List scorecards |
| POST | /v1/scorecards | Create / score a scorecard |
| POST | /v1/backtest | Backtest a policy over CSV/rows |
| GET | /v1/credit/backtest | Synthetic-book backtest |
| GET | /v1/usage | Metered usage vs plan quota |
| GET | /v1/decisions/{id}/features | Generated feature vector for a decision (F1) |
| GET | /v1/fraud/config | Fraud / device / location thresholds |
| PUT | /v1/fraud/config | Update thresholds (per tenant) |
| GET | /v1/fraud/alerts | Fraud ring alerts |
| PATCH | /v1/fraud/alerts/{id} | Acknowledge / close an alert |
| GET | /v1/fraud/pincode-risk | Pincode risk overrides (F4) |
| PUT | /v1/fraud/pincode-risk | Set pincode risk (F4) |
| POST | /v1/agents/underwrite | Underwriting agent (orchestrates the engine) |
| POST | /v1/agents/collections | Collections agent |