{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/affiliaterail-com/json-schema/affiliaterail-com-risk-flag-list-schema.json",
  "title": "RiskFlagList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/affiliaterail-com-risk-api-openapi.yml#/components/schemas/RiskFlagList",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RiskFlag"
      }
    },
    "has_more": {
      "type": "boolean"
    },
    "total_count": {
      "type": "integer"
    }
  },
  "required": [
    "data",
    "has_more",
    "total_count"
  ],
  "$defs": {
    "RiskFlag": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^(sample_)?rsk_",
          "description": "Prefixed id (`rsk_…`)"
        },
        "object": {
          "type": "string",
          "enum": [
            "risk_flag"
          ]
        },
        "kind": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "reviewing",
            "resolved",
            "dismissed"
          ]
        },
        "evidence": {
          "type": "object",
          "additionalProperties": {},
          "description": "What the check saw: rates, ids, windows"
        },
        "partner": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^(sample_)?part_",
              "description": "Prefixed id (`part_…`)"
            },
            "name": {
              "type": "string"
            },
            "handle": {
              "type": "string"
            },
            "status": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "name",
            "handle",
            "status"
          ]
        },
        "customer": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^(sample_)?cus_",
              "description": "Prefixed id (`cus_…`)"
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "label"
          ]
        },
        "resolved_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "ISO-8601, UTC"
        },
        "resolved_by": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolution_note": {
          "type": [
            "string",
            "null"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "ISO-8601, UTC"
        }
      },
      "required": [
        "id",
        "object",
        "kind",
        "severity",
        "status",
        "evidence",
        "partner",
        "customer",
        "resolved_at",
        "resolved_by",
        "resolution_note",
        "created_at"
      ]
    }
  }
}