{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "Resource lifecycle status."
    },
    "admission": {
      "anyOf": [
        {
          "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": false
        },
        {
          "type": "null"
        }
      ]
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "number"
          },
          "watch": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Resource identifier returned by the operation."
              },
              "workspace_id": {
                "type": "string",
                "description": "Workspace that owns this record."
              },
              "project_id": {
                "type": "string",
                "description": "Project that owns this record."
              },
              "status": {
                "type": "string",
                "enum": [
                  "active",
                  "paused"
                ],
                "description": "Resource lifecycle status."
              },
              "cadence_seconds": {
                "type": "number"
              },
              "state": {
                "type": "string",
                "description": "Saved lifecycle or evidence state, as enumerated for this record."
              },
              "observation_state": {
                "type": "object",
                "properties": {
                  "state": {
                    "description": "Saved lifecycle or evidence state, as enumerated for this record.",
                    "type": "string"
                  },
                  "uncertain": {
                    "type": "boolean"
                  },
                  "checked_at": {
                    "description": "UTC timestamp of the saved check.",
                    "type": "string"
                  },
                  "lastChangedAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "firstAbsentAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "consecutiveAbsent": {
                    "type": "number"
                  },
                  "nextCheckAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "reason": {
                    "description": "Recorded explanation; null when no explanation applies.",
                    "anyOf": [
                      {
                        "type": "string",
                        "description": "Recorded explanation; null when no explanation applies."
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "latestAttempt": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "state": {
                            "description": "Saved lifecycle or evidence state, as enumerated for this record.",
                            "type": "string"
                          },
                          "reason": {
                            "description": "Recorded explanation; null when no explanation applies.",
                            "anyOf": [
                              {
                                "type": "string",
                                "description": "Recorded explanation; null when no explanation applies."
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "checkedAt": {
                            "type": "string"
                          },
                          "httpStatus": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "occurrenceCount": {
                            "type": "number"
                          },
                          "occurrences": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "href": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "targetUrl": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "anchor": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "rel": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "context": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "locator": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "line": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "column": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "offset": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "additionalProperties": {}
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": {}
                            }
                          },
                          "checkerVersion": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastSuccessfulObservation": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "state": {
                            "description": "Saved lifecycle or evidence state, as enumerated for this record.",
                            "type": "string"
                          },
                          "reason": {
                            "description": "Recorded explanation; null when no explanation applies.",
                            "anyOf": [
                              {
                                "type": "string",
                                "description": "Recorded explanation; null when no explanation applies."
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "checkedAt": {
                            "type": "string"
                          },
                          "httpStatus": {
                            "anyOf": [
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "occurrenceCount": {
                            "type": "number"
                          },
                          "occurrences": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "href": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "targetUrl": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "anchor": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "rel": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "context": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "locator": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "line": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "column": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "offset": {
                                          "anyOf": [
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "additionalProperties": {}
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": {}
                            }
                          },
                          "checkerVersion": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastSuccessfulObservationSameAsLatestAttempt": {
                    "type": "boolean"
                  },
                  "confirmedState": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastSuccessfulAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastHealthyAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "firstUnavailableAt": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "unavailableCount": {
                    "type": "number"
                  },
                  "wasEverHealthy": {
                    "type": "boolean"
                  },
                  "retryNotBefore": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "ignored": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": {},
                "description": "Saved observation state. Before the first check, this object can be empty."
              },
              "created_at": {
                "type": "string",
                "description": "UTC timestamp when the record was created."
              },
              "updated_at": {
                "type": "string",
                "description": "UTC timestamp of the last record update."
              },
              "last_attempt_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_success_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "last_observation_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "next_check_at": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "overdue_reason": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "source_url": {
                "type": "string",
                "description": "Publisher page URL recorded in this evidence."
              },
              "target_url": {
                "type": "string",
                "description": "Destination URL recorded in this evidence."
              },
              "target_scope": {
                "type": "string"
              },
              "expected_anchor": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expected_rel": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "local_reference": {
                "anyOf": [
                  {
                    "type": "string",
                    "description": "Customer reference for joining this record to a local ledger entry."
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Customer reference for joining this record to a local ledger entry."
              },
              "last_successful_observation_id": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "history_compacted_before": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "created": {
                "description": "True when this request created the record; false when an existing record was reused.",
                "type": "boolean"
              },
              "detail": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "workspace_id",
              "project_id",
              "status",
              "cadence_seconds",
              "state",
              "observation_state",
              "created_at",
              "updated_at",
              "last_attempt_at",
              "last_success_at",
              "last_observation_id",
              "next_check_at",
              "overdue_reason",
              "source_url",
              "target_url",
              "target_scope",
              "expected_anchor",
              "expected_rel",
              "local_reference",
              "last_successful_observation_id"
            ],
            "additionalProperties": {}
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "admission": {
                "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"
                  }
                },
                "required": [
                  "index",
                  "url",
                  "normalized_url",
                  "host",
                  "decision",
                  "reason",
                  "rule_kind",
                  "rule_id",
                  "rule_value",
                  "cap",
                  "subject_key"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": {}
          }
        },
        "required": [
          "index"
        ],
        "additionalProperties": {}
      }
    },
    "imported": {
      "type": "number"
    },
    "accepted": {
      "type": "number"
    },
    "created": {
      "type": "number",
      "description": "True when this request created the record; false when an existing record was reused."
    },
    "existing": {
      "type": "number"
    },
    "failed": {
      "type": "number"
    }
  },
  "required": [
    "status",
    "rows",
    "imported",
    "accepted",
    "created",
    "existing",
    "failed"
  ],
  "additionalProperties": {}
}
