{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/canonical/main/json-schema/canonical-get-checks-response-schema.json",
  "title": "GetChecksResponse",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canonical-checks-api-openapi.yml#/components/schemas/GetChecksResponse",
  "allOf": [
    {
      "$ref": "#/$defs/BaseResponse"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/checkInfo"
          }
        }
      }
    }
  ],
  "$defs": {
    "BaseResponse": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Response type, \"sync\"."
        },
        "status-code": {
          "type": "integer",
          "description": "HTTP response status code."
        },
        "status": {
          "type": "string",
          "description": "The description of the HTTP status code.\n\nSee the [IANA list](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).\n"
        }
      }
    },
    "checkInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the check."
        },
        "level": {
          "type": "string",
          "description": "Level of the check.",
          "enum": [
            "alive",
            "ready"
          ]
        },
        "status": {
          "type": "string",
          "description": "Status of the check.",
          "enum": [
            "inactive",
            "down",
            "up"
          ]
        },
        "successes": {
          "type": "integer",
          "description": "Number of successes since check started or status transitioned from \"down\" to \"up\"."
        },
        "failures": {
          "type": "integer",
          "description": "Number of consecutive failures."
        },
        "threshold": {
          "type": "integer",
          "description": "Failure threshold."
        },
        "change-id": {
          "type": "string",
          "description": "ID of the change associated with the check."
        },
        "prev-change-id": {
          "type": "string",
          "description": "ID of the previous change associated with the check."
        }
      }
    }
  }
}