Decision matrices (staff)
Decision matrices API reference
Base path: /decision-matrices
Tag: Decision Matrices
Auth: Bearer JWT + permissions.
7.1 Create
POST /decision-matricesPermission: Create Auto Decisions
Request body (CreateDecisionMatrixDto)
name
string (3–100)
Yes
Unique per organisation
productId
UUID
Yes
Active product for the org
isActive
boolean
No
Default true (may be forced inactive if workflow publish pending)
authoringMode
FREE_TEXT | CATALOG
No
Default FREE_TEXT
workflowId
UUID
No
Decisioning publish workflow
organizationId
string
No
Mida only — create for another org
scoringRules
ScoringRuleDto[]
Yes
Weights should sum to 100
decisionRules
DecisionRuleDto[]
Yes
Score bands
ScoringRuleDto
parentVariable
Required
Optional (resolved from catalog)
parentVariableCatalogId
Forbidden
Required
weight
Required (0–100)
Required
subVariables
Required array
Required array
SubVariableDto
name
Required
Optional (resolved)
condition
Required
Optional denormalized
score
Required (1–100)
Required (1–100)
subvariableCatalogId
Forbidden
Required
operator
Forbidden
Required
value
—
For EQ/NEQ/LT/LTE/GT/GTE
min / max
—
For BETWEEN
values
—
For IN
DecisionRuleDto
label
DecisionLabel
Yes
minScore / maxScore
number 0–100
Yes
Band
decision
DecisionType
Yes
amountApproved
number 0–100
Yes
% of requested amount
tenureApproved
number ≥ 0
No
Months
action
DecisionAction
Yes
FREE_TEXT example
Known FREE_TEXT parent names used by the scorer:
Bank Relationship
Demographic Analysis
Income
DTI
Contact Details
Character
Residual Balance
Transactions/Inflow Count
CATALOG example
Response data (create / get by id)
Full matrix with nested rules — see the source Google Doc for the complete nested example. Get-by-id also includes publishReviews when present.
7.2 List
Permission: View Auto Decision
Query (DecisionMatrixFilterDto)
organizationId
string
No
Mida only
search
string
No
Name contains
status
boolean
No
isActive
publishStatus
enum
No
productId
string
No
startDate / endDate
date string
No
createdAt range
page
number
No
Default 1
limit
number
No
Default 10, max 100
7.3 Get by id
Permission: View Auto Decision
Response data is the full matrix object as in create response (§7.1), plus publishReviews when applicable.
7.4 Update
Permission: Edit Auto Decision
Request body (UpdateDecisionMatrixDto) is PartialType(CreateDecisionMatrixDto) — all create fields optional.
Important rules
Changing
authoringModerequires sending a full newscoringRulesset for that mode.Do not mix FREE_TEXT and CATALOG fields for the active mode.
Matrices with a publish workflow typically reset toward draft and re-submit for publish after update (see workflow doc).
7.5 Other matrix endpoints (summary)
GET
/decision-matrices/stats
View
Org totals: total / active / applications decisioned
GET
/decision-matrices/application-score/:appId
View
Internal ApplicationScoring rows for a Forms app
GET
/decision-matrices/application-run/:appId/run
Create
Run internal auto-decision for a Forms submission
PUT
/decision-matrices/:id
Edit
Update (§7.4)
PATCH
/decision-matrices/:id/toggle-status
Edit
{ "isActive": true | false }
DELETE
/decision-matrices/:id
Auth
Soft/hard delete per service rules
PATCH
/decision-matrices/attach-matrix-to-form/:formId/:decisionMatrixId
Create
Attach matrix to form (same product)
DELETE
/decision-matrices/:matrixId/forms/:formId
Edit
Detach form
POST
/decision-matrices/:id/attach-workflow
Edit
{ "workflowId": "…" }
DELETE
/decision-matrices/:id/workflow
Edit
Detach workflow
POST
/decision-matrices/:id/submit-for-publish
Edit
Optional { "note": "..." }
POST
/decision-matrices/:id/publish-review
Create Approval Workflow
{ "action": "...", "comment": "..." }
8. FREE_TEXT vs CATALOG at runtime
External evaluate does not take an authoring-mode flag.
Client sends
decisionMatrixId.Backend loads the matrix (
isActive: true, matchingorgKey).calculateAutoDecisionScorebranches ondecisionMatrix.authoringMode:FREE_TEXT→ legacy parent-name switch + string condition parsersCATALOG→ catalog code metrics + structured operator /conditionValue
So which path runs is entirely determined by how the matrix was authored.
9. Error cases
Invalid DTO / missing loan.amount
400
Unknown / inactive matrix for org
404
Midax analyze failure
400
Unknown bank analysisId on get/callback
404
Unknown external decisioning result id
404
Rerun missing stored accountId
400
Non-Mida user passes organizationId on list matrices
403
FREE_TEXT payload with catalog IDs (or reverse)
400
CATALOG missing operator / value shape
400
10. Quick checklist
Staff (Forms UI / API)
Create product
Create matrix (
FREE_TEXTorCATALOG) with weights = 100Ensure matrix is active / published as required by org workflow
Copy
decisionMatrixIdfor external clients
External client — bank statement (optional standalone)
POST /external-bank-statement/analyzewithorgKey, statement URL,callbackUrlReceive Midax callback on your URL or poll
GET /external-bank-statement/:analysisId
External client — decisioning
Ensure Midax has completed bank-statement analysis for the Mono/
accountIdPOST /external-decisioning/evaluatewithorgKey, matrix id,applicationData.loan.amount,bankStatement.accountIdUse
referenceIdfor idempotent retriesUse
POST /external-decisioning/:id/rerunafter matrix updatesList / filter with
GET /external-decisioning?orgKey=...
Endpoint index
POST
/external-bank-statement/analyze
Public
GET
/external-bank-statement/:analysisId
Public
POST
/webhooks/external-bank-statement
Public (Midax→Forms)
POST
/external-decisioning/evaluate
Public
GET
/external-decisioning
Public
GET
/external-decisioning/:id
Public
POST
/external-decisioning/:id/rerun
Public
POST
/decision-matrices
JWT
GET
/decision-matrices
JWT
GET
/decision-matrices/:id
JWT
PUT
/decision-matrices/:id
JWT
PATCH
/decision-matrices/:id/toggle-status
JWT
DELETE
/decision-matrices/:id
JWT