{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "operation_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "project_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200,
      "description": "Project that owns this record."
    },
    "context": {
      "type": "string",
      "enum": [
        "import",
        "candidate",
        "candidate_batch",
        "serve"
      ]
    },
    "decisions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "url": {
            "type": "string"
          },
          "normalized_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "host": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "decision": {
            "type": "string",
            "enum": [
              "admitted",
              "rejected"
            ]
          },
          "reason": {
            "type": "string",
            "description": "Recorded explanation; null when no explanation applies."
          },
          "rule_kind": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "rule_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "rule_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "cap": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "limit": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "used": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "limit",
                  "used"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "subject_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        },
        "required": [
          "index",
          "url",
          "normalized_url",
          "host",
          "decision",
          "reason",
          "rule_kind",
          "rule_id",
          "rule_value",
          "cap",
          "subject_key"
        ],
        "additionalProperties": false
      }
    },
    "summary": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "admitted": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "rejected": {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "by_rule": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        }
      },
      "required": [
        "total",
        "admitted",
        "rejected",
        "by_rule"
      ],
      "additionalProperties": false,
      "description": "Grouped change counts included in this delivery, limited to accessible websites."
    },
    "policy_revision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "disavow_revision": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "replayed": {
      "type": "boolean",
      "description": "True when the response reuses an earlier request with the same idempotency value."
    }
  },
  "required": [
    "operation_id",
    "project_id",
    "context",
    "decisions",
    "summary",
    "policy_revision",
    "disavow_revision",
    "replayed"
  ],
  "additionalProperties": {}
}
