> ## 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 KPIs (assess → case → outcome loop)

> Aggregated prevention metrics for the authenticated organization: assessment decisions, case recommendation events, and assess outcome feedback. Requires secret key with `stats:read`. PSPs may filter by `submerchant_id` (UUID from `psp_submerchants.id`).



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/merchant/prevention-stats
openapi: 3.1.0
info:
  title: Clausum API
  version: 1.4.0
  description: >-
    REST API for real-time fraud risk assessment (pay-in and payout), fraud
    reporting, blocklist management, and event ingestion. API version 1.3.0.
    Create Partner API keys (`clm_pub_*`, `clm_sk_*`) in the dashboard under
    Conexiones → Claves API. Webhook ingest uses separate `clm_wh_*` keys
    (Conexiones → Entrada webhooks).
  contact:
    name: Clausum API Support
    email: api@clausum.ai
    url: https://clausum.ai
servers:
  - url: https://sandbox.clausum.ai
    description: Sandbox — integrators and trials
  - url: https://dashboard.clausum.ai
    description: Production dashboard and Partner API
security:
  - apiKeyAuth: []
tags:
  - name: Risk
    description: Real-time risk scoring for pay-in checkout and sessions.
  - name: Payout
    description: Outbound disbursement and treasury transfer assessment.
  - name: Fraud
    description: Report confirmed fraud and trigger the downstream chain.
  - name: Network
    description: >-
      Collaborative fraud intelligence — publish and query shared signals
      between opt-in participants.
  - name: Blocklists
    description: Manage dynamic blocklists used during assessment.
  - name: Cases
    description: Manage fraud cases (expedientes) and submit them to regulators.
  - name: Events
    description: Ingest raw events from your payment providers.
  - name: System
    description: Health and status checks.
  - name: PSP Submerchants
    description: >-
      PSP submerchant registry and scoped API keys (requires
      submerchants:read/write).
  - name: Merchant
    description: Partner merchant API — stats, cases, prevention KPIs, explainability.
paths:
  /api/v1/merchant/prevention-stats:
    get:
      tags:
        - Merchant
      summary: Prevention KPIs (assess → case → outcome loop)
      description: >-
        Aggregated prevention metrics for the authenticated organization:
        assessment decisions, case recommendation events, and assess outcome
        feedback. Requires secret key with `stats:read`. PSPs may filter by
        `submerchant_id` (UUID from `psp_submerchants.id`).
      operationId: merchantPreventionStats
      parameters:
        - name: from
          in: query
          schema:
            type: string
            format: date-time
          description: 'Period start (default: 30 days ago)'
        - name: to
          in: query
          schema:
            type: string
            format: date-time
          description: 'Period end (default: now)'
        - name: submerchant_id
          in: query
          schema:
            type: string
            format: uuid
          description: PSP only — filter metrics to one submerchant
      responses:
        '200':
          description: Prevention stats
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      period:
                        type: object
                        additionalProperties: true
                      assessments:
                        type: object
                        additionalProperties: true
                      case_recommendations:
                        type: object
                        additionalProperties: true
                      outcomes:
                        type: object
                        additionalProperties: true
                      submerchant_id:
                        type: string
                        format: uuid
                        nullable: true
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Submerchant not found
      security:
        - apiKeyAuth: []
components:
  responses:
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiError'
  schemas:
    ApiError:
      type: object
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              properties:
                code:
                  type: string
                message:
                  type: string
                details:
                  type: object
                  additionalProperties: true
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Partner secret or publishable key, e.g. `clm_sk_...` or `clm_pub_...`
        (assess only).
      x-default: clm_sk_your_secret_key

````

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