Skip to main content

Decisions

Instance-level. Explains a specific Decision (Aₜ) for a given entity at a given timestamp. Deterministic: the same inputs always produce the same explanation.


Explain Decision

POST /decisions/explain

Returns a full explanation of a Decision (Aₜ): the Result (Rₜ) that was evaluated, the strategy and parameters applied, whether the condition fired, and the contribution of each input signal.

Boolean strategies (threshold, percentile, change, z_score, composite): decision is true/false. threshold_applied contains the numeric cutoff compared against the Result (Rₜ).

Equals strategy: decision is the matched label string. label_matched contains it explicitly. threshold_applied is null.

Request Body

ParameterTypeRequiredDescription
condition_idstringRequiredFully qualified condition identifier.
condition_versionstringRequiredExplicit condition version.
entitystringRequiredEntity the Decision (Aₜ) was made for.
timestampdatetimeRequiredISO 8601 UTC. Retrieves the stored Decision (Aₜ) at this timestamp.

Response — DecisionExplanation

ParameterTypeRequiredDescription
decision_typeenumAlwaysboolean | categorical.
decisionboolean|stringAlwaysDecision (Aₜ) value: true/false or matched label.
concept_valuenumber|stringAlwaysThe Result (Rₜ) that was evaluated.
strategy_typeenumAlwaysthreshold | percentile | change | z_score | equals | composite.
threshold_appliednumberConditionalNumeric cutoff. Present for threshold, percentile, change, z_score. null for equals, composite.
label_matchedstringConditionalMatched label for equals strategy. null if no match.
driversarrayAlwayssignal, contribution, value per input signal.

Response Codes

StatusDescription
200DecisionExplanation.
401Unauthorised.
404Decision not found.

TypeScript Example

// Boolean decision
const exp = await client.decisions.explain({
conditionId: "org.high_churn",
conditionVersion: "1.0",
entity: "user_abc123",
timestamp: "2024-03-15T09:00:00Z",
});

console.log(exp.decision_type); // "boolean"
console.log(exp.decision); // true (Aₜ)
console.log(exp.concept_value); // 0.87 (Rₜ)
console.log(exp.threshold_applied); // 0.8

// Categorical decision (equals strategy)
const cat = await client.decisions.explain({
conditionId: "org.segment_check",
conditionVersion: "1.0",
entity: "user_abc123",
timestamp: "2024-03-15T09:00:00Z",
});

console.log(cat.decision_type); // "categorical"
console.log(cat.decision); // "high_risk"
console.log(cat.threshold_applied); // null