> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clausum.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Prevention analytics & explainability

> Partner KPIs, assess explainability export, and read-only replay for disputes and audit.

## Prevention KPIs

`GET /api/v1/merchant/prevention-stats` returns aggregated metrics for the **assess → case recommendation → outcome** loop:

* **assessments** — decision counts and block rate
* **case\_recommendations** — recommendation events, pending without case, auto-created cases
* **outcomes** — feedback reported via `POST /api/v1/assess/outcome`

Requires a secret key (`clm_sk_*`) with `stats:read`.

```bash theme={null}
curl -s -H "Authorization: Bearer $CLM_SECRET_KEY" \
  "https://dashboard.clausum.ai/api/v1/merchant/prevention-stats?from=2026-09-01T00:00:00Z"
```

### PSP submerchant filter

PSPs can scope KPIs to one child merchant:

```bash theme={null}
curl -s -H "Authorization: Bearer $CLM_SECRET_KEY" \
  "https://dashboard.clausum.ai/api/v1/merchant/prevention-stats?submerchant_id=<psp_submerchants.uuid>"
```

## Explainability export

For chargebacks, regulatory requests, or internal audit:

```bash theme={null}
curl -s -H "Authorization: Bearer $CLM_SECRET_KEY" \
  "https://dashboard.clausum.ai/api/v1/merchant/assess-sessions/ps_abc123/explainability"
```

CSV export:

```bash theme={null}
curl -s -H "Authorization: Bearer $CLM_SECRET_KEY" \
  "https://dashboard.clausum.ai/api/v1/merchant/assess-sessions/ps_abc123/explainability?format=csv" \
  -o explainability.csv
```

The package includes SHA-256 integrity metadata for archival workflows.

## Read-only replay

Compare today's rule set against a historical session without persisting:

```bash theme={null}
curl -s -X POST -H "Authorization: Bearer $CLM_SECRET_KEY" \
  "https://dashboard.clausum.ai/api/v1/merchant/assess-sessions/ps_abc123/replay"
```

Response includes `diff.decision_changed`, `diff.score_delta`, and signal codes added/removed.

## Operations

Production SQL order and cron monitoring: see **`docs/PRODUCTION_CORE_LOOP_CHECKLIST.md`** in the repository.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.