{
  "components": {
    "schemas": {
      "Account": {
        "properties": {
          "account_type": {
            "enum": [
              "individual",
              "joint"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "external_id",
          "account_type",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "AccountCustomer": {
        "properties": {
          "account_id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "role": {
            "enum": [
              "primary",
              "co_holder"
            ],
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "customer_id",
          "role"
        ],
        "type": "object"
      },
      "AdapterDryRunResult": {
        "properties": {
          "auth_valid": {
            "type": "boolean"
          },
          "config_valid": {
            "type": "boolean"
          },
          "endpoint_results": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "reachable": {
            "type": "boolean"
          }
        },
        "required": [
          "config_valid",
          "reachable",
          "auth_valid",
          "endpoint_results",
          "errors"
        ],
        "type": "object"
      },
      "AgeBucket": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "from_hours": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "to_hours": {
            "description": "0 on the final open-ended bucket",
            "type": "integer"
          }
        },
        "required": [
          "label",
          "from_hours",
          "count"
        ],
        "type": "object"
      },
      "Alert": {
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "provenance": {
            "$ref": "#/components/schemas/AlertProvenance"
          },
          "scenario_id": {
            "type": "string"
          },
          "score": {
            "type": "number"
          },
          "severity": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "transaction_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "AlertDecision": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "alert_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "from_status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "supersedes_id": {
            "nullable": true,
            "type": "string"
          },
          "to_status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "alert_id",
          "from_status",
          "to_status",
          "rationale",
          "actor",
          "created_at"
        ],
        "type": "object"
      },
      "AlertProvenance": {
        "properties": {
          "applied_threshold": {
            "description": "The single value that decided this detection for the customer type and risk tier involved. The rule body is never returned.",
            "type": "number"
          },
          "availability": {
            "description": "not_captured means the alert predates provenance capture; current configuration is never backfilled as historical fact",
            "enum": [
              "available",
              "restricted",
              "missing",
              "not_captured"
            ],
            "type": "string"
          },
          "config_digests": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Digests of every configuration document the producing process had loaded",
            "type": "object"
          },
          "engine_version": {
            "type": "string"
          },
          "evaluated_at": {
            "format": "date-time",
            "type": "string"
          },
          "evaluation_mode": {
            "description": "realtime, batch or both; the same scenario can behave differently under each",
            "type": "string"
          },
          "rule_digest": {
            "description": "Content address of the stored rule version, so a reviewer can confirm the artifact they fetched is the one named",
            "type": "string"
          },
          "rule_name": {
            "description": "Resolved at read time, not persisted",
            "type": "string"
          },
          "rule_version": {
            "type": "integer"
          },
          "scenario_id": {
            "type": "string"
          },
          "window_from": {
            "format": "date-time",
            "type": "string"
          },
          "window_to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "scenario_id",
          "availability"
        ],
        "type": "object"
      },
      "AlertUpdateRequest": {
        "properties": {
          "assigned_team": {
            "type": "string"
          },
          "assigned_to": {
            "type": "string"
          },
          "clear_due_at": {
            "type": "boolean"
          },
          "confirm": {
            "type": "boolean"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "expected_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "resolved_by": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AuditEntry": {
        "properties": {
          "action": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "details": {
            "additionalProperties": true,
            "type": "object"
          },
          "id": {
            "type": "integer"
          },
          "resource_id": {
            "type": "string"
          },
          "resource_type": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "user_id",
          "action",
          "resource_type",
          "resource_id",
          "created_at"
        ],
        "type": "object"
      },
      "BacktestAffectedCustomer": {
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "delta_kind": {
            "description": "Whether the candidate rule set starts alerting on this customer, stops, or changes nothing",
            "enum": [
              "added",
              "removed",
              "unchanged"
            ],
            "type": "string"
          },
          "job_id": {
            "type": "string"
          },
          "scenario_id": {
            "type": "string"
          }
        },
        "required": [
          "job_id",
          "scenario_id",
          "customer_id",
          "delta_kind"
        ],
        "type": "object"
      },
      "BacktestCreateRequest": {
        "properties": {
          "baseline_rule_set_id": {
            "type": "string"
          },
          "candidate_rule_set_id": {
            "type": "string"
          },
          "customer_filter": {
            "additionalProperties": true,
            "type": "object"
          },
          "customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "rerun_of": {
            "type": "string"
          },
          "scenario_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to",
          "candidate_rule_set_id"
        ],
        "type": "object"
      },
      "BacktestJob": {
        "properties": {
          "baseline": {
            "$ref": "#/components/schemas/BacktestResult"
          },
          "baseline_rule_set_id": {
            "type": "string"
          },
          "baseline_rule_version": {
            "type": "integer"
          },
          "candidate": {
            "$ref": "#/components/schemas/BacktestResult"
          },
          "candidate_rule_set_id": {
            "type": "string"
          },
          "candidate_rule_version": {
            "type": "integer"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "config_digests": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_filter": {
            "additionalProperties": true,
            "type": "object"
          },
          "customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "delta": {
            "$ref": "#/components/schemas/BacktestResult"
          },
          "error": {
            "type": "string"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/BacktestMetadata"
          },
          "outcome_analysis": {
            "$ref": "#/components/schemas/BacktestOutcomeAnalysis"
          },
          "processed_customers": {
            "type": "integer"
          },
          "progress": {
            "type": "number"
          },
          "retry_count": {
            "minimum": 0,
            "type": "integer"
          },
          "scenario_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "snapshot_at": {
            "format": "date-time",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "completed",
              "failed",
              "cancelled"
            ],
            "type": "string"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "total_customers": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "from",
          "to",
          "baseline_rule_set_id",
          "candidate_rule_set_id",
          "snapshot_at",
          "progress",
          "retry_count",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "BacktestMetadata": {
        "properties": {
          "baseline_snapshot": {
            "additionalProperties": true,
            "type": "object"
          },
          "candidate_snapshot": {
            "additionalProperties": true,
            "type": "object"
          },
          "cohort_preview": {
            "additionalProperties": true,
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "job_id": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "rerun_of": {
            "type": "string"
          }
        },
        "required": [
          "job_id",
          "rationale",
          "cohort_preview",
          "baseline_snapshot",
          "candidate_snapshot",
          "created_at"
        ],
        "type": "object"
      },
      "BacktestOutcomeAnalysis": {
        "properties": {
          "assumptions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "baseline": {
            "$ref": "#/components/schemas/OutcomeSummary"
          },
          "by_scenario": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OutcomeSummary"
            },
            "type": "object"
          },
          "candidate": {
            "$ref": "#/components/schemas/OutcomeSummary"
          },
          "customer_period": {
            "items": {
              "$ref": "#/components/schemas/CustomerPeriodOutcome"
            },
            "type": "array"
          },
          "delta": {
            "$ref": "#/components/schemas/OutcomeSummary"
          },
          "generated_at": {
            "format": "date-time",
            "type": "string"
          },
          "matcher_version": {
            "type": "string"
          },
          "snapshot_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "matcher_version",
          "snapshot_at",
          "assumptions",
          "baseline",
          "candidate",
          "delta",
          "generated_at"
        ],
        "type": "object"
      },
      "BacktestOutcomeDetail": {
        "properties": {
          "assumptions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "candidate_id": {
            "type": "string"
          },
          "change_kind": {
            "enum": [
              "added",
              "removed",
              "changed"
            ],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "investigated": {
            "type": "boolean"
          },
          "job_id": {
            "type": "string"
          },
          "label": {
            "enum": [
              "TP",
              "FP",
              "unlabeled",
              "unevaluable"
            ],
            "type": "string"
          },
          "matched_alert_id": {
            "type": "string"
          },
          "matched_case_id": {
            "type": "string"
          },
          "matcher_version": {
            "type": "string"
          },
          "metric": {
            "type": "string"
          },
          "provenance": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "reference_id": {
            "type": "string"
          },
          "scenario_id": {
            "type": "string"
          },
          "score": {
            "type": "number"
          },
          "snapshot_at": {
            "format": "date-time",
            "type": "string"
          },
          "variant": {
            "enum": [
              "baseline",
              "candidate",
              "delta"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "job_id",
          "variant",
          "candidate_id",
          "customer_id",
          "label",
          "investigated",
          "matcher_version",
          "snapshot_at",
          "created_at"
        ],
        "type": "object"
      },
      "BacktestOutcomePage": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/BacktestOutcomeDetail"
            },
            "type": "array"
          },
          "outcome_analysis": {
            "$ref": "#/components/schemas/BacktestOutcomeAnalysis"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "outcome_analysis",
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "BacktestResult": {
        "properties": {
          "backtest_id": {
            "type": "string"
          },
          "execution_time_ms": {
            "type": "number"
          },
          "scenario_results": {
            "items": {
              "$ref": "#/components/schemas/BacktestScenarioResult"
            },
            "type": "array"
          },
          "total_alerts": {
            "type": "integer"
          },
          "total_customers": {
            "type": "integer"
          },
          "total_transactions": {
            "type": "integer"
          }
        },
        "required": [
          "backtest_id",
          "total_transactions",
          "total_customers",
          "total_alerts",
          "scenario_results",
          "execution_time_ms"
        ],
        "type": "object"
      },
      "BacktestScenarioResult": {
        "properties": {
          "added_customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "affected_customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "alerts_generated": {
            "type": "integer"
          },
          "high_severity_count": {
            "type": "integer"
          },
          "low_severity_count": {
            "type": "integer"
          },
          "medium_severity_count": {
            "type": "integer"
          },
          "removed_customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "scenario_id": {
            "type": "string"
          }
        },
        "required": [
          "scenario_id",
          "alerts_generated",
          "high_severity_count",
          "medium_severity_count",
          "low_severity_count",
          "affected_customer_ids"
        ],
        "type": "object"
      },
      "BatchRerunPreview": {
        "properties": {
          "next": {
            "description": "The confirmation step required before the rerun can start",
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "parameters": {
            "additionalProperties": true,
            "type": "object"
          },
          "rerun_of": {
            "type": "string"
          },
          "target_manifest": {
            "$ref": "#/components/schemas/TargetManifest"
          }
        },
        "required": [
          "target_manifest",
          "operation",
          "rerun_of"
        ],
        "type": "object"
      },
      "BatchRun": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "config_digests": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "customer_outcomes": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "object"
          },
          "error": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "job_type": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "parameters": {
            "additionalProperties": true,
            "type": "object"
          },
          "processed_customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "rerun_of": {
            "type": "string"
          },
          "result_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "completed",
              "failed",
              "partial",
              "cancelled"
            ],
            "type": "string"
          },
          "target_manifest_id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "job_type",
          "status",
          "started_at",
          "processed_customer_ids"
        ],
        "type": "object"
      },
      "BatchRunCancelRequest": {
        "properties": {
          "reason": {
            "description": "Why the operator stopped the run; recorded on the run and in the audit log",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BatchRunCreateRequest": {
        "properties": {
          "idempotency_key": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "parameters": {
            "additionalProperties": true,
            "type": "object"
          },
          "rationale": {
            "type": "string"
          },
          "rerun_of": {
            "type": "string"
          },
          "target_manifest_id": {
            "type": "string"
          }
        },
        "required": [
          "operation",
          "target_manifest_id"
        ],
        "type": "object"
      },
      "BulkCaseAssignmentRequest": {
        "properties": {
          "alert_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "case_id": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        },
        "required": [
          "alert_ids"
        ],
        "type": "object"
      },
      "BulkCaseAssignmentResponse": {
        "properties": {
          "case_id": {
            "type": "string"
          },
          "created": {
            "type": "boolean"
          }
        },
        "required": [
          "case_id",
          "created"
        ],
        "type": "object"
      },
      "BulkCloseAlertsRequest": {
        "properties": {
          "period_from": {
            "format": "date-time",
            "type": "string"
          },
          "period_to": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "scenario_id": {
            "type": "string"
          },
          "severity": {
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ],
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "type": "object"
      },
      "BulkCloseAlertsResponse": {
        "properties": {
          "alert_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "closed_count": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "closed_count",
          "alert_ids"
        ],
        "type": "object"
      },
      "CDDRuleSetCandidates": {
        "properties": {
          "data": {
            "items": {
              "properties": {
                "digest": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "is_active": {
                  "type": "boolean"
                },
                "matched_on": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "recommended": {
                  "type": "boolean"
                },
                "version": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "name",
                "version",
                "is_active",
                "digest",
                "recommended"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "policy_version": {
            "type": "string"
          },
          "selection_authority": {
            "description": "True when the server, not the caller, chooses the rule set",
            "type": "boolean"
          }
        },
        "required": [
          "data",
          "policy_version"
        ],
        "type": "object"
      },
      "CDDScoreOverride": {
        "properties": {
          "computed_score": {
            "type": "number"
          },
          "computed_tier": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "decided_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "decided_by": {
            "type": "string"
          },
          "decision_rationale": {
            "type": "string"
          },
          "evidence": {
            "additionalProperties": true,
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "proposed_tier": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          },
          "requested_by": {
            "type": "string"
          },
          "score_record_id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending_approval",
              "approved",
              "rejected"
            ],
            "type": "string"
          },
          "supporting_documents": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "customer_id",
          "proposed_tier",
          "computed_tier",
          "reason",
          "status",
          "requested_by",
          "requested_at",
          "version"
        ],
        "type": "object"
      },
      "CDDScoreOverrideDecision": {
        "properties": {
          "expected_version": {
            "type": "integer"
          },
          "rationale": {
            "type": "string"
          },
          "reject": {
            "description": "Reject rather than approve the proposal",
            "type": "boolean"
          }
        },
        "required": [
          "rationale",
          "expected_version"
        ],
        "type": "object"
      },
      "Capabilities": {
        "properties": {
          "auth_mode": {
            "description": "How this deployment authenticates callers. disabled means every capability is available because no role exists to refuse one (ADR-0024).",
            "enum": [
              "disabled",
              "api_key_only",
              "session"
            ],
            "type": "string"
          },
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/CapabilityDescriptor"
            },
            "type": "array"
          },
          "permissions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "role": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          }
        },
        "required": [
          "auth_mode",
          "permissions",
          "checked_at",
          "data"
        ],
        "type": "object"
      },
      "CapabilityDescriptor": {
        "properties": {
          "availability": {
            "enum": [
              "available",
              "not_configured",
              "forbidden",
              "unsupported",
              "degraded",
              "unavailable"
            ],
            "type": "string"
          },
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "docs_url": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "Stable capability identifier",
            "type": "string"
          },
          "reason_code": {
            "description": "Stable machine reason the capability is not available. Never carries configuration detail, endpoint names or credentials.",
            "type": "string"
          },
          "required_permission": {
            "description": "The auth.RolePermissions grant this capability needs; absent when the capability is not permission-gated",
            "type": "string"
          },
          "surfaces": {
            "items": {
              "enum": [
                "ui",
                "api"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "availability",
          "surfaces",
          "checked_at"
        ],
        "type": "object"
      },
      "Case": {
        "properties": {
          "alert_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "str_candidate": {
            "type": "boolean"
          },
          "str_filed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "str_report_id": {
            "nullable": true,
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CaseChecklistItem": {
        "properties": {
          "case_id": {
            "type": "string"
          },
          "completed": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "case_id",
          "key",
          "label",
          "completed",
          "version"
        ],
        "type": "object"
      },
      "CaseChecklistRequest": {
        "properties": {
          "completed": {
            "type": "boolean"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "completed"
        ],
        "type": "object"
      },
      "CaseCreateRequest": {
        "properties": {
          "alert_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "assigned_team": {
            "type": "string"
          },
          "assigned_to": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "priority_rationale": {
            "type": "string"
          },
          "str_candidate": {
            "type": "boolean"
          },
          "summary": {
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "summary"
        ],
        "type": "object"
      },
      "CaseEvent": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "after": {
            "additionalProperties": true,
            "type": "object"
          },
          "before": {
            "additionalProperties": true,
            "type": "object"
          },
          "case_id": {
            "type": "string"
          },
          "correlation_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CaseEvidence": {
        "properties": {
          "case_id": {
            "type": "string"
          },
          "collected_by": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "evidence_type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "root_id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "supersedes_id": {
            "nullable": true,
            "type": "string"
          },
          "version": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "id",
          "case_id",
          "root_id",
          "description",
          "source",
          "evidence_type",
          "collected_by",
          "version",
          "created_at"
        ],
        "type": "object"
      },
      "CaseEvidenceCorrectionRequest": {
        "properties": {
          "collected_at": {
            "format": "date-time",
            "type": "string"
          },
          "collected_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "evidence_type": {
            "type": "string"
          },
          "integrity_hash": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "type": "object"
      },
      "CaseEvidenceCreateRequest": {
        "properties": {
          "collected_at": {
            "format": "date-time",
            "type": "string"
          },
          "collected_by": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "evidence_type": {
            "type": "string"
          },
          "integrity_hash": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "description",
          "source",
          "evidence_type",
          "collected_by"
        ],
        "type": "object"
      },
      "CaseFile": {
        "properties": {
          "case": {
            "$ref": "#/components/schemas/Case"
          },
          "checklist": {
            "items": {
              "$ref": "#/components/schemas/CaseChecklistItem"
            },
            "type": "array"
          },
          "event_pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/CaseEvent"
            },
            "type": "array"
          },
          "evidence": {
            "items": {
              "$ref": "#/components/schemas/CaseEvidence"
            },
            "type": "array"
          },
          "export_version": {
            "type": "string"
          },
          "exported_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "relationships": {
            "items": {
              "$ref": "#/components/schemas/CaseRelationship"
            },
            "type": "array"
          },
          "work_items": {
            "items": {
              "$ref": "#/components/schemas/CaseWorkItem"
            },
            "type": "array"
          }
        },
        "required": [
          "case",
          "events",
          "evidence",
          "checklist",
          "work_items",
          "relationships"
        ],
        "type": "object"
      },
      "CaseNote": {
        "properties": {
          "author": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "author",
          "content",
          "created_at"
        ],
        "type": "object"
      },
      "CaseNoteRequest": {
        "properties": {
          "author": {
            "type": "string"
          },
          "content": {
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      },
      "CaseRelationship": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "case_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "related_case_id": {
            "type": "string"
          },
          "relationship_type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_id",
          "related_case_id",
          "relationship_type",
          "rationale",
          "active"
        ],
        "type": "object"
      },
      "CaseUpdateRequest": {
        "properties": {
          "assigned_team": {
            "type": "string"
          },
          "assigned_to": {
            "type": "string"
          },
          "clear_due_at": {
            "type": "boolean"
          },
          "confirm": {
            "type": "boolean"
          },
          "destination": {
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "expected_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "external_reference": {
            "type": "string"
          },
          "filing_channel": {
            "type": "string"
          },
          "investigation_disposition": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "priority_rationale": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "str_candidate": {
            "type": "boolean"
          },
          "str_report_id": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CaseWorkItem": {
        "properties": {
          "assigned_to": {
            "type": "string"
          },
          "case_id": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "case_id",
          "title",
          "status"
        ],
        "type": "object"
      },
      "CaseWorkItemRequest": {
        "properties": {
          "assigned_to": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "in_progress",
              "completed",
              "cancelled"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "title"
        ],
        "type": "object"
      },
      "ComponentStatus": {
        "properties": {
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "configured": {
            "description": "Whether this deployment wired the component at all; independent of whether it is working",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "operational_state": {
            "description": "unknown means no check could be run. It is never a quiet yes.",
            "enum": [
              "ready",
              "degraded",
              "unavailable",
              "unknown"
            ],
            "type": "string"
          },
          "reason_code": {
            "description": "Stable machine reason; never carries a dependency's error text",
            "type": "string"
          }
        },
        "required": [
          "name",
          "configured",
          "operational_state",
          "checked_at"
        ],
        "type": "object"
      },
      "ConfigValidationError": {
        "properties": {
          "class": {
            "description": "What kind of mistake this is; syntax and schema have different fixes",
            "enum": [
              "syntax",
              "schema",
              "cross_reference",
              "activation"
            ],
            "type": "string"
          },
          "column": {
            "type": "integer"
          },
          "field": {
            "description": "Legacy coarse field name, retained unchanged",
            "type": "string"
          },
          "line": {
            "description": "1-based line in the submitted document; omitted when the position is unknown rather than defaulted to the first line",
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "path": {
            "description": "Dotted document path, e.g. entries[0].names",
            "type": "string"
          },
          "severity": {
            "description": "Only error affects valid. Warnings never block activation (ADR-0025).",
            "enum": [
              "error",
              "warning"
            ],
            "type": "string"
          }
        },
        "required": [
          "field",
          "message"
        ],
        "type": "object"
      },
      "ConfigValidationResult": {
        "properties": {
          "errors": {
            "items": {
              "$ref": "#/components/schemas/ConfigValidationError"
            },
            "type": "array"
          },
          "valid": {
            "type": "boolean"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/ConfigValidationError"
            },
            "type": "array"
          }
        },
        "required": [
          "valid",
          "errors"
        ],
        "type": "object"
      },
      "CoverageAnalysis": {
        "properties": {
          "assumptions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "by_scenario": {
            "additionalProperties": {
              "$ref": "#/components/schemas/CoverageSummary"
            },
            "type": "object"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "error": {
            "type": "string"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "comparison/known_matter_coverage"
            ],
            "type": "string"
          },
          "matcher_version": {
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "scenario_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "snapshot_at": {
            "format": "date-time",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "completed",
              "failed"
            ],
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/CoverageSummary"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "from",
          "to",
          "rule_set_id",
          "snapshot_at",
          "matcher_version",
          "assumptions",
          "summary",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "CoverageAnalysisCreateRequest": {
        "properties": {
          "customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "scenario_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "snapshot_at": {
            "format": "date-time",
            "type": "string"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "from",
          "to"
        ],
        "type": "object"
      },
      "CoverageMatterResult": {
        "properties": {
          "analysis_id": {
            "type": "string"
          },
          "assumptions": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "covered": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "enum": [
              "TP",
              "FP",
              "unlabeled",
              "unevaluable"
            ],
            "type": "string"
          },
          "matched_alert_id": {
            "type": "string"
          },
          "matcher_version": {
            "type": "string"
          },
          "matter_id": {
            "type": "string"
          },
          "provenance": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "scenario_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "snapshot_at": {
            "format": "date-time",
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "unevaluable": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "analysis_id",
          "matter_id",
          "customer_id",
          "source",
          "label",
          "covered",
          "unevaluable",
          "matcher_version",
          "snapshot_at",
          "created_at"
        ],
        "type": "object"
      },
      "CoverageSummary": {
        "properties": {
          "covered": {
            "type": "integer"
          },
          "denominator": {
            "type": "integer"
          },
          "known_matter": {
            "type": "integer"
          },
          "not_covered": {
            "type": "integer"
          },
          "rate": {
            "type": "number"
          },
          "unevaluable": {
            "type": "integer"
          }
        },
        "required": [
          "known_matter",
          "covered",
          "not_covered",
          "unevaluable",
          "rate",
          "denominator"
        ],
        "type": "object"
      },
      "CreateTransactionRequest": {
        "properties": {
          "account_id": {
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "channel": {
            "type": "string"
          },
          "counterparty": {
            "additionalProperties": true,
            "type": "object"
          },
          "counterparty_country": {
            "type": "string"
          },
          "counterparty_id": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "executed_at": {
            "format": "date-time",
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "transaction_type": {
            "description": "Optional source transaction vocabulary used by TM scenarios",
            "type": "string"
          },
          "travel_rule_applicable": {
            "type": "boolean"
          },
          "travel_rule_assessment": {
            "additionalProperties": true,
            "description": "The server's recorded verdict: policy_version, applicable, reason_code, missing_fields, threshold, currency, conflict, evaluated_at. Null on transactions accepted before the policy existed, which is neither not-applicable nor unknown.",
            "nullable": true,
            "type": "object"
          },
          "travel_rule_evidence": {
            "additionalProperties": true,
            "type": "object"
          },
          "travel_rule_not_applicable_reason": {
            "type": "string"
          },
          "travel_rule_not_applicable_reason_code": {
            "description": "Closed-enum companion to travel_rule_not_applicable_reason; free text with no code maps to other",
            "type": "string"
          },
          "travel_rule_status": {
            "description": "The server's own status, derived from the evidence present rather than from the client's assertion",
            "enum": [
              "complete",
              "incomplete",
              "not_applicable"
            ],
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "external_id",
          "amount",
          "currency",
          "direction",
          "executed_at"
        ],
        "type": "object"
      },
      "Customer": {
        "properties": {
          "attributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "country_code": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_type": {
            "enum": [
              "individual",
              "corporate_domestic",
              "corporate_foreign",
              "trust",
              "partnership",
              "npo",
              "government",
              "foreign_legal_arrangement"
            ],
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kyc_missing_fields": {
            "description": "Required identity attributes this record does not carry, per the kyc_required_fields policy for its customer type. Recomputed on read; absent when nothing is missing.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "kyc_policy_version": {
            "description": "Version of the policy that produced kyc_missing_fields",
            "type": "string"
          },
          "last_scored_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "product_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "risk_score": {
            "nullable": true,
            "type": "number"
          },
          "risk_tier": {
            "nullable": true,
            "type": "string"
          },
          "source_updated_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "dormant",
              "frozen",
              "closed"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "external_id",
          "customer_type",
          "country_code",
          "product_types",
          "attributes",
          "status",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "CustomerCreateRequest": {
        "properties": {
          "attributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "country_code": {
            "maxLength": 2,
            "minLength": 2,
            "type": "string"
          },
          "customer_type": {
            "enum": [
              "individual",
              "corporate_domestic",
              "corporate_foreign",
              "trust",
              "partnership",
              "npo",
              "government",
              "foreign_legal_arrangement"
            ],
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "identity": {
            "additionalProperties": true,
            "description": "Configured KYC identity fields; unspecified legacy attributes are preserved",
            "type": "object"
          },
          "product_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "external_id",
          "customer_type",
          "country_code",
          "product_types",
          "attributes"
        ],
        "type": "object"
      },
      "CustomerIdentityHistory": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "changed_fields": {
            "additionalProperties": true,
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "changed_fields",
          "actor",
          "rationale",
          "created_at"
        ],
        "type": "object"
      },
      "CustomerIdentityHistoryPage": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CustomerIdentityHistory"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "CustomerInvestigation": {
        "properties": {
          "alerts": {
            "items": {
              "$ref": "#/components/schemas/Alert"
            },
            "type": "array"
          },
          "cases": {
            "items": {
              "$ref": "#/components/schemas/Case"
            },
            "type": "array"
          },
          "counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "edd": {
            "$ref": "#/components/schemas/InvestigationEDD"
          },
          "freshness": {
            "format": "date-time",
            "type": "string"
          },
          "pagination": {
            "additionalProperties": {
              "$ref": "#/components/schemas/PaginationMeta"
            },
            "type": "object"
          },
          "partial_failures": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "score_history": {
            "items": {
              "$ref": "#/components/schemas/ScoreRecord"
            },
            "type": "array"
          },
          "screening_results": {
            "items": {
              "$ref": "#/components/schemas/ScreeningResult"
            },
            "type": "array"
          },
          "timeline": {
            "items": {
              "$ref": "#/components/schemas/InvestigationTimelineEntry"
            },
            "type": "array"
          },
          "transactions": {
            "items": {
              "$ref": "#/components/schemas/Transaction"
            },
            "type": "array"
          }
        },
        "required": [
          "customer",
          "counts",
          "pagination",
          "transactions",
          "alerts",
          "cases",
          "screening_results",
          "score_history",
          "timeline",
          "edd",
          "freshness",
          "partial_failures"
        ],
        "type": "object"
      },
      "CustomerPeriodOutcome": {
        "properties": {
          "baseline": {
            "$ref": "#/components/schemas/OutcomeSummary"
          },
          "candidate": {
            "$ref": "#/components/schemas/OutcomeSummary"
          },
          "customer_id": {
            "type": "string"
          },
          "delta": {
            "$ref": "#/components/schemas/OutcomeSummary"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "scenario_id": {
            "type": "string"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "scenario_id",
          "from",
          "to",
          "baseline",
          "candidate",
          "delta"
        ],
        "type": "object"
      },
      "CustomerReview": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "assigned_team": {
            "type": "string"
          },
          "assigned_to": {
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "cycle": {
            "minimum": 1,
            "type": "integer"
          },
          "due_at": {
            "format": "date-time",
            "type": "string"
          },
          "evidence_refs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "grace_until": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "rating_unchanged",
              "rating_changed",
              "escalated_to_edd",
              "unable_to_complete"
            ],
            "type": "string"
          },
          "overdue_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "policy_digest": {
            "type": "string"
          },
          "policy_version": {
            "type": "string"
          },
          "previous_score_id": {
            "type": "string"
          },
          "previous_tier": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "resulting_score_id": {
            "type": "string"
          },
          "resulting_tier": {
            "type": "string"
          },
          "scheduled_at": {
            "format": "date-time",
            "type": "string"
          },
          "scope": {
            "additionalProperties": true,
            "type": "object"
          },
          "started_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "scheduled",
              "due",
              "overdue",
              "in_progress",
              "blocked",
              "completed"
            ],
            "type": "string"
          },
          "tier": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "customer_id",
          "cycle",
          "status",
          "tier",
          "due_at",
          "grace_until",
          "policy_version",
          "policy_digest",
          "scheduled_at",
          "created_at",
          "updated_at",
          "version"
        ],
        "type": "object"
      },
      "CustomerReviewCompleteRequest": {
        "properties": {
          "evidence_refs": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "expected_version": {
            "type": "integer"
          },
          "outcome": {
            "enum": [
              "rating_unchanged",
              "rating_changed",
              "escalated_to_edd",
              "unable_to_complete"
            ],
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "scope": {
            "additionalProperties": true,
            "type": "object"
          }
        },
        "required": [
          "outcome",
          "rationale",
          "evidence_refs",
          "scope"
        ],
        "type": "object"
      },
      "CustomerReviewPatchRequest": {
        "properties": {
          "action": {
            "enum": [
              "start",
              "resume"
            ],
            "type": "string"
          },
          "assigned_team": {
            "type": "string"
          },
          "assigned_to": {
            "type": "string"
          },
          "expected_version": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerStatusWebhookRequest": {
        "properties": {
          "external_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "dormant",
              "frozen",
              "closed"
            ],
            "type": "string"
          }
        },
        "required": [
          "external_id",
          "status"
        ],
        "type": "object"
      },
      "CustomerUpdateRequest": {
        "properties": {
          "attributes": {
            "additionalProperties": true,
            "type": "object"
          },
          "country_code": {
            "maxLength": 2,
            "minLength": 2,
            "type": "string"
          },
          "expected_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "identity": {
            "additionalProperties": true,
            "type": "object"
          },
          "product_types": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "rationale": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "dormant",
              "frozen",
              "closed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "DLQEntry": {
        "properties": {
          "attempt_count": {
            "type": "integer"
          },
          "event": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "failed_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "payload": {
            "type": "string"
          },
          "reprocessed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "webhook_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "webhook_id",
          "event_id",
          "event",
          "payload",
          "attempt_count",
          "failed_at"
        ],
        "type": "object"
      },
      "DashboardException": {
        "properties": {
          "count": {
            "type": "integer"
          },
          "href": {
            "description": "Pre-filtered queue that explains the count",
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "state": {
            "enum": [
              "failed",
              "degraded",
              "unknown"
            ],
            "type": "string"
          }
        },
        "required": [
          "kind",
          "count",
          "href",
          "state"
        ],
        "type": "object"
      },
      "DashboardSLA": {
        "properties": {
          "due_soon_within_hours": {
            "type": "integer"
          },
          "policy_version": {
            "type": "string"
          },
          "state": {
            "enum": [
              "not_configured",
              "running",
              "breached",
              "met"
            ],
            "type": "string"
          }
        },
        "required": [
          "state",
          "policy_version"
        ],
        "type": "object"
      },
      "DashboardStats": {
        "properties": {
          "alerts_by_severity": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "alerts_by_status": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "cases_by_status": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "customers_by_risk_tier": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "exceptions": {
            "items": {
              "$ref": "#/components/schemas/DashboardException"
            },
            "type": "array"
          },
          "recent_transactions": {
            "type": "integer"
          },
          "recent_transactions_window_hours": {
            "type": "integer"
          },
          "screening_degraded_sources": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "screening_list_freshness": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          },
          "screening_ready": {
            "type": "boolean"
          },
          "total_alerts": {
            "type": "integer"
          },
          "total_cases": {
            "type": "integer"
          },
          "total_customers": {
            "type": "integer"
          },
          "workload": {
            "$ref": "#/components/schemas/DashboardWorkload"
          }
        },
        "required": [
          "total_customers",
          "total_alerts",
          "total_cases",
          "recent_transactions",
          "recent_transactions_window_hours",
          "exceptions"
        ],
        "type": "object"
      },
      "DashboardWorkload": {
        "properties": {
          "alerts": {
            "$ref": "#/components/schemas/WorkloadCounts"
          },
          "cases": {
            "$ref": "#/components/schemas/WorkloadCounts"
          },
          "evaluated_at": {
            "format": "date-time",
            "type": "string"
          },
          "scope": {
            "description": "The operator identity 'mine' was taken against; empty when the deployment has no identity",
            "type": "string"
          },
          "sla": {
            "$ref": "#/components/schemas/DashboardSLA"
          }
        },
        "required": [
          "scope",
          "alerts",
          "cases",
          "sla",
          "evaluated_at"
        ],
        "type": "object"
      },
      "EDDActionRequest": {
        "properties": {
          "case_id": {
            "type": "string"
          },
          "expected_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "rationale": {
            "description": "Why the window is being closed or reopened; required by the edd policy",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EDDEvent": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "case_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "event_type": {
            "enum": [
              "requested",
              "stage_escalated",
              "completed",
              "reopened",
              "closed_on_downgrade"
            ],
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "policy_version": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "event_type",
          "actor",
          "created_at"
        ],
        "type": "object"
      },
      "EDDPanel": {
        "properties": {
          "case_id": {
            "type": "string"
          },
          "close_reason": {
            "type": "string"
          },
          "closed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "completion_status": {
            "enum": [
              "not_required",
              "open",
              "overdue",
              "escalated",
              "completed"
            ],
            "type": "string"
          },
          "current_stage": {
            "type": "string"
          },
          "due_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "elapsed_days": {
            "type": "integer"
          },
          "next_stage": {
            "type": "string"
          },
          "next_stage_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "overdue_days": {
            "description": "Whole days past the due boundary, never negative",
            "type": "integer"
          },
          "policy_version": {
            "type": "string"
          },
          "remaining_days": {
            "deprecated": true,
            "description": "Clamped at zero and therefore unable to express lateness; use overdue_days",
            "type": "integer"
          },
          "requested_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "required": {
            "type": "boolean"
          }
        },
        "required": [
          "required",
          "current_stage",
          "completion_status"
        ],
        "type": "object"
      },
      "Error": {
        "properties": {
          "error": {
            "type": "string"
          },
          "error_code": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "error_code"
        ],
        "type": "object"
      },
      "Factor": {
        "properties": {
          "axis": {
            "type": "string"
          },
          "business_meaning": {
            "type": "string"
          },
          "contribution": {
            "type": "number"
          },
          "description": {
            "type": "string"
          },
          "fallback": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "observed_value": {
            "type": "string"
          },
          "rule": {
            "type": "string"
          },
          "score": {
            "type": "number"
          },
          "weight": {
            "type": "number"
          }
        },
        "required": [
          "name",
          "axis",
          "score",
          "description"
        ],
        "type": "object"
      },
      "InboundWebhookBatch": {
        "properties": {
          "records": {
            "items": {
              "$ref": "#/components/schemas/InboundWebhookRecord"
            },
            "type": "array"
          }
        },
        "required": [
          "records"
        ],
        "type": "object"
      },
      "InboundWebhookEvent": {
        "properties": {
          "attempt_count": {
            "type": "integer"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "first_received_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "customers",
              "transactions"
            ],
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "payload_digest": {
            "type": "string"
          },
          "record_count": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "accepted",
              "running",
              "completed",
              "failed",
              "dlq"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "payload_digest",
          "record_count",
          "status",
          "attempt_count",
          "next_attempt_at",
          "first_received_at",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "InboundWebhookEventView": {
        "properties": {
          "event": {
            "$ref": "#/components/schemas/InboundWebhookEvent"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/InboundWebhookOutcome"
            },
            "type": "array"
          }
        },
        "required": [
          "event",
          "outcomes"
        ],
        "type": "object"
      },
      "InboundWebhookOutcome": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "index": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "enum": [
              "accepted",
              "updated",
              "skipped",
              "waiting_dependency",
              "rejected"
            ],
            "type": "string"
          }
        },
        "required": [
          "index",
          "entity_type",
          "status",
          "created_at"
        ],
        "type": "object"
      },
      "InboundWebhookRecord": {
        "additionalProperties": true,
        "type": "object"
      },
      "InvestigationEDD": {
        "properties": {
          "completion_status": {
            "enum": [
              "not_required",
              "open",
              "escalated"
            ],
            "type": "string"
          },
          "current_stage": {
            "enum": [
              "none",
              "requested",
              "stage1",
              "stage2",
              "critical"
            ],
            "type": "string"
          },
          "elapsed_days": {
            "type": "integer"
          },
          "next_stage": {
            "enum": [
              "none",
              "stage1",
              "stage2",
              "stage3"
            ],
            "type": "string"
          },
          "next_stage_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "remaining_days": {
            "type": "integer"
          },
          "requested_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "stage1_last_sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "stage2_notified_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "stage3_notified_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "required",
          "current_stage",
          "elapsed_days",
          "remaining_days",
          "next_stage",
          "completion_status"
        ],
        "type": "object"
      },
      "InvestigationTimelineEntry": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "entity_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "transaction",
              "alert",
              "case",
              "screening_result",
              "score"
            ],
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "entity_id",
          "summary",
          "created_at"
        ],
        "type": "object"
      },
      "ManagedUser": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "format": "email",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "role": {
            "enum": [
              "admin",
              "analyst",
              "viewer"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "role",
          "active",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "OperatorDirectory": {
        "properties": {
          "teams": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "users": {
            "items": {
              "properties": {
                "email": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "users",
          "teams"
        ],
        "type": "object"
      },
      "OutcomeSummary": {
        "properties": {
          "denominator": {
            "type": "integer"
          },
          "fp": {
            "type": "integer"
          },
          "investigated": {
            "type": "integer"
          },
          "rate": {
            "type": "number"
          },
          "tp": {
            "type": "integer"
          },
          "unevaluable": {
            "type": "integer"
          },
          "unlabeled": {
            "type": "integer"
          }
        },
        "required": [
          "tp",
          "fp",
          "unlabeled",
          "unevaluable",
          "investigated",
          "rate",
          "denominator"
        ],
        "type": "object"
      },
      "PaginatedAffectedBacktestCustomers": {
        "properties": {
          "data": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "delta_kinds": {
            "additionalProperties": {
              "enum": [
                "added",
                "removed",
                "unchanged",
                "mixed"
              ],
              "type": "string"
            },
            "description": "Per-customer verdict aggregated across scenarios; mixed means added by one scenario and removed by another",
            "type": "object"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/BacktestAffectedCustomer"
            },
            "type": "array"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedAuditEntries": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/AuditEntry"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedBacktestJobs": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/BacktestJob"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedBacktestOutcomeDetails": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/BacktestOutcomeDetail"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedBatchRuns": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/BatchRun"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedCases": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Case"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedCoverageAnalyses": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CoverageAnalysis"
            },
            "type": "array"
          },
          "pagination": {
            "properties": {
              "has_more": {
                "type": "boolean"
              },
              "limit": {
                "type": "integer"
              },
              "offset": {
                "type": "integer"
              }
            },
            "required": [
              "limit",
              "offset",
              "has_more"
            ],
            "type": "object"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedCoverageMatters": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CoverageMatterResult"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedCustomerReviews": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CustomerReview"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedCustomers": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Customer"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedPendingEvaluations": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PendingEvaluation"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedRules": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/RuleDefinition"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedSTRReports": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/STRReport"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedScreeningResults": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ScreeningResult"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedScreeningRuns": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ScreeningRun"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginatedTransactions": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Transaction"
            },
            "type": "array"
          },
          "pagination": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        },
        "required": [
          "data",
          "pagination"
        ],
        "type": "object"
      },
      "PaginationMeta": {
        "properties": {
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "required": [
          "has_more"
        ],
        "type": "object"
      },
      "PendingEvaluation": {
        "properties": {
          "alert_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "batch_run_id": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "escalated_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "manual_retry_count": {
            "description": "Operator-initiated revivals of a failed record, counted separately from the automatic retry budget",
            "type": "integer"
          },
          "next_retry_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "resolved_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "retry_count": {
            "type": "integer"
          },
          "status": {
            "enum": [
              "PENDING_REVIEW",
              "PROCESSING",
              "RESOLVED",
              "FAILED"
            ],
            "type": "string"
          },
          "transaction_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "customer_id",
          "transaction_ids",
          "status",
          "reason",
          "retry_count",
          "version",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "PendingEvaluationHistory": {
        "properties": {
          "action": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "from_status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "pending_evaluation_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "retry_count": {
            "type": "integer"
          },
          "to_status": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "pending_evaluation_id",
          "from_status",
          "to_status",
          "action",
          "actor",
          "retry_count",
          "created_at"
        ],
        "type": "object"
      },
      "PendingTransitionRequest": {
        "properties": {
          "expected_version": {
            "minimum": 1,
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "expected_version"
        ],
        "type": "object"
      },
      "PolicyDescriptor": {
        "properties": {
          "digest": {
            "description": "SHA-256 of the policy document, pinned onto the decisions it produced",
            "type": "string"
          },
          "name": {
            "enum": [
              "kyc_required_fields",
              "edd",
              "cdd_rule_selection",
              "cdd_review",
              "travel_rule",
              "screening_readiness",
              "sla"
            ],
            "type": "string"
          },
          "policy_version": {
            "type": "string"
          },
          "schema_version": {
            "type": "string"
          },
          "source": {
            "enum": [
              "file",
              "default"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "schema_version",
          "policy_version",
          "digest",
          "source"
        ],
        "type": "object"
      },
      "PolicyDocument": {
        "properties": {
          "digest": {
            "type": "string"
          },
          "document": {
            "additionalProperties": true,
            "description": "The policy document as authored; its shape is governed by schema_version",
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "policy_version": {
            "type": "string"
          },
          "schema_version": {
            "type": "string"
          },
          "source": {
            "enum": [
              "file",
              "default"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "schema_version",
          "policy_version",
          "digest",
          "source",
          "document"
        ],
        "type": "object"
      },
      "PolicyList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PolicyDescriptor"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "PolicyProvenance": {
        "properties": {
          "digest": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "policy_version": {
            "type": "string"
          },
          "schema_version": {
            "type": "string"
          },
          "source": {
            "description": "default means this deployment has not authored the policy",
            "enum": [
              "file",
              "default"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "policy_version",
          "digest",
          "source"
        ],
        "type": "object"
      },
      "RelatedCase": {
        "properties": {
          "case": {
            "$ref": "#/components/schemas/Case"
          },
          "link_type": {
            "enum": [
              "auto",
              "manual"
            ],
            "type": "string"
          },
          "relationship": {
            "$ref": "#/components/schemas/CaseRelationship"
          }
        },
        "required": [
          "case",
          "link_type"
        ],
        "type": "object"
      },
      "RelatedCaseCorrectionRequest": {
        "properties": {
          "rationale": {
            "type": "string"
          },
          "relationship_type": {
            "type": "string"
          }
        },
        "required": [
          "rationale"
        ],
        "type": "object"
      },
      "RelatedCaseCreateRequest": {
        "properties": {
          "expected_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "related_case_id": {
            "type": "string"
          },
          "relationship_type": {
            "type": "string"
          }
        },
        "required": [
          "related_case_id",
          "rationale"
        ],
        "type": "object"
      },
      "RelatedCaseRemoveRequest": {
        "properties": {
          "expected_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "type": "object"
      },
      "RetentionPolicy": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "data_category": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "min_retention_days": {
            "nullable": true,
            "type": "integer"
          },
          "retention_days": {
            "minimum": 1,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "RuleDefinition": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "definition": {
            "additionalProperties": true,
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "name",
          "definition",
          "version",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "RuleImportItem": {
        "properties": {
          "definition": {
            "additionalProperties": true,
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "name",
          "definition"
        ],
        "type": "object"
      },
      "STRCreateRequest": {
        "properties": {
          "alert_id": {
            "type": "string"
          },
          "case_id": {
            "type": "string"
          },
          "corrects_report_id": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "supersedes_report_id": {
            "type": "string"
          },
          "suspicious_point": {
            "type": "string"
          }
        },
        "required": [
          "alert_id",
          "case_id",
          "suspicious_point"
        ],
        "type": "object"
      },
      "STRReport": {
        "properties": {
          "alert_id": {
            "type": "string"
          },
          "alert_snapshot": {
            "additionalProperties": true,
            "type": "object"
          },
          "case_id": {
            "type": "string"
          },
          "corrects_report_id": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "customer_snapshot": {
            "additionalProperties": true,
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "report_type": {
            "enum": [
              "str"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "submitted"
            ],
            "type": "string"
          },
          "submission_evidence": {
            "type": "string"
          },
          "submitted_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "submitted_by": {
            "type": "string"
          },
          "supersedes_report_id": {
            "nullable": true,
            "type": "string"
          },
          "suspicious_point": {
            "type": "string"
          },
          "total_amount": {
            "type": "number"
          },
          "transaction_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "alert_id",
          "customer_id",
          "report_type",
          "status",
          "suspicious_point",
          "transaction_ids",
          "total_amount",
          "currency",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "STRReportExport": {
        "properties": {
          "alert": {
            "additionalProperties": true,
            "type": "object"
          },
          "alert_id": {
            "type": "string"
          },
          "case_id": {
            "type": "string"
          },
          "corrects_report_id": {
            "nullable": true,
            "type": "string"
          },
          "customer": {
            "additionalProperties": true,
            "type": "object"
          },
          "export_version": {
            "type": "string"
          },
          "exported_at": {
            "format": "date-time",
            "type": "string"
          },
          "report_id": {
            "type": "string"
          },
          "report_status": {
            "type": "string"
          },
          "report_type": {
            "type": "string"
          },
          "supersedes_report_id": {
            "nullable": true,
            "type": "string"
          },
          "transactions": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "report_id",
          "report_status",
          "report_type",
          "alert_id",
          "case_id",
          "export_version",
          "exported_at"
        ],
        "type": "object"
      },
      "STRSubmitRequest": {
        "properties": {
          "filing_reference": {
            "type": "string"
          },
          "submission_evidence": {
            "type": "string"
          },
          "submitted_by": {
            "type": "string"
          }
        },
        "required": [
          "submission_evidence"
        ],
        "type": "object"
      },
      "STRUpdateRequest": {
        "properties": {
          "expected_updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "suspicious_point": {
            "type": "string"
          }
        },
        "required": [
          "suspicious_point"
        ],
        "type": "object"
      },
      "ScoreCustomerRequest": {
        "properties": {
          "confirmed": {
            "type": "boolean"
          },
          "override_evidence": {
            "additionalProperties": true,
            "type": "object"
          },
          "rationale": {
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "rule_set_version": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "rule_set_id"
        ],
        "type": "object"
      },
      "ScoreExplanation": {
        "properties": {
          "deterministic": {
            "type": "boolean"
          },
          "priority": {
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "rule_set_sha256": {
            "type": "string"
          },
          "score": {
            "$ref": "#/components/schemas/ScoreRecord"
          },
          "total_reconciled": {
            "type": "number"
          }
        },
        "required": [
          "score",
          "total_reconciled",
          "rule_set_id",
          "rule_set_sha256",
          "priority",
          "deterministic"
        ],
        "type": "object"
      },
      "ScoreRecord": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "factors": {
            "items": {
              "$ref": "#/components/schemas/Factor"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "override_evidence": {
            "additionalProperties": true,
            "type": "object"
          },
          "rationale": {
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "rule_set_sha256": {
            "type": "string"
          },
          "score": {
            "type": "number"
          },
          "scored_at": {
            "format": "date-time",
            "type": "string"
          },
          "tier": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "score",
          "factors",
          "scored_at"
        ],
        "type": "object"
      },
      "ScreenMatch": {
        "properties": {
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "entry_id": {
            "type": "string"
          },
          "list_id": {
            "type": "string"
          },
          "list_type": {
            "type": "string"
          },
          "match_evidence": {
            "additionalProperties": true,
            "type": "object"
          },
          "matched_name": {
            "type": "string"
          },
          "similarity": {
            "type": "number"
          },
          "source": {
            "type": "string"
          }
        },
        "required": [
          "list_id",
          "entry_id",
          "matched_name",
          "similarity",
          "list_type",
          "source"
        ],
        "type": "object"
      },
      "ScreenResult": {
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "hit": {
            "type": "boolean"
          },
          "lists_checked": {
            "type": "integer"
          },
          "matches": {
            "items": {
              "$ref": "#/components/schemas/ScreenMatch"
            },
            "type": "array"
          },
          "result_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "run_id": {
            "type": "string"
          },
          "screened_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "customer_id",
          "hit",
          "matches",
          "lists_checked",
          "screened_at"
        ],
        "type": "object"
      },
      "ScreeningBatchOutcome": {
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "screened": {
            "type": "boolean"
          },
          "skip_reason": {
            "type": "string"
          },
          "skipped": {
            "type": "boolean"
          }
        },
        "required": [
          "customer_id",
          "screened",
          "skipped"
        ],
        "type": "object"
      },
      "ScreeningBatchResponse": {
        "properties": {
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/ScreeningBatchOutcome"
            },
            "type": "array"
          },
          "trigger": {
            "type": "string"
          }
        },
        "required": [
          "trigger",
          "outcomes"
        ],
        "type": "object"
      },
      "ScreeningResult": {
        "properties": {
          "case_id": {
            "type": "string"
          },
          "confidence": {
            "maximum": 1,
            "minimum": 0,
            "type": "number"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "degraded": {
            "description": "A required watchlist source was not ready when this run started",
            "type": "boolean"
          },
          "degraded_sources": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "entry_id": {
            "type": "string"
          },
          "false_positive_reason": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "list_id": {
            "type": "string"
          },
          "list_type": {
            "type": "string"
          },
          "match_evidence": {
            "additionalProperties": true,
            "type": "object"
          },
          "matched_name": {
            "type": "string"
          },
          "reviewed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "reviewed_by": {
            "type": "string"
          },
          "run_id": {
            "type": "string"
          },
          "screened_at": {
            "format": "date-time",
            "type": "string"
          },
          "similarity": {
            "type": "number"
          },
          "status": {
            "enum": [
              "NEW",
              "REVIEWING",
              "TRUE_POSITIVE",
              "FALSE_POSITIVE"
            ],
            "type": "string"
          },
          "suppressed": {
            "type": "boolean"
          },
          "suppression_reason": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "customer_id",
          "list_id",
          "status",
          "screened_at",
          "created_at",
          "suppressed",
          "version",
          "updated_at"
        ],
        "type": "object"
      },
      "ScreeningResultHistory": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "from_status": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "screening_result_id": {
            "type": "string"
          },
          "to_status": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "screening_result_id",
          "from_status",
          "to_status",
          "rationale",
          "actor",
          "version",
          "created_at"
        ],
        "type": "object"
      },
      "ScreeningReviewOutcome": {
        "properties": {
          "case_created": {
            "type": "boolean"
          },
          "case_id": {
            "type": "string"
          },
          "result": {
            "$ref": "#/components/schemas/ScreeningResult"
          }
        },
        "required": [
          "result",
          "case_created"
        ],
        "type": "object"
      },
      "ScreeningReviewRequest": {
        "properties": {
          "expected_version": {
            "minimum": 1,
            "type": "integer"
          },
          "false_positive_reason": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "status": {
            "enum": [
              "REVIEWING",
              "TRUE_POSITIVE",
              "FALSE_POSITIVE"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "expected_version"
        ],
        "type": "object"
      },
      "ScreeningRun": {
        "properties": {
          "actor": {
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "config_digests": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "degraded": {
            "description": "A required watchlist source was not ready when this run started",
            "type": "boolean"
          },
          "degraded_sources": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "error": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "list_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "result_count": {
            "type": "integer"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "completed",
              "failed",
              "partial"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "list_ids",
          "config_digests",
          "status",
          "result_count",
          "actor",
          "started_at",
          "created_at"
        ],
        "type": "object"
      },
      "ScreeningSourceDirectory": {
        "properties": {
          "configured_count": {
            "type": "integer"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/ScreeningSourceStatus"
            },
            "type": "array"
          },
          "degraded_sources": {
            "description": "Required sources that are not ready",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "policy_version": {
            "type": "string"
          },
          "ready_count": {
            "type": "integer"
          },
          "screening_ready": {
            "description": "Every source the readiness policy marks required is usable",
            "type": "boolean"
          },
          "unready_count": {
            "type": "integer"
          }
        },
        "required": [
          "data",
          "configured_count",
          "ready_count",
          "unready_count",
          "screening_ready"
        ],
        "type": "object"
      },
      "ScreeningSourceStatus": {
        "properties": {
          "age_seconds": {
            "nullable": true,
            "type": "integer"
          },
          "configured": {
            "type": "boolean"
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "diagnostic": {
            "type": "string"
          },
          "freshness_threshold_seconds": {
            "type": "integer"
          },
          "last_attempt_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "last_failure_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "last_success_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "list_id": {
            "type": "string"
          },
          "list_type": {
            "type": "string"
          },
          "operational_state": {
            "enum": [
              "never_imported",
              "ready",
              "stale",
              "unreadable",
              "failed",
              "unavailable"
            ],
            "type": "string"
          }
        },
        "required": [
          "list_id",
          "list_type",
          "configured",
          "operational_state",
          "freshness_threshold_seconds",
          "consecutive_failures"
        ],
        "type": "object"
      },
      "SystemInfo": {
        "properties": {
          "components": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "endpoints": {
            "type": "integer"
          },
          "features": {
            "additionalProperties": {
              "type": "boolean"
            },
            "type": "object"
          },
          "version": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SystemStatus": {
        "properties": {
          "auth_mode": {
            "enum": [
              "disabled",
              "api_key_only",
              "session"
            ],
            "type": "string"
          },
          "base_currency": {
            "type": "string"
          },
          "built_at": {
            "type": "string"
          },
          "checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "commit": {
            "type": "string"
          },
          "components": {
            "items": {
              "$ref": "#/components/schemas/ComponentStatus"
            },
            "type": "array"
          },
          "config_digests": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "policies": {
            "items": {
              "$ref": "#/components/schemas/PolicyProvenance"
            },
            "type": "array"
          },
          "source": {
            "enum": [
              "live",
              "cached"
            ],
            "type": "string"
          },
          "tm_contract": {
            "$ref": "#/components/schemas/TMContract"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "auth_mode",
          "config_digests",
          "policies",
          "tm_contract",
          "components",
          "checked_at",
          "expires_at",
          "source"
        ],
        "type": "object"
      },
      "TMContract": {
        "properties": {
          "compatibility_warnings": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "contract_version": {
            "type": "string"
          },
          "default_digest": {
            "type": "string"
          },
          "supported_detectors": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "contract_version",
          "supported_detectors"
        ],
        "type": "object"
      },
      "TargetConfirmationRequest": {
        "properties": {
          "expected_version": {
            "minimum": 1,
            "type": "integer"
          },
          "idempotency_key": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "rationale",
          "expected_version"
        ],
        "type": "object"
      },
      "TargetManifest": {
        "properties": {
          "config_digests": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "confirmed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "criteria": {
            "type": "string"
          },
          "customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "filter": {
            "additionalProperties": true,
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "idempotency_key": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "rule_set_version": {
            "type": "integer"
          },
          "run_id": {
            "type": "string"
          },
          "sample_customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "preview",
              "confirmed",
              "consumed",
              "expired"
            ],
            "type": "string"
          },
          "target_count": {
            "type": "integer"
          },
          "target_mode": {
            "enum": [
              "selected",
              "filter",
              "all"
            ],
            "type": "string"
          },
          "token": {
            "type": "string",
            "writeOnly": true
          },
          "version": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "operation",
          "target_mode",
          "customer_ids",
          "sample_customer_ids",
          "target_count",
          "criteria",
          "status",
          "version",
          "expires_at",
          "created_by",
          "created_at"
        ],
        "type": "object"
      },
      "TargetPreviewRequest": {
        "properties": {
          "criteria": {
            "type": "string"
          },
          "customer_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "filter": {
            "additionalProperties": true,
            "type": "object"
          },
          "idempotency_key": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "rationale": {
            "type": "string"
          },
          "rule_set_id": {
            "type": "string"
          },
          "rule_set_version": {
            "type": "integer"
          },
          "target_mode": {
            "enum": [
              "selected",
              "filter",
              "all"
            ],
            "type": "string"
          },
          "ttl_seconds": {
            "type": "integer"
          }
        },
        "required": [
          "target_mode"
        ],
        "type": "object"
      },
      "Transaction": {
        "properties": {
          "account_id": {
            "nullable": true,
            "type": "string"
          },
          "amount": {
            "type": "number"
          },
          "channel": {
            "type": "string"
          },
          "counterparty": {
            "additionalProperties": true,
            "nullable": true,
            "type": "object"
          },
          "counterparty_country": {
            "type": "string"
          },
          "counterparty_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "direction": {
            "type": "string"
          },
          "executed_at": {
            "format": "date-time",
            "type": "string"
          },
          "external_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idempotency_key": {
            "nullable": true,
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object"
          },
          "monitoring_evaluation": {
            "$ref": "#/components/schemas/TransactionMonitoringEvaluation"
          },
          "transaction_type": {
            "description": "Canonical source transaction vocabulary used by TM scenarios",
            "type": "string"
          },
          "travel_rule_applicable": {
            "nullable": true,
            "type": "boolean"
          },
          "travel_rule_assessment": {
            "additionalProperties": true,
            "description": "The server's recorded verdict: policy_version, applicable, reason_code, missing_fields, threshold, currency, conflict, evaluated_at. Null on transactions accepted before the policy existed, which is neither not-applicable nor unknown.",
            "nullable": true,
            "type": "object"
          },
          "travel_rule_evidence": {
            "additionalProperties": true,
            "type": "object"
          },
          "travel_rule_not_applicable_reason": {
            "type": "string"
          },
          "travel_rule_not_applicable_reason_code": {
            "description": "Closed-enum companion to travel_rule_not_applicable_reason; free text with no code maps to other",
            "type": "string"
          },
          "travel_rule_status": {
            "description": "The server's own status, derived from the evidence present rather than from the client's assertion",
            "enum": [
              "complete",
              "incomplete",
              "not_applicable"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_id",
          "external_id",
          "amount",
          "currency",
          "direction",
          "executed_at",
          "created_at"
        ],
        "type": "object"
      },
      "TransactionMonitoringEvaluation": {
        "properties": {
          "pending_evaluation_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "enum": [
              "PENDING_REVIEW",
              "PROCESSING",
              "RESOLVED",
              "FAILED"
            ],
            "type": "string"
          }
        },
        "required": [
          "pending_evaluation_id",
          "status",
          "reason"
        ],
        "type": "object"
      },
      "UserProfile": {
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "role": {
            "enum": [
              "admin",
              "analyst",
              "viewer"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "role"
        ],
        "type": "object"
      },
      "Webhook": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "active",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "WebhookCreateRequest": {
        "properties": {
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secret": {
            "type": "string",
            "writeOnly": true
          },
          "url": {
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "url",
          "events"
        ],
        "type": "object"
      },
      "WebhookDelivery": {
        "properties": {
          "attempt_count": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "next_attempt_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "payload": {
            "type": "string"
          },
          "status_code": {
            "type": "integer"
          },
          "success": {
            "type": "boolean"
          },
          "webhook_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "webhook_id",
          "event",
          "payload",
          "status_code",
          "success",
          "created_at",
          "event_id",
          "attempt_count"
        ],
        "type": "object"
      },
      "WebhookReprocessResponse": {
        "properties": {
          "status_code": {
            "type": "integer"
          },
          "success": {
            "type": "boolean"
          }
        },
        "required": [
          "success",
          "status_code"
        ],
        "type": "object"
      },
      "WhitelistEntry": {
        "properties": {
          "approved_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "approved_by": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "customer_id": {
            "type": "string"
          },
          "excluded_rule_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "requested_by": {
            "type": "string"
          },
          "revoked_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "revoked_by": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "valid_from": {
            "format": "date-time",
            "type": "string"
          },
          "valid_until": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WhitelistReview": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "decision": {
            "enum": [
              "renewed",
              "revoked"
            ],
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "next_review_date": {
            "format": "date",
            "nullable": true,
            "type": "string"
          },
          "review_notes": {
            "type": "string"
          },
          "reviewed_by": {
            "type": "string"
          },
          "whitelist_entry_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkloadCounts": {
        "properties": {
          "age_buckets": {
            "items": {
              "$ref": "#/components/schemas/AgeBucket"
            },
            "type": "array"
          },
          "due_soon": {
            "type": "integer"
          },
          "mine": {
            "type": "integer"
          },
          "oldest_age_seconds": {
            "type": "integer"
          },
          "oldest_open_at": {
            "description": "Absent on an empty queue; an age of zero would read as newly arrived",
            "format": "date-time",
            "type": "string"
          },
          "open": {
            "type": "integer"
          },
          "overdue": {
            "description": "Absent unless an SLA policy is configured. Zero would claim nothing is overdue, which an unconfigured deployment cannot know.",
            "type": "integer"
          },
          "unassigned": {
            "type": "integer"
          }
        },
        "required": [
          "open",
          "mine",
          "unassigned",
          "age_buckets"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "description": "API key authentication",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Self-hosted AML/CFT compliance platform for Japanese non-bank financial institutions",
    "title": "Merlon AML/CFT API",
    "version": "v0.0.2-1-gccbda37"
  },
  "openapi": "3.0.3",
  "paths": {
    "/api/v1/accounts": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "account_type": {
                    "enum": [
                      "individual",
                      "joint"
                    ],
                    "type": "string"
                  },
                  "external_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "external_id",
                  "account_type"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "description": "Created account"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "Create a joint or individual account"
      }
    },
    "/api/v1/accounts/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Account identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "description": "Account"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "Get an account"
      }
    },
    "/api/v1/accounts/{id}/customers": {
      "get": {
        "parameters": [
          {
            "description": "Account identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AccountCustomer"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Account customers"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "List customers linked to an account"
      },
      "post": {
        "parameters": [
          {
            "description": "Account identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "customer_id": {
                    "type": "string"
                  },
                  "role": {
                    "enum": [
                      "primary",
                      "co_holder"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "customer_id",
                  "role"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Account customer link created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "Add a customer to an account"
      }
    },
    "/api/v1/adapters/dry-run": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdapterDryRunResult"
                }
              }
            },
            "description": "Adapter dry-run result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "HTTP 502"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Validate adapter configuration and probe the external system"
      }
    },
    "/api/v1/admin/apikeys": {
      "get": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "List API Keys"
      },
      "post": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Create API Key"
      }
    },
    "/api/v1/admin/apikeys/{id}": {
      "delete": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Revoke API key"
      }
    },
    "/api/v1/admin/retention-policies": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RetentionPolicy"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Retention policies"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List retention policies"
      }
    },
    "/api/v1/admin/retention-policies/{category}": {
      "put": {
        "parameters": [
          {
            "description": "Data category",
            "in": "path",
            "name": "category",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "retention_days": {
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "retention_days"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RetentionPolicy"
                }
              }
            },
            "description": "Updated retention policy"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Update a retention policy"
      }
    },
    "/api/v1/admin/users": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ManagedUser"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Users"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List users"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "password": {
                    "format": "password",
                    "minLength": 12,
                    "type": "string",
                    "writeOnly": true
                  },
                  "role": {
                    "enum": [
                      "admin",
                      "analyst",
                      "viewer"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password",
                  "role"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedUser"
                }
              }
            },
            "description": "User created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create a local user"
      }
    },
    "/api/v1/admin/users/{id}": {
      "patch": {
        "parameters": [
          {
            "description": "User ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "active": {
                    "type": "boolean"
                  },
                  "role": {
                    "enum": [
                      "admin",
                      "analyst",
                      "viewer"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "role",
                  "active"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedUser"
                }
              }
            },
            "description": "User authority updated"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Update a local user's role or active state"
      }
    },
    "/api/v1/admin/users/{id}/reset-password": {
      "post": {
        "parameters": [
          {
            "description": "User ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "password": {
                    "format": "password",
                    "minLength": 12,
                    "type": "string",
                    "writeOnly": true
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagedUser"
                }
              }
            },
            "description": "Password reset"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Set a replacement password and revoke existing sessions"
      }
    },
    "/api/v1/admin/users/{id}/revoke-sessions": {
      "post": {
        "parameters": [
          {
            "description": "User ID",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "revoked_sessions": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "revoked_sessions"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Sessions revoked"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Revoke all active sessions for a user"
      }
    },
    "/api/v1/alerts": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "description": "Filter by customer ID",
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated status values",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to active queue items",
            "in": "query",
            "name": "active",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Restrict to terminal queue items",
            "in": "query",
            "name": "terminal",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Filter by assigned operator ID",
            "in": "query",
            "name": "assignee",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by the authenticated operator",
            "in": "query",
            "name": "mine",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Filter by assigned team",
            "in": "query",
            "name": "team",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to unassigned items",
            "in": "query",
            "name": "unassigned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Alert severity",
            "in": "query",
            "name": "severity",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alert scenario ID",
            "in": "query",
            "name": "scenario_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case priority",
            "in": "query",
            "name": "priority",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case disposition",
            "in": "query",
            "name": "disposition",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case STR candidacy",
            "in": "query",
            "name": "str_candidate",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Search customer, alert, or case text",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to overdue items",
            "in": "query",
            "name": "overdue",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Minimum item age in days (1-36500)",
            "in": "query",
            "name": "min_age_days",
            "schema": {
              "maximum": 36500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Maximum item age in days (1-36500)",
            "in": "query",
            "name": "max_age_days",
            "schema": {
              "maximum": 36500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Optional queue sort; risk ranks critical \u003e high \u003e medium \u003e low, then updated_at DESC and canonical ID DESC",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "risk"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Alert"
                      },
                      "type": "array"
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Paginated alerts"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List alerts"
      }
    },
    "/api/v1/alerts/bulk-case": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BulkCaseAssignmentRequest"
                  }
                ],
                "required": [
                  "alert_ids"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkCaseAssignmentResponse"
                }
              }
            },
            "description": "Bulk case assignment result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Assign alerts to an existing or newly created case atomically"
      }
    },
    "/api/v1/alerts/bulk-close": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BulkCloseAlertsRequest"
                  }
                ],
                "required": [
                  "reason"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkCloseAlertsResponse"
                }
              }
            },
            "description": "Bulk close result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Close filtered alerts with a required rationale and atomic decision/audit rows"
      }
    },
    "/api/v1/alerts/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Alert identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            },
            "description": "Alert"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get Alert"
      },
      "patch": {
        "parameters": [
          {
            "description": "Alert identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            },
            "description": "Updated alert"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Update alert status, assignment, or due date atomically"
      }
    },
    "/api/v1/alerts/{id}/decisions": {
      "get": {
        "parameters": [
          {
            "description": "Alert identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AlertDecision"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Decision history"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List immutable alert decision history"
      }
    },
    "/api/v1/audit": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "resource_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resource_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "user_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "action_category",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "since",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "until",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedAuditEntries"
                }
              }
            },
            "description": "Paginated audit logs"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List filtered immutable audit logs"
      }
    },
    "/api/v1/audit/export": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "resource_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "resource_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "user_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "action_category",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "since",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "until",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "default": "csv",
              "enum": [
                "csv",
                "json"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AuditEntry"
                  },
                  "type": "array"
                }
              },
              "text/csv": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Download generated from the durable snapshot/filter result",
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Business validation failed"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Export filtered audit logs as CSV or JSON using the same filters as the list endpoint"
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "password": {
                    "format": "password",
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            },
            "description": "Authenticated user profile"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "security": [],
        "summary": "Create a session"
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Logged out"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "security": [],
        "summary": "End the current session"
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            },
            "description": "Authenticated user profile"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get the authenticated user profile"
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Session refreshed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "security": [],
        "summary": "Rotate the refresh token"
      }
    },
    "/api/v1/backtest": {
      "post": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Run backtest"
      }
    },
    "/api/v1/backtests": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBacktestJobs"
                }
              }
            },
            "description": "Backtest jobs"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List durable backtest jobs"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BacktestCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BacktestJob"
                }
              }
            },
            "description": "Queued backtest job"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create a durable backtest comparison"
      }
    },
    "/api/v1/backtests/preview": {
      "post": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Preview the customer and transaction cohort a backtest would run over"
      }
    },
    "/api/v1/backtests/rules": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedRules"
                }
              }
            },
            "description": "Backtest rule candidates"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Discover rule sets available for comparison"
      }
    },
    "/api/v1/backtests/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Backtest job identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BacktestJob"
                }
              }
            },
            "description": "Backtest job"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get durable backtest job"
      }
    },
    "/api/v1/backtests/{id}/affected-customers": {
      "get": {
        "parameters": [
          {
            "description": "Backtest job identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "scenario_id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedAffectedBacktestCustomers"
                }
              }
            },
            "description": "Affected customer IDs"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List affected customers for a backtest comparison"
      }
    },
    "/api/v1/backtests/{id}/cancel": {
      "post": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Cancel durable backtest job"
      }
    },
    "/api/v1/backtests/{id}/outcomes": {
      "get": {
        "parameters": [
          {
            "description": "Backtest job identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "variant",
            "schema": {
              "enum": [
                "baseline",
                "candidate",
                "delta"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "scenario_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "label",
            "schema": {
              "enum": [
                "TP",
                "FP",
                "unlabeled",
                "unevaluable"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BacktestOutcomePage"
                }
              }
            },
            "description": "Backtest outcome analysis and detail rows"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List backtest outcome matches and assumptions"
      }
    },
    "/api/v1/backtests/{id}/retry": {
      "post": {
        "parameters": [
          {
            "description": "Backtest job identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BacktestJob"
                }
              }
            },
            "description": "Queued or already-active backtest job"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Retry a failed durable backtest job without changing its identifier"
      }
    },
    "/api/v1/batch/monitor": {
      "post": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Batch monitor transactions"
      }
    },
    "/api/v1/batch/runs": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedBatchRuns"
                }
              }
            },
            "description": "Batch runs"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List durable manual batch runs"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRunCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchRun"
                }
              }
            },
            "description": "Batch run accepted; execution continues independently of this request"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Start a durable manual batch run"
      }
    },
    "/api/v1/batch/runs/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Batch run identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchRun"
                }
              }
            },
            "description": "Batch run"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a durable manual batch run"
      }
    },
    "/api/v1/batch/runs/{id}/cancel": {
      "post": {
        "parameters": [
          {
            "description": "Batch run identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRunCancelRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchRun"
                }
              }
            },
            "description": "Cancelled batch run; work already completed is retained"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Cancel a running manual batch run"
      }
    },
    "/api/v1/batch/runs/{id}/rerun": {
      "post": {
        "parameters": [
          {
            "description": "Batch run identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchRerunPreview"
                }
              }
            },
            "description": "Unconfirmed target manifest for the rerun; confirm it before starting a run"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Prepare a rerun of a durable manual batch run"
      }
    },
    "/api/v1/batch/score": {
      "post": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Batch score customers"
      }
    },
    "/api/v1/batch/targets/preview": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TargetPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetManifest"
                }
              }
            },
            "description": "Target manifest preview"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Preview and freeze a batch target manifest"
      }
    },
    "/api/v1/batch/targets/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Target manifest identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetManifest"
                }
              }
            },
            "description": "Target manifest"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a target manifest"
      }
    },
    "/api/v1/batch/targets/{id}/confirm": {
      "post": {
        "parameters": [
          {
            "description": "Target manifest identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TargetConfirmationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetManifest"
                }
              }
            },
            "description": "Confirmed target manifest"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Confirm an immutable target manifest"
      }
    },
    "/api/v1/cases": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "description": "Filter by customer ID",
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Comma-separated status values",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to active queue items",
            "in": "query",
            "name": "active",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Restrict to terminal queue items",
            "in": "query",
            "name": "terminal",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Filter by assigned operator ID",
            "in": "query",
            "name": "assignee",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by the authenticated operator",
            "in": "query",
            "name": "mine",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Filter by assigned team",
            "in": "query",
            "name": "team",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to unassigned items",
            "in": "query",
            "name": "unassigned",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Alert severity",
            "in": "query",
            "name": "severity",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Alert scenario ID",
            "in": "query",
            "name": "scenario_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case priority",
            "in": "query",
            "name": "priority",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case disposition",
            "in": "query",
            "name": "disposition",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Case STR candidacy",
            "in": "query",
            "name": "str_candidate",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Search customer, alert, or case text",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Restrict to overdue items",
            "in": "query",
            "name": "overdue",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "Minimum item age in days (1-36500)",
            "in": "query",
            "name": "min_age_days",
            "schema": {
              "maximum": 36500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Maximum item age in days (1-36500)",
            "in": "query",
            "name": "max_age_days",
            "schema": {
              "maximum": 36500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Optional queue sort; risk ranks critical \u003e high \u003e medium \u003e low, then updated_at DESC and canonical ID DESC",
            "in": "query",
            "name": "sort",
            "schema": {
              "enum": [
                "risk"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/Case"
                      },
                      "type": "array"
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Paginated cases"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List cases in one documented risk-ranked queue order"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CaseCreateRequest"
                  }
                ],
                "required": [
                  "customer_id",
                  "summary"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Case"
                }
              }
            },
            "description": "Created case"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create a case and its required creation event atomically"
      }
    },
    "/api/v1/cases/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Case"
                }
              }
            },
            "description": "Case"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a case with its current lifecycle projection"
      },
      "patch": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Case"
                }
              }
            },
            "description": "Updated case"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Mutate a case lifecycle, assignment, filing, or CDD-derived priority"
      }
    },
    "/api/v1/cases/{id}/checklist/{item}": {
      "put": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Checklist key",
            "in": "path",
            "name": "item",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CaseChecklistRequest"
                  }
                ],
                "required": [
                  "label",
                  "completed"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseChecklistItem"
                }
              }
            },
            "description": "Updated checklist item"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Update a checklist item and append its timeline event atomically"
      }
    },
    "/api/v1/cases/{id}/evidence": {
      "post": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CaseEvidenceCreateRequest"
                  }
                ],
                "required": [
                  "description",
                  "source",
                  "evidence_type",
                  "collected_by"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseEvidence"
                }
              }
            },
            "description": "Created evidence version"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Append version one evidence and its timeline event atomically"
      }
    },
    "/api/v1/cases/{id}/evidence/{evidence}/corrections": {
      "post": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Current evidence version identifier",
            "in": "path",
            "name": "evidence",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CaseEvidenceCorrectionRequest"
                  }
                ],
                "required": [
                  "reason"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseEvidence"
                }
              }
            },
            "description": "Created corrected evidence version"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Append a compare-and-swap evidence correction with a unique lineage version"
      }
    },
    "/api/v1/cases/{id}/export": {
      "get": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseFile"
                }
              }
            },
            "description": "Case investigation file snapshot",
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename containing the case identifier",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Export the reproducible case investigation file"
      }
    },
    "/api/v1/cases/{id}/notes": {
      "post": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CaseNoteRequest"
                  }
                ],
                "required": [
                  "content"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseNote"
                }
              }
            },
            "description": "Created case note"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Append a case note and timeline event atomically"
      }
    },
    "/api/v1/cases/{id}/related": {
      "get": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "include_inactive",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RelatedCase"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Related cases"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List same-customer and manually related cases"
      },
      "post": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RelatedCaseCreateRequest"
                  }
                ],
                "required": [
                  "related_case_id",
                  "rationale"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Case"
                }
              }
            },
            "description": "Updated case projection"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Add a same-customer related case link with immutable history"
      }
    },
    "/api/v1/cases/{id}/related/{relationship}": {
      "delete": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Relationship identifier",
            "in": "path",
            "name": "relationship",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RelatedCaseRemoveRequest"
                  }
                ],
                "required": [
                  "reason"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "active": {
                      "type": "boolean"
                    },
                    "relationship_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "relationship_id",
                    "active"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Removed relationship projection"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Remove a related-case link with an immutable reason"
      },
      "put": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Relationship identifier",
            "in": "path",
            "name": "relationship",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/RelatedCaseCorrectionRequest"
                  }
                ],
                "required": [
                  "rationale"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseRelationship"
                }
              }
            },
            "description": "Replacement relationship"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Correct a related-case link by appending a replacement row"
      }
    },
    "/api/v1/cases/{id}/timeline": {
      "get": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "description": "Filter by one event type; the parameter may be repeated or comma-separated",
            "in": "query",
            "name": "event_type",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Filter by comma-separated event types",
            "in": "query",
            "name": "event_types",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Include removed/corrected related-case history",
            "in": "query",
            "name": "include_inactive",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseFile"
                }
              }
            },
            "description": "Case investigation file"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get bounded case timeline pages and investigation file sections"
      }
    },
    "/api/v1/cases/{id}/work-items": {
      "post": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CaseWorkItemRequest"
                  }
                ],
                "required": [
                  "title"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseWorkItem"
                }
              }
            },
            "description": "Created work item"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create a case work item and append its timeline event atomically"
      }
    },
    "/api/v1/cases/{id}/work-items/{item}": {
      "patch": {
        "parameters": [
          {
            "description": "Case identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Work item identifier",
            "in": "path",
            "name": "item",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CaseWorkItemRequest"
                  }
                ],
                "required": [
                  "title"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CaseWorkItem"
                }
              }
            },
            "description": "Updated work item"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Update a case work item and append its timeline event atomically"
      }
    },
    "/api/v1/config/validate": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "config_type": {
                    "type": "string"
                  },
                  "yaml_content": {
                    "maxLength": 524288,
                    "type": "string"
                  }
                },
                "required": [
                  "config_type",
                  "yaml_content"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfigValidationResult"
                }
              }
            },
            "description": "Validation result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Validate a configuration document"
      }
    },
    "/api/v1/coverage-analyses": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCoverageAnalyses"
                }
              }
            },
            "description": "Coverage analyses"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List known-matter coverage analyses"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CoverageAnalysisCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverageAnalysis"
                }
              }
            },
            "description": "Queued coverage analysis"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Queue a known-matter coverage analysis"
      }
    },
    "/api/v1/coverage-analyses/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Coverage analysis identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CoverageAnalysis"
                }
              }
            },
            "description": "Coverage analysis"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a known-matter coverage analysis"
      }
    },
    "/api/v1/coverage-analyses/{id}/matters": {
      "get": {
        "parameters": [
          {
            "description": "Coverage analysis identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "scenario_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "label",
            "schema": {
              "enum": [
                "TP",
                "FP",
                "unlabeled",
                "unevaluable"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCoverageMatters"
                }
              }
            },
            "description": "Coverage matter results"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List known matters and coverage provenance"
      }
    },
    "/api/v1/customer-reviews": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "tier",
            "schema": {
              "enum": [
                "low",
                "medium",
                "high"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "assigned_to",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "team",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "due",
            "schema": {
              "enum": [
                "due",
                "overdue"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "due_before",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "due_after",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCustomerReviews"
                }
              }
            },
            "description": "Customer reviews"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List the durable CDD review queue"
      }
    },
    "/api/v1/customer-reviews/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Customer review identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerReview"
                }
              }
            },
            "description": "Customer review"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get one CDD review and its evidence"
      },
      "patch": {
        "parameters": [
          {
            "description": "Customer review identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerReviewPatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerReview"
                }
              }
            },
            "description": "Updated customer review"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Assign, start, or resume a CDD review"
      }
    },
    "/api/v1/customer-reviews/{id}/complete": {
      "post": {
        "parameters": [
          {
            "description": "Customer review identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CustomerReviewCompleteRequest"
                  }
                ],
                "required": [
                  "outcome",
                  "rationale",
                  "evidence_refs",
                  "scope"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerReview"
                }
              }
            },
            "description": "Completed or blocked customer review"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Complete a CDD review with score, audit, and evidence links"
      }
    },
    "/api/v1/customers": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "description": "Search external ID, identity name, kana, address, or country",
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedCustomers"
                }
              }
            },
            "description": "Customers"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List customers"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Created customer"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create customer KYC identity"
      }
    },
    "/api/v1/customers/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Customer"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "Get customer"
      },
      "put": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Updated customer"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Partially update customer KYC identity"
      }
    },
    "/api/v1/customers/{id}/cdd-rule-sets": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CDDRuleSetCandidates"
                }
              }
            },
            "description": "Rule-set candidates with the policy's recommendation"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List the CDD rule sets applicable to a customer"
      }
    },
    "/api/v1/customers/{id}/edd-events": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/EDDEvent"
                  },
                  "type": "array"
                }
              }
            },
            "description": "EDD events, newest first"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List a customer's EDD lifecycle events"
      }
    },
    "/api/v1/customers/{id}/edd/{action}": {
      "post": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "enum": [
                "complete",
                "reopen"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EDDActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EDDPanel"
                }
              }
            },
            "description": "The EDD panel after the action"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Complete or reopen a customer's EDD window"
      }
    },
    "/api/v1/customers/{id}/identity-history": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/CustomerIdentityHistory"
                      },
                      "type": "array"
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Customer identity history"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List customer identity change history"
      }
    },
    "/api/v1/customers/{id}/investigation": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerInvestigation"
                }
              }
            },
            "description": "Customer investigation read model"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get the customer 360 investigation read model"
      }
    },
    "/api/v1/customers/{id}/score": {
      "post": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScoreCustomerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScoreRecord"
                }
              }
            },
            "description": "Score record"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "HTTP 502"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Score a customer's CDD risk"
      }
    },
    "/api/v1/customers/{id}/score-explanation": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScoreExplanation"
                }
              }
            },
            "description": "Explainable CDD score"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Explain the latest CDD score"
      }
    },
    "/api/v1/customers/{id}/score-overrides": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CDDScoreOverride"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Score overrides, newest first"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List proposed overrides of a customer's computed tier"
      }
    },
    "/api/v1/customers/{id}/score-overrides/{overrideID}/approve": {
      "post": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Score override identifier",
            "in": "path",
            "name": "overrideID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CDDScoreOverrideDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CDDScoreOverride"
                }
              }
            },
            "description": "The decided override; on approval the customer's tier moves to the proposed one"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Approve or reject a proposed tier override"
      }
    },
    "/api/v1/customers/{id}/scores": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ScoreRecord"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Score history"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get customer score history"
      }
    },
    "/api/v1/customers/{id}/scores/{scoreID}/explanation": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Score record identifier",
            "in": "path",
            "name": "scoreID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScoreExplanation"
                }
              }
            },
            "description": "Explainable CDD score"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Explain a selected CDD score"
      }
    },
    "/api/v1/customers/{id}/screen": {
      "post": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "list_ids": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreenResult"
                }
              }
            },
            "description": "Screening result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "502": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "HTTP 502"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Screen a customer against configured lists"
      }
    },
    "/api/v1/customers/{id}/screening-results": {
      "get": {
        "parameters": [
          {
            "description": "Customer identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "list_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "NEW",
                "REVIEWING",
                "TRUE_POSITIVE",
                "FALSE_POSITIVE"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/ScreeningResult"
                      },
                      "type": "array"
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Screening results"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List durable screening results for a customer"
      }
    },
    "/api/v1/dashboard": {
      "get": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Dashboard statistics"
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object"
                }
              }
            },
            "description": "OpenAPI document"
          }
        },
        "summary": "Get the live OpenAPI document"
      }
    },
    "/api/v1/operators": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperatorDirectory"
                }
              }
            },
            "description": "Operator directory"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List the durable active operator/team directory used for assignment validation"
      }
    },
    "/api/v1/pending-evaluations": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "batch_run_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created_from",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created_to",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "min_age_days",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "max_age_days",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPendingEvaluations"
                }
              }
            },
            "description": "Pending evaluations"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List pending evaluation recovery items"
      }
    },
    "/api/v1/pending-evaluations/export": {
      "get": {
        "description": "Returns every record matching the same filter the listing endpoint accepts. Requires audit:read.",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "schema": {
              "default": "csv",
              "enum": [
                "csv",
                "json"
              ],
              "type": "string"
            }
          },
          {
            "description": "Comma-separated queue statuses",
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "batch_run_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created_from",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created_to",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "min_age_days",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "max_age_days",
            "schema": {
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "items": {
                        "$ref": "#/components/schemas/PendingEvaluation"
                      },
                      "type": "array"
                    },
                    {
                      "format": "binary",
                      "type": "string"
                    }
                  ]
                }
              }
            },
            "description": "Pending evaluation export"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Export the monitoring gap queue as evidence"
      }
    },
    "/api/v1/pending-evaluations/stats": {
      "get": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Pending evaluation backlog, oldest age, and failed/exhausted counts"
      }
    },
    "/api/v1/pending-evaluations/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Pending evaluation identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PendingEvaluation"
                }
              }
            },
            "description": "Pending evaluation"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a pending evaluation"
      }
    },
    "/api/v1/pending-evaluations/{id}/history": {
      "get": {
        "parameters": [
          {
            "description": "Pending evaluation identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PendingEvaluationHistory"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Pending evaluation history"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List pending evaluation history"
      }
    },
    "/api/v1/pending-evaluations/{id}/{action}": {
      "post": {
        "parameters": [
          {
            "description": "Pending evaluation identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "retry, resolve, or escalate",
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PendingTransitionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PendingEvaluation"
                }
              }
            },
            "description": "Updated pending evaluation"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Transition a pending evaluation"
      }
    },
    "/api/v1/policies": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyList"
                }
              }
            },
            "description": "Policy descriptors"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "List the loaded AML policy documents"
      }
    },
    "/api/v1/policies/{policy}": {
      "get": {
        "parameters": [
          {
            "description": "Policy document name",
            "in": "path",
            "name": "policy",
            "required": true,
            "schema": {
              "enum": [
                "kyc_required_fields",
                "edd",
                "cdd_rule_selection",
                "travel_rule",
                "screening_readiness"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolicyDocument"
                }
              }
            },
            "description": "Policy document"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "Get one AML policy document"
      }
    },
    "/api/v1/reports/str": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "draft",
                "submitted"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "alert_id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedSTRReports"
                }
              }
            },
            "description": "Paginated STR reports"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List durable STR reports"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/STRCreateRequest"
                  }
                ],
                "required": [
                  "alert_id",
                  "case_id",
                  "suspicious_point"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/STRReport"
                }
              }
            },
            "description": "Created STR draft"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Business validation failed"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create an STR draft from a selected active STR-candidate case"
      }
    },
    "/api/v1/reports/str/export": {
      "get": {
        "parameters": [
          {
            "description": "Durable report to export",
            "in": "query",
            "name": "report_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Legacy source-alert export; use report_id for a pinned snapshot",
            "in": "query",
            "name": "alert_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "default": "csv",
              "enum": [
                "csv",
                "json"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/STRReportExport"
                }
              },
              "text/csv": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Download generated from the durable snapshot/filter result",
            "headers": {
              "Content-Disposition": {
                "description": "Attachment filename",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Business validation failed"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Export a durable STR snapshot as CSV or JSON; report_id is the stable route and alert_id is a deprecated compatibility path"
      }
    },
    "/api/v1/reports/str/{id}": {
      "get": {
        "parameters": [
          {
            "description": "STR report identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/STRReport"
                }
              }
            },
            "description": "STR report"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a durable STR report and its pinned snapshots"
      },
      "patch": {
        "parameters": [
          {
            "description": "STR report identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/STRUpdateRequest"
                  }
                ],
                "required": [
                  "suspicious_point"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/STRReport"
                }
              }
            },
            "description": "Updated STR draft"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Update a draft STR report with compare-and-swap protection when supplied"
      },
      "put": {
        "parameters": [
          {
            "description": "STR report identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/STRUpdateRequest"
                  }
                ],
                "required": [
                  "suspicious_point"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/STRReport"
                }
              }
            },
            "description": "Updated STR draft"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Update a draft STR report with compare-and-swap protection when supplied"
      }
    },
    "/api/v1/reports/str/{id}/submit": {
      "post": {
        "parameters": [
          {
            "description": "STR report identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/STRSubmitRequest"
                  }
                ],
                "description": "Provide submission_evidence, or the additive filing_reference alias; repeating the same evidence is idempotent and a different value is a conflict.",
                "required": [
                  "submission_evidence"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/STRReport"
                }
              }
            },
            "description": "Submitted STR report"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Submit an STR report idempotently using submission evidence"
      }
    },
    "/api/v1/rules": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "is_active",
            "schema": {
              "default": false,
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedRules"
                }
              }
            },
            "description": "Paginated rules"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List versioned rule definitions"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "definition": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "description": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  }
                },
                "required": [
                  "type",
                  "name",
                  "definition"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleDefinition"
                }
              }
            },
            "description": "Created rule"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create an inactive rule definition"
      }
    },
    "/api/v1/rules/import": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/RuleImportItem"
                },
                "type": "array"
              }
            },
            "application/yaml": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/RuleImportItem"
                },
                "type": "array"
              }
            },
            "text/yaml": {
              "schema": {
                "items": {
                  "$ref": "#/components/schemas/RuleImportItem"
                },
                "type": "array"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/RuleDefinition"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Created rules"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Import a JSON or YAML rule batch"
      }
    },
    "/api/v1/rules/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Rule name or identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "version",
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleDefinition"
                }
              }
            },
            "description": "Rule definition"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a rule definition or a selected version"
      },
      "put": {
        "parameters": [
          {
            "description": "Rule name or identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "definition": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "description": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "definition"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleDefinition"
                }
              }
            },
            "description": "Updated rule version"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Append a new rule version"
      }
    },
    "/api/v1/rules/{id}/activate": {
      "post": {
        "parameters": [
          {
            "description": "Rule name or identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleDefinition"
                }
              }
            },
            "description": "Current rule definition"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Activate a rule version"
      }
    },
    "/api/v1/rules/{id}/deactivate": {
      "post": {
        "parameters": [
          {
            "description": "Rule name or identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleDefinition"
                }
              }
            },
            "description": "Current rule definition"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Deactivate a rule version"
      }
    },
    "/api/v1/rules/{id}/export": {
      "get": {
        "parameters": [
          {
            "description": "Rule name or identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "default": "json",
              "enum": [
                "json",
                "yaml"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RuleImportItem"
                }
              },
              "application/x-yaml": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Rule export"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Export a rule as JSON or YAML"
      }
    },
    "/api/v1/screening/check": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "customer_id": {
                    "type": "string"
                  },
                  "list_ids": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "customer_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningBatchResponse"
                }
              }
            },
            "description": "Screening batch result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Run an immediate screening check"
      }
    },
    "/api/v1/screening/results": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "list_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "enum": [
                "NEW",
                "REVIEWING",
                "TRUE_POSITIVE",
                "FALSE_POSITIVE"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Restrict to suppressed or unsuppressed hits; omitted returns both",
            "in": "query",
            "name": "suppressed",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedScreeningResults"
                }
              }
            },
            "description": "Screening results"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List durable screening results"
      }
    },
    "/api/v1/screening/results/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Screening result identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningResult"
                }
              }
            },
            "description": "Screening result"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a durable screening result"
      },
      "patch": {
        "parameters": [
          {
            "description": "Screening result identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScreeningReviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningReviewOutcome"
                }
              }
            },
            "description": "Updated screening result"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Review a screening result"
      }
    },
    "/api/v1/screening/results/{id}/history": {
      "get": {
        "parameters": [
          {
            "description": "Screening result identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ScreeningResultHistory"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Screening result history"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List screening result decision history"
      }
    },
    "/api/v1/screening/runs": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "customer_id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedScreeningRuns"
                }
              }
            },
            "description": "Screening runs"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List durable screening runs"
      }
    },
    "/api/v1/screening/runs/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Screening run identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningRun"
                }
              }
            },
            "description": "Screening run"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a durable screening run"
      }
    },
    "/api/v1/screening/sources": {
      "get": {
        "parameters": [
          {
            "description": "Comma-separated configured source identifiers",
            "in": "query",
            "name": "source_ids",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "freshness_threshold_seconds",
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScreeningSourceDirectory"
                }
              }
            },
            "description": "Screening source readiness"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List the configured screening source directory"
      }
    },
    "/api/v1/setup": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "email": {
                    "format": "email",
                    "type": "string"
                  },
                  "password": {
                    "format": "password",
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            },
            "description": "Administrator profile"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "security": [],
        "summary": "Create the first administrator"
      }
    },
    "/api/v1/system/capabilities": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capabilities"
                }
              }
            },
            "description": "Capability availability for the calling principal"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "Get the server-sourced capability contract"
      }
    },
    "/api/v1/system/config-digests": {
      "get": {
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Not Found"
          },
          "429": {
            "description": "Too Many Requests"
          }
        },
        "summary": "Get loaded configuration digests"
      }
    },
    "/api/v1/system/info": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemInfo"
                }
              }
            },
            "description": "System information"
          }
        },
        "summary": "Get runtime system information"
      }
    },
    "/api/v1/system/status": {
      "get": {
        "parameters": [
          {
            "description": "Force a live dependency check instead of reusing a cached result",
            "in": "query",
            "name": "refresh",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SystemStatus"
                }
              }
            },
            "description": "System status"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          }
        },
        "summary": "Get runtime readiness and active configuration provenance"
      }
    },
    "/api/v1/transactions": {
      "get": {
        "parameters": [
          {
            "description": "Max items per page (default 50, max 200)",
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 200,
              "type": "integer"
            }
          },
          {
            "description": "Opaque pagination cursor from a previous response's pagination.next_cursor",
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            }
          },
          {
            "deprecated": true,
            "description": "Deprecated: use cursor instead",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          },
          {
            "description": "Customer whose transactions are listed",
            "in": "query",
            "name": "customer_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedTransactions"
                }
              }
            },
            "description": "Transactions"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List Transactions"
      },
      "post": {
        "parameters": [
          {
            "description": "Optional key used to make a retried transaction create exactly once",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransactionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transaction"
                }
              }
            },
            "description": "Created transaction"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Business validation failed"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create Transaction"
      }
    },
    "/api/v1/transactions/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Transaction identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transaction"
                }
              }
            },
            "description": "Transaction"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get transaction"
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Webhook"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Webhooks"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List configured webhooks"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/WebhookCreateRequest"
                  }
                ],
                "required": [
                  "url",
                  "events"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "Created webhook"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Create a webhook subscription"
      }
    },
    "/api/v1/webhooks/dlq": {
      "get": {
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DLQEntry"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Webhook DLQ entries"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List undelivered webhook DLQ entries"
      }
    },
    "/api/v1/webhooks/dlq/{id}/reprocess": {
      "post": {
        "parameters": [
          {
            "description": "DLQ entry identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookReprocessResponse"
                }
              }
            },
            "description": "Webhook reprocess result"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Reprocess a webhook DLQ entry"
      }
    },
    "/api/v1/webhooks/inbound/customer-status": {
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CustomerStatusWebhookRequest"
                  }
                ],
                "required": [
                  "external_id",
                  "status"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Updated customer"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Apply a core-system customer status notification with an atomic audit record"
      }
    },
    "/api/v1/webhooks/inbound/customers": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Merlon-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Merlon-Timestamp",
            "required": true,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Merlon-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[0-9a-f]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboundWebhookBatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundWebhookEvent"
                }
              }
            },
            "description": "Durably accepted inbound webhook event"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "HTTP 413"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Accept an authenticated inbound customers batch"
      }
    },
    "/api/v1/webhooks/inbound/events/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Inbound event identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundWebhookEventView"
                }
              }
            },
            "description": "Inbound webhook event"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get inbound webhook processing status and per-record outcomes"
      }
    },
    "/api/v1/webhooks/inbound/events/{id}/replay": {
      "post": {
        "parameters": [
          {
            "description": "Inbound event identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundWebhookEvent"
                }
              }
            },
            "description": "Inbound webhook replay accepted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Replay a failed or dead-lettered inbound webhook event (Admin)"
      }
    },
    "/api/v1/webhooks/inbound/transactions": {
      "post": {
        "parameters": [
          {
            "in": "header",
            "name": "X-Merlon-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Merlon-Timestamp",
            "required": true,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-Merlon-Signature",
            "required": true,
            "schema": {
              "pattern": "^v1=[0-9a-f]{64}$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboundWebhookBatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundWebhookEvent"
                }
              }
            },
            "description": "Durably accepted inbound webhook event"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "HTTP 413"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Accept an authenticated inbound transactions batch"
      }
    },
    "/api/v1/webhooks/{id}": {
      "delete": {
        "parameters": [
          {
            "description": "Webhook identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Deleted webhook"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Delete a webhook subscription"
      },
      "get": {
        "parameters": [
          {
            "description": "Webhook identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "Webhook"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a webhook subscription"
      }
    },
    "/api/v1/webhooks/{id}/deliveries": {
      "get": {
        "parameters": [
          {
            "description": "Webhook identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookDelivery"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Webhook deliveries"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List durable webhook deliveries"
      }
    },
    "/api/v1/whitelist": {
      "get": {
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "maximum": 100,
              "type": "integer"
            }
          },
          {
            "deprecated": true,
            "description": "Legacy offset pagination; the endpoint currently accepts offset only",
            "in": "query",
            "name": "offset",
            "schema": {
              "default": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "$ref": "#/components/schemas/WhitelistEntry"
                      },
                      "type": "array"
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Paginated whitelist entries"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "List whitelist entries"
      },
      "post": {
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "customer_id": {
                    "type": "string"
                  },
                  "excluded_rule_ids": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "valid_until": {
                    "format": "date-time",
                    "type": "string"
                  }
                },
                "required": [
                  "customer_id",
                  "reason",
                  "valid_until"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhitelistEntry"
                }
              }
            },
            "description": "Created whitelist entry"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Request a whitelist entry"
      }
    },
    "/api/v1/whitelist/{id}": {
      "get": {
        "parameters": [
          {
            "description": "Whitelist entry identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhitelistEntry"
                }
              }
            },
            "description": "Whitelist entry"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Get a whitelist entry"
      }
    },
    "/api/v1/whitelist/{id}/approve": {
      "post": {
        "parameters": [
          {
            "description": "Whitelist entry identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhitelistEntry"
                }
              }
            },
            "description": "Approved whitelist entry"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Approve a pending whitelist entry"
      }
    },
    "/api/v1/whitelist/{id}/reviews": {
      "post": {
        "parameters": [
          {
            "description": "Whitelist entry identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "decision": {
                    "enum": [
                      "renewed",
                      "revoked"
                    ],
                    "type": "string"
                  },
                  "new_valid_until": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "next_review_date": {
                    "format": "date",
                    "type": "string"
                  },
                  "review_notes": {
                    "type": "string"
                  }
                },
                "required": [
                  "decision"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhitelistReview"
                }
              }
            },
            "description": "Whitelist review"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Validation failed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Record a whitelist review"
      }
    },
    "/api/v1/whitelist/{id}/revoke": {
      "post": {
        "parameters": [
          {
            "description": "Whitelist entry identifier",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhitelistEntry"
                }
              }
            },
            "description": "Revoked whitelist entry"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Authentication required"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Permission denied"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Resource not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Optimistic-lock or lifecycle conflict"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal repository failure"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Required storage is unavailable"
          }
        },
        "summary": "Revoke a whitelist entry"
      }
    },
    "/healthz": {
      "get": {
        "responses": {
          "200": {
            "description": "Healthy"
          },
          "503": {
            "description": "Service Unavailable"
          }
        },
        "security": [],
        "summary": "Health check"
      }
    },
    "/healthz/live": {
      "get": {
        "responses": {
          "200": {
            "description": "Healthy"
          }
        },
        "security": [],
        "summary": "Liveness probe"
      }
    },
    "/healthz/ready": {
      "get": {
        "responses": {
          "200": {
            "description": "Healthy"
          },
          "503": {
            "description": "Service Unavailable"
          }
        },
        "security": [],
        "summary": "Readiness probe"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "description": "This deployment",
      "url": "/"
    }
  ]
}
