Skip to main content

BRE connector — endpoints

How to call the connector. The formal schema is the OpenAPI specification (Business Rules Engine, openapi/source/connector/bre/bre.yml); this page covers the call contract and examples. Internal processing is in the architecture reference; caveats in the implementation notes.

Authentication

All /v1/rules/* endpoints require a bearer token (OAuth2 client-credentials JWT). Health endpoints are unauthenticated probes.

MethodPathPurpose
POST/v1/rules/{ruleKey}/evaluateEvaluate a rule
GET/v1/rulesList rules (no JDM)
GET/v1/rules/{ruleKey}Get a rule (with JDM)
POST/v1/rulesCreate a rule
PUT/v1/rules/{ruleKey}Update a rule
DELETE/v1/rules/{ruleKey}Deactivate a rule
GET/health · /health/readiness · /health/livenessProbes (see the architecture reference)

ruleKey is a human-readable unique id (1–100 chars, e.g. prospect-risk-scoring).


POST /v1/rules/{ruleKey}/evaluate — evaluate

Evaluates the active rule against a context object (arbitrary JSON passed straight to the decision engine; missing fields are treated as null).

// Request
{ "context": { "age": 32, "income": 85000, "employmentStatus": "FULL_TIME" } }
// Response (EvaluateRuleResponse)
{ "result": { "riskScore": 42, "riskBand": "LOW", "eligible": true },
"ruleKey": "prospect-risk-scoring", "ruleVersion": 3 }
  • 404 BRE004001 if no active rule has that key (a DRAFT/INACTIVE rule is not evaluable).
  • 500 with BRE100002 (function timeout), BRE100003 (max depth exceeded), BRE100001 (other evaluation error), or BRE100004 (rule JDM could not be loaded).

GET /v1/rules — list

Returns { data: RuleSummary[] } (metadata only — JDM excluded), newest first.

GET /v1/rules/{ruleKey} — get

Returns { data: RuleDetail } including the full jdm graph. 404 BRE004001 if unknown.

POST /v1/rules — create

BodyCreateRuleRequest: ruleKey, name, jdm (required), optional description, status. The jdm is validated as a loadable JDM decision model — an invalid graph returns 400. Created at version: 1, status defaults to ACTIVE. Returns { id, ruleKey, version, status } (201).

PUT /v1/rules/{ruleKey} — update

BodyUpdateRuleRequest: any of name, description, jdm, status. A supplied jdm is re-validated (400 if invalid). The version auto-increments and the cached decision is evicted. Returns { ruleKey, version, status }. This is an upsert: if the ruleKey does not exist it is created at version: 1 (which requires name and jdm, otherwise 400); if it exists it is updated and the version auto-increments. Setting status: ACTIVE re-activates a deactivated rule.

DELETE /v1/rules/{ruleKey} — deactivate

Soft delete: sets status: INACTIVE (the row is kept) and evicts the cache. Returns { ruleKey, status }. 404 BRE004001 if unknown.


Errors

HTTPCodeWhen
400GEN000000 / BRE000001Body/params fail schema validation (GEN000000); or jdm is not a valid decision model (BRE000001)
404BRE004001No (active) rule for the key
500BRE100001Engine evaluation error
500BRE100002Function node exceeded its time limit (50 ms)
500BRE100003Decision recursion exceeded max depth (5)
500BRE100004Rule JDM could not be parsed/loaded