{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/uptimemonitoring-com/json-schema/uptimemonitoring-com-webhook-delivery-list-response-schema.json",
  "title": "WebhookDeliveryListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/uptimemonitoring-com-webhook-deliveries-api-openapi.yml#/components/schemas/WebhookDeliveryListResponse",
  "type": "object",
  "properties": {
    "deliveries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookDelivery"
      }
    },
    "total": {
      "type": "integer"
    },
    "limit": {
      "type": "integer"
    },
    "offset": {
      "type": "integer"
    }
  },
  "$defs": {
    "WebhookDelivery": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "webhook_id": {
          "type": "integer",
          "format": "int64",
          "description": "A recipient id (issue #212) — the field name is kept for wire\ncompatibility; it has not named a row in the legacy `webhooks`\ntable since the recipients migration. A row can represent an\nemail delivery (issue #321), a Slack post (issue #359), or a\nPagerDuty Events API v2 event (issue #363) as well as a\nwebhook POST — check the referenced recipient's `type` to tell\nwhich; `last_response_code` is SendGrid's status for email\n(202 on success, 0 on transport error), the destination's HTTP\nstatus for webhook, Slack's own HTTP status for slack\n(`response_body` carries Slack's error string, e.g.\n`\"no_service\"`), and PagerDuty's own HTTP status for pagerduty\n(`response_body` carries FIXED outcome text, e.g.\n`\"PagerDuty accepted the event (HTTP 202)\"` or\n`\"PagerDuty rate-limited the event (HTTP 429)\"` — never\nPagerDuty's actual response body, which could echo the\nrouting key) — for both slack and pagerduty, only 429 and 5xx\nretry; every other non-2xx, 3xx included, is terminal on the\nfirst attempt. A pagerduty row with no `outage_id` — enqueued\nbefore issue #363, or an \"up\" recovery whose onset transition\nleft no open incident to inherit an outage id from — fails\nimmediately with `response_body` `\"no outage key\"` and no\nrequest ever sent; such a recovery is never reported to\nPagerDuty.\n"
        },
        "monitor_id": {
          "type": "integer",
          "format": "int64"
        },
        "account_id": {
          "type": "integer",
          "format": "int64"
        },
        "event_type": {
          "type": "string"
        },
        "payload_hash": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "retrying",
            "delivered",
            "failed",
            "superseded",
            "cancelled"
          ],
          "description": "`superseded` (added for issue #165): an older `pending`/`retrying`\ndelivery for the same webhook+monitor pair was replaced by a\nnewer one, bounding a swarm of stale notifications after an\noutage recovers to at most one live delivery per pair at a\ntime. Not immutably terminal: the\nreplacement is not atomic with dispatch, so a delivery already\nin flight when it was superseded can still complete and\ntransition to `delivered` for that one attempt — a subscriber\ncan still receive a delivery for a transition that was\nsuperseded before it arrived.\n\n`cancelled` (added for issue #338): a delayed `down` delivery\nwhose outage recovered before its `down_delay_s` elapsed, or\nwhose recipient's events narrowed to drop `down` while the\nrow was still pending. Never reused for `superseded` — nothing\nreplaced the row, it was simply never sent. Also not\nimmutably terminal: a row already claimed for dispatch when an\nevents-narrowing edit cancels it can still complete and\ntransition to `delivered`.\n"
        },
        "attempt_count": {
          "type": "integer"
        },
        "collapsed_count": {
          "type": "integer",
          "description": "The number of older live (`pending`/`retrying`) delivery rows\nthis row superseded, plus their own accumulated collapsed\ncounts. Zero for a delivery that superseded nothing. This is\nNOT a count of POSTs guaranteed suppressed, and NOT a count of\ntransitions the subscriber missed: a superseded row can still\nbe in flight and reach `delivered` after being counted here.\nMirrors the outbound `collapsed_transitions` payload field.\n"
        },
        "next_attempt_at": {
          "type": "string",
          "format": "date-time"
        },
        "last_attempt_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "last_response_code": {
          "type": [
            "integer",
            "null"
          ]
        },
        "response_body": {
          "type": [
            "string",
            "null"
          ],
          "description": "Truncated copy (≤4096 bytes, NUL-stripped, valid UTF-8) of the\nsubscriber's HTTP response body from the last attempt, for\n`type=webhook`/`type=email`/`type=slack`. Present to help\ndebug rejected deliveries; null for rows recorded before this\nwas captured or when the subscriber returned no body. For\n`type=pagerduty` (issue #363), this is NEVER the actual\nresponse body — it is always one of a small set of fixed\noutcome strings (e.g. `\"PagerDuty accepted the event (HTTP\n202)\"`, `\"PagerDuty rejected the event (HTTP 400)\"`,\n`\"PagerDuty request failed (timeout)\"`, or `\"no outage key\"`),\nbecause a real PagerDuty response body could echo the request\nback, including the routing key.\n"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "cancelled_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Set only when status is `cancelled` (issue"
        },
        "enqueued_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The Postgres server clock's own stamp of this row's insert\nmoment (issue #396) — distinct from `created_at`, which is\nthe dispatcher's own Go-clock transition time and so cannot\nbe compared against anything the database generates. Null\nfor a row written before this column existed; every reader\ntreats null as \"before any boundary\". Used by the\n`?recipient_id=&order=id` drain scan (see\n`/api/v1/webhook-deliveries`'s description) and the guarded\n`DELETE /api/v1/recipients/{recipientID}?replaced_by=`\nendpoint to decide whether a row predates a replacement\nrecipient's attachment.\n"
        }
      }
    }
  }
}