{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ufcalendar-com/json-schema/ufcalendar-com-event-live-response-schema.json",
  "title": "EventLiveResponse",
  "description": "`data` is null with `meta.live: false` when nothing is being streamed.",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ufcalendar-com-openapi.json#/components/schemas/EventLiveResponse",
  "type": "object",
  "properties": {
    "data": {
      "oneOf": [
        {
          "$ref": "#/$defs/LiveState"
        },
        {
          "type": "null"
        }
      ]
    },
    "meta": {
      "type": "object",
      "properties": {
        "live": {
          "type": "boolean",
          "description": "true only while the event is in progress on the stream."
        },
        "websocket": {
          "type": "string",
          "description": "`wss://live.ufcalendar.com/v1` — add `?key=<key>`."
        },
        "subscribe": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "const": "subscribe"
            },
            "event": {
              "type": "string",
              "description": "The slug to send."
            }
          },
          "required": [
            "action",
            "event"
          ],
          "additionalProperties": false
        },
        "ignored_params": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Present only when the request carried query parameters this endpoint does not take — they were ignored. Same list as the `X-UFCalendar-Ignored-Params` header. Sorted, unique."
        }
      },
      "required": [
        "live",
        "websocket",
        "subscribe"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "additionalProperties": false,
  "$defs": {
    "LiveState": {
      "type": "object",
      "description": "The real-time fight-night document — the same one the WebSocket `wss://live.ufcalendar.com/v1` pushes and `GET /v1/events/{idOrSlug}/live` returns. Open-ended by design: `current`, `card[]` and the timeline grow with the feed. Unofficial in-fight numbers; the official result and totals land on `/v1/fights/{id}` and `/v1/fights/{id}/stats` when the bout is settled.",
      "properties": {
        "v": {
          "type": "integer",
          "description": "Document version."
        },
        "seq": {
          "type": "integer",
          "description": "Publish sequence within one run (restarts count from 1 again — order by `ts`)."
        },
        "ts": {
          "type": "integer",
          "description": "Unix milliseconds of this publish."
        },
        "hash": {
          "type": "string",
          "description": "Content hash; a new document is published only when it changes."
        },
        "event": {
          "type": "object",
          "additionalProperties": true,
          "description": "`{id, slug, fmid, name, org, status, source}`."
        },
        "card": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          },
          "description": "Bout order and statuses (`upcoming` / `live` / `final`), corners (`a`/`b` with `fighter_id`, `name`, `short`) and results."
        },
        "current": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true,
          "description": "The bout in the cage: `phase`, `round`, `possible_rounds`, `round_length_sec`, `round_started_at`, `clock_sec`, `official`, `stats` (`a`/`b` totals), `rounds[]`, `timeline[]`."
        },
        "last": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true,
          "description": "The last finished bout: `fight_id`, `winner` (`a`/`b`/null), `method`, `round`, `time`."
        }
      },
      "required": [
        "v",
        "seq",
        "ts",
        "hash",
        "event",
        "card"
      ],
      "additionalProperties": true
    }
  }
}