Risk Magnitude
Status:
stableCategory:compositeAdded:2026-06-03Last reviewed:2026-06-03
Summary
The standalone "how much" readout. /magnitude/compute accepts the
same permissive input as /cdri/compute
(any subset of the 14 instruments plus optional demographics) and
returns just the magnitude block — the seven phenotype-named severities,
an overall_magnitude, and a ranked ordering — plus confidence and
any red_flags. It does not return a cdri_score, a phenotype
distribution, or per-finding detail.
Use it when you want the per-pattern severity vector without the full composite envelope — for example to drive a dashboard that charts the seven magnitudes, or to rank which pattern is strongest for a subject.
⚠ Not a clinical diagnosis
Magnitudes are risk severities, not diagnoses. See the CDRI disclaimer.
Endpoint
| Field | Value |
|---|---|
| Method | POST |
| Path | /api/magnitude/compute |
| Full URL | https://engine.tripod-health.com/api/magnitude/compute |
| Authentication | API key (required) |
| Request body | application/json |
| Rate-limited | Yes |
Request
Headers, query parameters (recommend, audience), body shape
(instruments + optional demographics), partial-instrument handling,
ORT sex-conditioning, and the de-identification filter are identical
to /cdri/compute. This
endpoint does not take situation/onset (that is the
acuity endpoint).
{
"instruments": {
"depression_screen": { "responses": { "item_1": 3, "item_2": 3, "item_3": 2, "item_4": 3, "item_5": 2, "item_6": 3, "item_7": 2, "item_8": 1, "item_9": 1 } },
"orebro": { "responses": { "item_1": 4, "item_2": 5, "item_3": 4, "item_4": 6, "item_5": 6, "item_6": 4, "item_7": 5, "item_8": 6, "item_9": 6, "item_10": 4, "item_11": 6, "item_12": 6, "item_13": 4, "item_14": 5, "item_15": 4, "item_16": 6, "item_17": 6, "item_18": 4, "item_19": 4, "item_20": 5, "item_21": 4 } }
},
"demographics": { "age_bracket": "35-44", "sex": "female", "occupation_class": "office", "region": "CA" }
}
Response
Success — 200 OK
Live capture against production with ?recommend=rules (a
psychosocially-loaded subject). Real engine output.
{
"composite_id": "magnitude",
"magnitudes": {
"pain_dominant": 0.5,
"psychosocial_dominant": 0.731,
"fear_avoidance_dominant": 0.5,
"rtw_barrier": 0.5,
"multi_domain_catastrophic": 0.65,
"iatrogenic_escalation": 0.5,
"established_chronicity": 0.62
},
"overall_magnitude": 0.731,
"ranked": [
"psychosocial_dominant",
"multi_domain_catastrophic",
"established_chronicity",
"fear_avoidance_dominant",
"iatrogenic_escalation",
"pain_dominant",
"rtw_barrier"
],
"matrix_version": "2026-06-02-first-pass",
"red_flags": [
{
"code": "complex_case_review",
"severity": "urgent",
"rule_id": "rec.escalation.multi_domain_catastrophic_top2",
"rule_version": "1.0.0",
"detail": "Phenotype 'multi_domain_catastrophic' appears in the top-two of the classifier's distribution.",
"triggers": {
"phenotype.top_name": "psychosocial_dominant",
"phenotype.second_name": "multi_domain_catastrophic"
}
},
{
"code": "suicide_risk_assessment",
"severity": "urgent",
"rule_id": "rec.escalation.phq9_item9_suicidality",
"rule_version": "1.0.0",
"detail": "PHQ-9 item 9 response is at or above the positive threshold. Widely-used screening frameworks treat any non-zero item-9 response as a trigger for follow-up risk assessment regardless of total PHQ-9 score.",
"triggers": { "depression_screen.item_9": 1 }
}
],
"confidence": {
"overall": 0.5547,
"tier": "medium",
"breakdown": {
"input_completeness": 0.5,
"imputation_variance": 1,
"model_certainty": 0.1825
}
},
"recommendations": {
"engine_version": "1.0.0",
"ruleset_version": "1.0.0",
"disclaimer": "The Trinity Engine is a decision-support tool. Output is not medical advice, not a diagnosis, not a prescription, and not a benefits determination. The calling organization is responsible for clinical governance and for the interpretation and use of these suggestions.",
"ai_summary": null,
"items": [ "... see /cdri/compute for the recommendation item shape ..." ],
"suppressed": [],
"cardinality_cap": null
},
"depth": "full",
"catalog_version": "0.13.0",
"request_id": "docs-magnitude",
"timestamp": "2026-06-03T04:21:42.866684+00:00"
}
The
recommendations.itemspayload is shown in full on the CDRI doc; the item shape is identical here. This capture had two urgent escalations, also surfaced inred_flags.
Response fields
| Field | Type | Description |
|---|---|---|
composite_id | string | Always "magnitude". |
magnitudes | object | Seven phenotype-named severities (0.0–1.0). Same semantics as CDRI magnitudes. |
overall_magnitude | number | null | The peak of the seven magnitudes. |
ranked | array<string> | The seven phenotype names ordered highest-magnitude first. A convenience ordering so callers do not have to sort magnitudes themselves. |
matrix_version | string | null | Opaque version tag for the active scoring configuration. Do not pin. |
red_flags | array | Safety escalations. Same shape as CDRI red flags. Independent of ?recommend=. |
confidence | object | Same shape as CDRI confidence. |
recommendations | object | null | Same shape and modes as CDRI recommendations; null under ?recommend=off. |
depth | string | Always "full". |
catalog_version | string | Catalog version served. |
request_id | string | Correlation ID. |
timestamp | string (ISO 8601 UTC) | Server time. |
There is no findings, phenotype, or cdri_score in this response.
Reach for /cdri/compute when you need
those.
Examples
curl
curl -sS -X POST "https://engine.tripod-health.com/api/magnitude/compute?recommend=rules" \
-H "apikey: $ENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"instruments": {
"depression_screen": { "responses": { "item_1": 3, "item_2": 3, "item_3": 2, "item_4": 3, "item_5": 2, "item_6": 3, "item_7": 2, "item_8": 1, "item_9": 1 } },
"orebro": { "responses": { "item_1": 4, "item_2": 5, "item_3": 4, "item_4": 6, "item_5": 6, "item_6": 4, "item_7": 5, "item_8": 6, "item_9": 6, "item_10": 4, "item_11": 6, "item_12": 6, "item_13": 4, "item_14": 5, "item_15": 4, "item_16": 6, "item_17": 6, "item_18": 4, "item_19": 4, "item_20": 5, "item_21": 4 } }
},
"demographics": { "age_bracket": "35-44", "sex": "female", "occupation_class": "office", "region": "CA" }
}'
Python (requests)
# Uses the call() helper from quickstart.md.
result = call("POST", "/api/magnitude/compute?recommend=rules", body)
print(f"strongest pattern: {result['ranked'][0]} ({result['overall_magnitude']})")
for name in result["ranked"]:
print(f" {name:26} {result['magnitudes'][name]:.3f}")
Status codes
Same as /cdri/compute.
Related
- composite-cdri-compute.md — the full composite (score + phenotype + findings + magnitudes + acuity).
- composite-acuity-compute.md — the "how urgent" readout.
- composite-phenotype-classify.md — the "which pattern" readout.
Change history
| Date | Change |
|---|---|
| 2026-06-03 | Initial publication (Risk Magnitude split out as a standalone surface). |