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.
| Method | Path | Purpose |
|---|---|---|
POST | /v1/rules/{ruleKey}/evaluate | Evaluate a rule |
GET | /v1/rules | List rules (no JDM) |
GET | /v1/rules/{ruleKey} | Get a rule (with JDM) |
POST | /v1/rules | Create a rule |
PUT | /v1/rules/{ruleKey} | Update a rule |
DELETE | /v1/rules/{ruleKey} | Deactivate a rule |
GET | /health · /health/readiness · /health/liveness | Probes (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 BRE004001if no active rule has that key (aDRAFT/INACTIVErule is not evaluable).500withBRE100002(function timeout),BRE100003(max depth exceeded),BRE100001(other evaluation error), orBRE100004(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
Body — CreateRuleRequest: 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
Body — UpdateRuleRequest: 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
| HTTP | Code | When |
|---|---|---|
400 | GEN000000 / BRE000001 | Body/params fail schema validation (GEN000000); or jdm is not a valid decision model (BRE000001) |
404 | BRE004001 | No (active) rule for the key |
500 | BRE100001 | Engine evaluation error |
500 | BRE100002 | Function node exceeded its time limit (50 ms) |
500 | BRE100003 | Decision recursion exceeded max depth (5) |
500 | BRE100004 | Rule JDM could not be parsed/loaded |