{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/statoss-com/json-schema/statoss-com-monitor-schema.json",
  "title": "Monitor",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/statoss-com-openapi.json#/components/schemas/Monitor",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The monitor id."
    },
    "pageId": {
      "type": "string",
      "description": "The page it is on."
    },
    "name": {
      "type": "string",
      "description": "Shown on the page."
    },
    "type": {
      "type": "string",
      "description": "What is checked.",
      "enum": [
        "http",
        "tcp",
        "dns",
        "ping",
        "certificate",
        "domain",
        "heartbeat",
        "component"
      ]
    },
    "target": {
      "type": "string",
      "description": "The URL, host and port, or record, in words."
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "http: the URL requested."
    },
    "host": {
      "type": [
        "string",
        "null"
      ],
      "description": "tcp, dns, ping, certificate, domain: the hostname."
    },
    "port": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tcp and certificate: the port."
    },
    "dnsType": {
      "type": [
        "string",
        "null"
      ],
      "description": "dns: A, AAAA, CNAME, MX, TXT or NS."
    },
    "dnsExpect": {
      "type": [
        "string",
        "null"
      ],
      "description": "dns: text an answer must contain."
    },
    "warnDays": {
      "type": [
        "integer",
        "null"
      ],
      "description": "certificate and domain: fails this many days before expiry."
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "certificate and domain: when the certificate or the registration expires, ISO 8601, as the newest check read it."
    },
    "heartbeat": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "periodSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Seconds between expected pings."
        },
        "graceSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Seconds of grace after the period."
        },
        "lastPingAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO 8601, UTC.",
          "format": "date-time"
        },
        "pingUrl": {
          "type": [
            "string",
            "null"
          ],
          "description": "The address the job requests, by GET or POST, each time it runs. Only for a key with write access; null for a read key."
        }
      }
    },
    "group": {
      "type": [
        "string",
        "null"
      ],
      "description": "Monitors with the same group are shown together, where the group's first monitor stands. A body may send it as group or groupName."
    },
    "method": {
      "type": [
        "string",
        "null"
      ],
      "description": "http: the request method.",
      "enum": [
        "GET",
        "HEAD",
        "POST",
        "PUT",
        "PATCH",
        "DELETE"
      ]
    },
    "expectStatus": {
      "type": [
        "integer",
        "null"
      ],
      "description": "http: the exact status expected, or null for any 2xx. Redirects are followed and the last answer judged, unless this is 300 to 399: then nothing is followed and the first answer must have it."
    },
    "keyword": {
      "type": [
        "string",
        "null"
      ],
      "description": "http: text the body must contain, or must not. tcp: text the server's greeting must contain."
    },
    "keywordMode": {
      "type": [
        "string",
        "null"
      ],
      "description": "present or absent.",
      "enum": [
        "present",
        "absent"
      ]
    },
    "slowThresholdMs": {
      "type": [
        "integer",
        "null"
      ],
      "description": "A successful response slower than this is slow."
    },
    "slowThresholds": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "integer"
      },
      "description": "Some regions' own thresholds, region to ms: a reading from one is slow above its number instead. Null: slowThresholdMs everywhere."
    },
    "latencyLocations": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "description": "A region, by name."
      },
      "description": "The monitor's own regions for response times. Null: its page's."
    },
    "homePlaces": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "description": "A place or a region, by name."
      },
      "description": "Overrides the page's homePlaces region by region: a place runs that region's checks, a region name leaves it to its fastest place. A region left out, or null, follows the page."
    },
    "pinnedRegion": {
      "type": [
        "string",
        "null"
      ],
      "description": "Checked from this region alone, for a site that lets only its fixed IP in. Null: every region."
    },
    "vendorUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "component: the vendor status page it follows. Pro."
    },
    "vendorComponent": {
      "type": [
        "string",
        "null"
      ],
      "description": "component: one component on the vendor's page, by name."
    },
    "position": {
      "type": "integer",
      "description": "Order on the page, from 0. Set by position on create and update, or by PUT /pages/{pageId}/monitors/order."
    },
    "archivedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "When it was archived, ISO 8601: off the page and its feeds, not checked, not counted against the plan, its history kept. Null for a live monitor.",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "description": "up, slow, down or unknown before the first check.",
      "enum": [
        "up",
        "slow",
        "down",
        "unknown"
      ]
    },
    "since": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 8601, UTC.",
      "format": "date-time"
    },
    "downFrom": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "description": "A region, by name: North America."
      },
      "description": "While down from some regions and up in the others: those regions. Null when not down, or down everywhere."
    },
    "lastCheck": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "at": {
          "type": "string",
          "description": "ISO 8601, UTC.",
          "format": "date-time"
        },
        "ok": {
          "type": "boolean",
          "description": "Whether it passed."
        },
        "statusCode": {
          "type": [
            "integer",
            "null"
          ],
          "description": "http: the status received; after redirects, the last hop's."
        },
        "latencyMs": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The response time, in milliseconds."
        },
        "error": {
          "type": [
            "string",
            "null"
          ],
          "description": "Why it failed, when it did."
        }
      }
    },
    "uptime24h": {
      "type": [
        "number",
        "null"
      ],
      "description": "Share of checks passed in the last 24 hours, in percent."
    },
    "latencyMs24h": {
      "type": [
        "number",
        "null"
      ],
      "description": "Median response time over the last 24 hours, as the page shows it: each counted region levelled to its fastest shared place, several regions averaged. Null for heartbeat, certificate and domain monitors."
    },
    "createdAt": {
      "type": "string",
      "description": "ISO 8601, UTC.",
      "format": "date-time"
    }
  }
}