{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pdata-world/json-schema/pdata-world-event-tombstone-out-schema.json",
  "title": "EventTombstoneOut",
  "description": "An event the retention sweep deleted, served at its original URL.\n\n`app/pipeline/retention.py` hard-deletes events closed more than 10\ndays ago. This row is what it captured on the way out, and it is all\nthat exists: there is no market history, no chart, no similar-events\nlist behind it. `/history` and `/similar` on the same id keep 404ing.\n\nRows are written once and never refreshed (see\n`retention.capture_event_tombstones`), so every field here describes\nthe event's final observed state, not its current one.",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pdata-world-openapi.json#/components/schemas/EventTombstoneOut",
  "properties": {
    "kind": {
      "type": "string",
      "const": "tombstone",
      "title": "Kind",
      "description": "Always \"tombstone\": the event closed more than 10 days ago and only this final record remains, with no price history. A live event has kind \"live\".",
      "default": "tombstone"
    },
    "source": {
      "type": "string",
      "title": "Source",
      "description": "Venue the event comes from: polymarket, kalshi, manifold, myriad, limitless, predict, opinion or gemini."
    },
    "id": {
      "type": "string",
      "title": "Id",
      "description": "The venue's own event id; unique within `source`."
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Title",
      "description": "The event's title when it was archived."
    },
    "categories": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Categories",
      "description": "pdata's topic categories for the event when it was archived.",
      "default": []
    },
    "closed_time": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Closed Time",
      "description": "When the event closed (UTC): the venue's close time, else its end date, else when pdata last updated it. For a Kalshi game event it can be the scheduled expiry, a day or two after the game ended, not the moment trading stopped."
    },
    "url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Url",
      "description": "The event's page on the venue's website. Null when it could not be built; it is never a guessed link."
    },
    "resolution": {
      "items": {
        "$ref": "#/$defs/TombstoneMarketOut"
      },
      "type": "array",
      "title": "Resolution",
      "description": "Final state of the event's top markets, at most 10: markets that resolved YES first, then by lifetime volume (events archived before 2026-10-07: by volume only). Empty when the markets were already gone when the event was archived.",
      "default": []
    },
    "pruned_at": {
      "type": "string",
      "format": "date-time",
      "title": "Pruned At",
      "description": "When pdata archived the event (UTC). Not the close date; that is `closed_time`."
    },
    "_meta": {
      "anyOf": [
        {
          "$ref": "#/$defs/ResponseMetaResource"
        },
        {
          "type": "null"
        }
      ],
      "description": "Response metadata: attribution, canonical URL, as-of time, docs link and `cite_as`, a ready-to-quote citation sentence."
    }
  },
  "type": "object",
  "required": [
    "source",
    "id",
    "pruned_at"
  ],
  "$defs": {
    "ResponseMetaResource": {
      "properties": {
        "attribution": {
          "type": "string",
          "title": "Attribution",
          "description": "Who aggregated this data, under which licence, and whose data it is.",
          "default": "Data aggregated by pdata.world (https://pdata.world) from Polymarket, Kalshi, Manifold, Myriad, Limitless, Predict, Opinion and Gemini; CC BY 4.0; source data © each venue."
        },
        "canonical_url": {
          "type": "string",
          "title": "Canonical Url",
          "description": "Stable URL for this resource: the pdata.world page, or the API URL for list responses."
        },
        "as_of": {
          "type": "string",
          "format": "date-time",
          "title": "As Of",
          "description": "When this response was generated (UTC)."
        },
        "docs": {
          "type": "string",
          "title": "Docs",
          "description": "API documentation.",
          "default": "https://api.pdata.world/docs"
        },
        "hint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hint",
          "description": "Advice for the next call, present only when there is some: today, why a search may have come back empty and where else to look. Absent otherwise."
        },
        "total_capped": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Capped",
          "description": "Set on `?search=` and `/search/suggest` responses only. `true` when more rows matched than the search inspects (20,000 per table; 5,000 for the typo-tolerant fallback): `meta.total` (or `total_events` / `total_markets`) is then a lower bound, not the exact count. `/markets` pages normally stay in exact order. `/events` stays in exact order for events matched by their own text and may miss events matched only through a child market. `/search/suggest` ranks the inspected rows only. Absent when the count is exact."
        },
        "cite_as": {
          "type": "string",
          "title": "Cite As",
          "description": "A ready-made citation sentence: what the data says, its as-of date, and the canonical URL. Safe to quote verbatim."
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Url",
          "description": "The same event or market on the venue's own website. NULL for venues without public event pages."
        },
        "data_as_of": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data As Of",
          "description": "When pdata last wrote a change to the data in this response (UTC): for an event, the newest `updated_at` among all its markets (a market's row is rewritten when its price, volume or status changes); for a market, its own `updated_at`. An open event's or market's `cite_as` carries the same date. `as_of` is when the response was built. Absent on a tombstone, whose record is final."
        }
      },
      "type": "object",
      "required": [
        "canonical_url",
        "cite_as"
      ],
      "title": "ResponseMetaResource",
      "description": "Agent metadata for single-resource responses (with cite_as)."
    },
    "TombstoneBeforeCloseOut": {
      "properties": {
        "outcome": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outcome",
          "description": "The outcome the prices belong to: the market's first outcome, `Yes` on a yes/no market, else its label (`Over`, a team's name). Null when the venue named none."
        },
        "closed_at": {
          "type": "string",
          "format": "date-time",
          "title": "Closed At",
          "description": "When trading on this market ended (UTC), the moment `prices` counts back from: the earlier of the venue's close time and the moment pdata saw the market close. A venue can close a market after the outcome was already known."
        },
        "prices": {
          "items": {
            "$ref": "#/$defs/TombstonePriceBeforeCloseOut"
          },
          "type": "array",
          "title": "Prices",
          "description": "The price 1, 7 and 30 days before `closed_at`, nearest the close first. A horizon is left out when pdata held no usable quote for it: the market had not traded yet, or its order book was one-sided or wider than 10 points."
        }
      },
      "type": "object",
      "required": [
        "closed_at",
        "prices"
      ],
      "title": "TombstoneBeforeCloseOut",
      "description": "An archived market's prices from before it closed: what the venue's\ntraders thought 1, 7 and 30 days before trading ended."
    },
    "TombstoneMarketOut": {
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Id",
          "description": "The venue's own market id."
        },
        "question": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Question",
          "description": "The outcome's label: the venue's short outcome title where it sets one (e.g. a candidate's name), else the market's full question."
        },
        "result": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Result",
          "description": "The venue's own reported outcome: yes or no in the venue's casing, or the winning label for a market whose two outcomes are not Yes/No. Null when the venue reported none, and for Polymarket events archived before 2026-10-07."
        },
        "probability": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Probability",
          "description": "The last price pdata saw, in [0, 1]. Usually taken after the market settled, so it records the result; it is not a forecast."
        },
        "volume": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Volume",
          "description": "Lifetime trading volume when the event was archived. Venue-reported, in the venue's own unit and not converted across venues: shares for Polymarket and contracts for Kalshi (each pays $1 at resolution), play-money mana for Manifold, and each other venue's figure as it reports it."
        },
        "before_close": {
          "anyOf": [
            {
              "$ref": "#/$defs/TombstoneBeforeCloseOut"
            },
            {
              "type": "null"
            }
          ],
          "description": "What this market cost 1, 7 and 30 days before it closed: a forecast, where `probability` beside it is the settled price. Polymarket and Kalshi only, the first three markets of `resolution` only, and only for events archived since November 2026. Absent when pdata kept no usable price."
        }
      },
      "type": "object",
      "title": "TombstoneMarketOut",
      "description": "One outcome of a pruned event, frozen at prune time.\n\nEvery field is optional because every field could legitimately be\nabsent on the live row: sources differ in what they publish, and a\nmarket that merely closed (rather than resolved) never gets a\n`result`. The resolved-outcome page states only what is known."
    },
    "TombstonePriceBeforeCloseOut": {
      "properties": {
        "days_before_close": {
          "type": "integer",
          "title": "Days Before Close",
          "description": "How many days before `closed_at` the price is for: 1, 7 or 30."
        },
        "probability": {
          "type": "number",
          "title": "Probability",
          "description": "The price of `outcome` at that moment, in [0, 1]: the last one pdata recorded at or before it, at most 48 hours earlier."
        },
        "recorded_at": {
          "type": "string",
          "format": "date-time",
          "title": "Recorded At",
          "description": "When pdata recorded that price (UTC)."
        }
      },
      "type": "object",
      "required": [
        "days_before_close",
        "probability",
        "recorded_at"
      ],
      "title": "TombstonePriceBeforeCloseOut",
      "description": "What a market cost a set number of days before it closed."
    }
  }
}