{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fettle-sh/json-schema/fettle-sh-heartbeat-read-schema.json",
  "title": "HeartbeatRead",
  "description": "Response model for a heartbeat, including the full ping-URL.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/fettle-sh-api-openapi.json#/components/schemas/HeartbeatRead",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "state": {
      "$ref": "#/$defs/HeartbeatState"
    },
    "period_seconds": {
      "type": "integer",
      "title": "Period Seconds"
    },
    "grace_seconds": {
      "type": "integer",
      "title": "Grace Seconds"
    },
    "ping_url": {
      "type": "string",
      "title": "Ping Url"
    },
    "last_ping_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Ping At"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Success At"
    },
    "last_start_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Start At"
    },
    "last_duration_ms": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Duration Ms"
    },
    "overdue_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Overdue At"
    },
    "notification_cooldown_seconds": {
      "type": "integer",
      "title": "Notification Cooldown Seconds"
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active"
    },
    "channel_ids": {
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "type": "array",
      "title": "Channel Ids"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tags"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "id",
    "name",
    "state",
    "period_seconds",
    "grace_seconds",
    "ping_url",
    "last_ping_at",
    "last_success_at",
    "last_start_at",
    "last_duration_ms",
    "overdue_at",
    "notification_cooldown_seconds",
    "is_active",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "HeartbeatState": {
      "type": "string",
      "enum": [
        "PENDING",
        "UP",
        "DOWN",
        "PAUSED"
      ],
      "title": "HeartbeatState",
      "description": "Lifecycle state of a heartbeat.\n\n``PENDING`` — created, never pinged; the sweep skips it (``overdue_at``\nis NULL) so a freshly created heartbeat does not false-alarm.\n``UP`` — pinged within ``period + grace``; the only state the sweep can\nflip to ``DOWN``.\n``DOWN`` — a ping was missed or the job sent ``/fail``; an incident is open.\n``PAUSED`` — owner-paused; inactive, never alerts."
    }
  }
}