CredForge: Business Rule Engine (BRE) API¶
The BRE API provides programmatic access to our comprehensive Business Rule Engine (BRE) platform, delivering enhanced decision making using customised workflows.
Base URL¶
Variables¶
| Variable | Description | Format | Source |
|---|---|---|---|
client_id |
Unique identifier for your organization | Alphanumeric string | Provided by Credeau during onboarding |
auth_token |
Secret token for API authentication | Alphanumeric string | Provided by Credeau during onboarding |
workflow_endpoint |
Unique API identifier for the workflow you want to execute | Alphanumeric string | Generated during strategy formation |
workflow_name |
Name of the workflow, representing a strategy | Alphanumeric string | Generated during strategy formation |
user_id |
Unique identifier for an end user | Alphanumeric string, max 64 chars | Generated by your application |
reference_id |
Unique identifier for each loan application (lead_id). One customer can have many. | Alphanumeric string | Generated by your application |
app_user_id |
Unique identifier for an end user registered on MobileGator SDK, if Integrated | Alphanumeric string, max 64 chars, non-PII | Generated by your application |
request_id |
Unique identifier for each request | Alphanumeric string | Generated by the API |
⚠️ Note
Keep these credentials secure and never share them publicly. These credentials are unique to your organization and will be used to authenticate all API requests.
Endpoint Pattern¶
Authentication¶
The API requires two authentication headers:
| Header | Value |
|---|---|
x-client-id |
<client_id> |
x-auth-token |
<auth_token> |
and, one content type header:
| Header | Value |
|---|---|
Content-Type |
application/json |
Request Parameters¶
Request Body (JSON)¶
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | Unique identifier of the user |
reference_id |
string | Yes | Unique identifier for each loan application (lead_id). One customer can have many. |
input_data |
json | Yes | Input parameters required to execute the workflow |
⚠️ Note
Fields in
input_datavary depending upon the workflow being executed. Refer to the individual BRE pages for the required fields.
Response¶
HTTP 200 OK (Success)¶
When a workflow is successfully executed and a decision is made:
{
"request_id": "<request_id>",
"user_id": "<user_id>",
"reference_id": "<reference_id>",
"workflow_version_path": "workflow_<workflow_name>_<version>",
"engine_history": [],
"output_data": {
"ecm": {},
"rules_output": {},
"features": {}
}
}
⚠️ Note
Fields in
output_datavary depending upon the workflow being executed. Refer to the individual BRE pages for the response fields.
Error Responses¶
HTTP 401 Unauthorized (Wrong credentials)¶
This error occurs when either an invalid client ID or authentication token is provided in the request headers.
⚠️ Note
If you receive this error:
- Verify that you're using the correct client ID and authentication token
- Contact Credeau support
HTTP 403 Forbidden (Invalid Access)¶
This error can occur when the requesting IP address is not whitelisted in the Credeau firewall. For security reasons, all API requests must originate from pre-approved IP addresses.
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<center><h1>403 Forbidden</h1></center>
</body>
</html>
⚠️ Note
To resolve this error:
- Contact Credeau support to whitelist your IP address
- Provide your organization's name and the IP address(es) that need access
- Once whitelisted, you'll be able to access the API from the approved IP addresses
HTTP 422 Unprocessable Content (Wrong Request Payload)¶
This error is returned when any of the required parameters is missing from the request payload.
{
"detail": [
{
"type": "missing",
"loc": ["body", "user_id"],
"msg": "Field required",
"input": {
"reference_id": "...",
"fetched_timestamp": "...",
"raw_data": "...",
"format_type": "..."
}
}
]
}
HTTP 429 Too Many Requests (Rate Limit Exceeded)¶
This error is returned when the rate of requests exceeds the allowed limit of 500 requests per minute per IP.
Best Practice for Rate Limit Handling
When implementing retries for rate-limited requests:
- Use exponential backoff: Start with a base delay (e.g., 1 second) and double it after each retry
- Add jitter: Include random variation (±20%) to the delay to prevent thundering herd problems
import random
import time
def get_retry_delay(attempt, base_delay=1, max_delay=60):
# Calculate exponential backoff
delay = min(base_delay * (2 ** attempt), max_delay)
# Add jitter (±20%)
jitter = delay * 0.2
return delay + random.uniform(-jitter, jitter)
HTTP 500 Internal Server Error¶
This error is returned when the passed input contains unexpected values in correct format.
Workflow¶
A Workflow is a programmatic representation of a business strategy to drive a decision based on custom requirements and respective input variables.
A Workflow can contain the following components in an order that justifies a business strategy:
- ECM (External Connection Manager) — Fetches data from external sources (Bureau, 3rd Party APIs, etc.) using pre-defined configurable templates for commonly used sources (CIBIL, Crif, Experian, Equifax, and some 3rd party APIs)
- Feature Engine — Executes custom logic in the form of Python functions to generate variables from the fetched data and raw data provided by the user
- Rule Engine — Applies business rules on the raw/fetched/generated variables to make a decision
Example¶
-
Input Data — Raw applicant information passed into the workflow
Field Description nameFull name of the applicant dobDate of birth panPAN number emailEmail address mobileMobile number addressResidential address incomeAnnual income occupationOccupation type loan_amtLoan amount requested -
Rule Engine — Basic Checks — Eligibility screening on raw input
age>= 18income>= 50,000occupationin['Salaried', 'Self Employed']addressnot in blacklisted pincodes- Decision:
Proceedif all conditions pass, elseReject
-
ECM — Bureau Report — Fetch credit bureau data for the applicant
- Uses
pan,dob, andmobileto pull the bureau report - Output: Raw bureau report
- Uses
-
Feature Engine — Bureau Features — Derive meaningful variables from bureau data
- Processes the raw bureau report through custom Python functions
- Output: Computed bureau features (e.g.,
bureau_score,obligations,bounces)
-
Rule Engine — Bureau Checks — Credit assessment based on bureau features
bureau_score>= 600obligations<= 20,000bounces<= 1- Decision:
Proceedif all conditions pass, elseReject
-
ECM — Account Aggregator — Fetch banking/financial data for the applicant
- Uses
pan,dob, andmobileto pull the account aggregator report - Output: Raw account aggregator report
- Uses
-
Feature Engine — Account Features — Derive variables from banking data
- Processes the account aggregator report through custom Python functions
- Output: Computed account features (e.g.,
obligations,bounces,avg_balance)
-
Rule Engine — Account Aggregator Checks — Final assessment based on banking data
obligations<= 20,000bounces<= 1- Decision:
Approvedif all conditions pass, elseReject
Reading the Output¶
In the workflow output, look for the following keys for the final decision:
Where <key> can be one of the following:
Decision— Final decision of the workflow. Values likeApprove,Reject,Proceed To Bank, etc.DecisionReason— Reason for the decision. Values likegeocoding bre checked,bureau bre checked, etc.LoanAmount— Approved loan amount. Values like50000,100000, etc.EmiDecision— Decision for EMI loan products.LoanOffers— List of approved EMI loan offers.
For Payday/Bullet Loans¶
output_data → rules_output → final_decision → Decision— the decisionoutput_data → rules_output → final_decision → LoanAmount— the approved fixed amount
For EMI Loans¶
output_data → rules_output → final_decision → EmiDecision— the decisionoutput_data → rules_output → final_decision → LoanOffers— list of approved loan offers
Available BREs¶
Select the BRE that matches your use case and refer to its dedicated documentation for request parameters, response structure, and configuration details.
| BRE | Endpoint | Description |
|---|---|---|
| Location BRE | POST /execute/${client_id}/location_bre |
Decision based on location information |
| Bureau Mobile BRE | POST /execute/${client_id}/bureau_mobile_bre |
Decision based on Mobile & Bureau Intelligence |
| Bank BRE | POST /execute/${client_id}/bank_bre |
Decision based on banking transaction data |
| Bureau Mobile Bank BRE | POST /execute/${client_id}/bureau_mobile_bank_bre |
Decision based on Account, Mobile & Bureau Intelligence |
| Repeat BRE | POST /execute/${client_id}/repeat_bre |
Decision for repeat customers |
Consideration¶
This is a highly customisable API that can serve multiple business strategies. Thus, the fields mentioned in input_data and output_data in the individual BRE pages are not limited to the provided values, and will change as per the requirements of the strategy.
Hence, this documentation acts as the integration guide for developers, and the actual API documentation with detailed fields and descriptions will be provided by Credeau's team post strategy finalisation.