POST /v1/score

Score one AI-assisted interaction. Returns updated JIS, dimensions, decay, compliance.

What this is

The core scoring call. Submit one interaction, receive the operator's updated JIS and the full breakdown.

When to use

Every AI-assisted decision, scored in real time inside your middleware layer. For historical replay or nightly import, use POST /v1/score/batch instead.

Request

curl -X POST https://api.cohesionauth.com/v1/score \
  -H "X-API-Key: $COHESION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "session_id": "sess-001",
    "operator_id": "analyst-42",
    "domain": "financial",
    "interaction": {
      "ai_recommendation_presented": true,
      "time_to_decision_ms": 1800,
      "decision": "modified",
      "modification_extent": 0.3,
      "ai_available": true,
      "scenario_type": "standard",
      "outcome_correct": null,
      "hover_events": 2,
      "scroll_depth": 0.7,
      "alternative_views_checked": 1
    }
  }'

Python

resp = client.score(session_id="...", operator_id="...", domain="financial", interaction={...})

TypeScript

const resp = await client.score({ session_id: "...", operator_id: "...", domain: "financial", interaction: {...} });

Response (abridged)

{
  "jis": 74.3,
  "displayed_jis": 74.3,
  "band": "adequate",
  "dimensions": {
    "deferral_resistance": 78,
    "error_detection": 71,
    "independent_performance": 72,
    "deliberation_depth": 76,
    "post_error_recalibration": 80,
    "domain_confidence": 70,
    "decision_autonomy": 73
  },
  "decay_projection": {
    "current_jis": 74.3,
    "current_trend": -0.8,
    "domain": "financial",
    "decay_rate": 0.012,
    "decay_acceleration": 0.001,
    "floor": 40.0,
    "recovery_rate": 0.005,
    "days_to_non_compliance": 120,
    "projections": [{ "day": 30, "jis": 70.1 }, { "day": 90, "jis": 64.8 }]
  },
  "compliance": {
    "band": "adequate",
    "status": "compliant",
    "jis": 74.3,
    "article14_met": true,
    "action_required": false,
    "thresholds": { "min_jis": 60, "target_jis": 75 }
  },
  "maintenance_recommendation": {
    "urgency": "low",
    "trigger_intervention": false,
    "recommendation": {
      "intervention_type": "calibration_injection",
      "intervention_frequency": 0.05,
      "recommend_withhold": false,
      "reasons": ["error_detection below target"],
      "next_assessment": "2026-07-11T18:22:10.432Z"
    }
  },
  "mode": "standard",
  "provisional": false,
  "committed": true,
  "dimensions_computed": 7,
  "session_id": "sess-001",
  "request_id": "req_01H...",
  "timestamp": "2026-04-22T18:22:10.432Z"
}

Note: maintenance_recommendation.urgency values are none, low, medium, high, or critical. The alpha/beta/projected_30d shape in older SDK versions is retired; decay_projection now carries the fields above.

Valid enums

Limits

Errors you might see

StatusCodeMeaning
400INVALID_JSONBody was not valid JSON
422VALIDATION_FAILEDEnum or range violated
401UNAUTHORIZEDBad key
429RATE_LIMITEDBack off

Try it

Open in the playground.

Next step

Score more at once: POST /v1/score/batch.