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}}.

Download collection

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/evaluate

Every 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.

BlockModuleWhat you get
"features": trueF1 — feature factoryGenerates ~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 intelligencemodel, 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 intelligencelat, 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 clusteringapplicant_ref, pincode, ip, beneficiary_account, agent_id → pincode spikes, IP clusters, beneficiary reuse (mule hard-block), agent/geo anomalies.
bank_summary { … }M13 + F1Income, 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
MethodPathDescription
POST/api/signupCreate a tenant + admin user + first API key (public)
GET/v1/healthLiveness / readiness
POST/v1/evaluateBureau report → priced offer (Credit Engine)
POST/v1/decisionsDeterministic decision from applicant fields
POST/v1/decisions/previewWhat-if, no persist
GET/v1/decisions/{id}Fetch a decision + re-explanation
GET/v1/rule-setsList policy versions
POST/v1/rule-setsCreate a draft policy
POST/v1/rule-sets/{id}/activateActivate a policy
GET/v1/scorecardsList scorecards
POST/v1/scorecardsCreate / score a scorecard
POST/v1/backtestBacktest a policy over CSV/rows
GET/v1/credit/backtestSynthetic-book backtest
GET/v1/usageMetered usage vs plan quota
GET/v1/decisions/{id}/featuresGenerated feature vector for a decision (F1)
GET/v1/fraud/configFraud / device / location thresholds
PUT/v1/fraud/configUpdate thresholds (per tenant)
GET/v1/fraud/alertsFraud ring alerts
PATCH/v1/fraud/alerts/{id}Acknowledge / close an alert
GET/v1/fraud/pincode-riskPincode risk overrides (F4)
PUT/v1/fraud/pincode-riskSet pincode risk (F4)
POST/v1/agents/underwriteUnderwriting agent (orchestrates the engine)
POST/v1/agents/collectionsCollections agent