Decisioning Contexts

A decisioning context is the boundary around a decision — a mortgage case, a loan application, an onboarding journey. It contains exactly the records, contributions, relationships, and rule evaluations relevant to that decision. Data within one context cannot leak into another.

Endpoints

Method
Path
Description

POST

/contexts

Create a context

GET

/contexts

List contexts

GET

/contexts/{contextId}

Get a context

PATCH

/contexts/{contextId}

Update context metadata

PUT

/contexts/{contextId}/status/{targetStatus}

Lifecycle transition

DELETE

/contexts/{contextId}

Delete a context

Two status dimensions

Contexts carry two independent status dimensions:

Business status

The business lifecycle, managed explicitly by you:

active ⇄ completed → archived
Status
Meaning

active

The decision is in progress. Accepts new evidence, pipeline processing is live.

completed

The decision has been made. The context is frozen for the customer but remains queryable.

archived

Cold storage. No new records, contributions, or evidence can be added.

The transition from active to completed is reversible — a completed context can be reopened to active if it receives a late correction or amendment. The transition to archived is permanent.

Freshness

The pipeline state, managed automatically by the platform:

Value
Meaning

resolved

All evidence has been processed.

stale

New evidence has arrived but has not been processed yet.

computing

The platform is currently processing.

These dimensions are independent. A context can be completed (business decision made) and stale (late evidence being processed) at the same time.

Create a context

Request

Field
Required
Description

name

No

Human-readable name

type

No

Classification (e.g., mortgage_application, onboarding)

metadata

No

Arbitrary key-value pairs for customer-defined properties

Response 201 Created

A new context starts with status: active and freshness: resolved (no evidence yet).

Get a context

Returns the context with both status dimensions.

Pass ?include=summary to add record counts, rule evaluation outcomes, and staleness indicators:

List contexts

Supports standard filtering and sorting.

Useful filters

Update context metadata

Updates context metadata — name, type, and customer-defined properties. status and freshness are not modifiable through PATCH.

Request

Response 200 OK

Returns the full updated context.

Lifecycle transition

Transitions the business lifecycle. The server validates that the transition is permitted.

Examples

Completing a context does not affect its freshness — if evidence is still being processed, the pipeline converges independently.

Reopening a completed context transitions it back to active, allowing new evidence and pipeline processing to resume.

Archiving a context freezes it entirely — no new records, contributions, or evidence can be added. Archival is permanent and cannot be reversed.

Error cases

Scenario
Status

Invalid transition (e.g., archivedactive)

422 Unprocessable Entity

Delete a context

Performs a soft delete — the context is excluded from list results but retained with all its data for auditing.

Precondition

The context must be in archived status. If not, the request is rejected with 409 Conflict.

Scenario
Status

Context not archived

409 Conflict

Response 204 No Content

Resolution

When evidence arrives (via contribution ingestion or record update), the containing context is marked stale. The platform's resolution pipeline automatically processes stale contexts — claiming the context, running the full resolution pass, and atomically persisting the results. The context transitions through computing and back to resolved when processing completes.

You do not need to trigger resolution manually. To observe convergence, either poll the context's freshness field or subscribe to webhook events.

Last updated