{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codex-reset-com/json-schema/codex-reset-com-timeline-schema.json",
  "title": "Timeline",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codex-reset-com-timeline-api-openapi.yml#/components/schemas/Timeline",
  "type": "object",
  "required": [
    "updated_at",
    "events",
    "stats"
  ],
  "properties": {
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "events": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/$defs/TimelineEvent"
          },
          {
            "required": [
              "confirmed",
              "banked_grant"
            ],
            "properties": {
              "group": {
                "enum": [
                  "reset",
                  "credits"
                ]
              }
            }
          }
        ]
      }
    },
    "stats": {
      "type": "object"
    }
  },
  "$defs": {
    "TimelineEvent": {
      "type": "object",
      "required": [
        "id",
        "date",
        "type",
        "group",
        "summary",
        "announced_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "date": {
          "type": "string",
          "format": "date"
        },
        "type": {
          "type": "string"
        },
        "group": {
          "type": "string",
          "enum": [
            "reset",
            "credits",
            "boost",
            "unlock"
          ],
          "description": "credits = a banked grant or its update. /api/timeline returns only reset and credits; /api/feed events may still carry boost and unlock rows."
        },
        "summary": {
          "type": "string",
          "description": "≤180-character excerpt, or the site's own summary for an observed row."
        },
        "text": {
          "type": "string",
          "description": "Credits rows: the full post."
        },
        "localized_summary": {
          "type": "string"
        },
        "localized_text": {
          "type": "string"
        },
        "url": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "announced_at": {
          "type": "string",
          "format": "date-time"
        },
        "announcement_state": {
          "type": "string",
          "description": "announced = ✅ for an ordinary reset."
        },
        "banked_state": {
          "type": "string",
          "enum": [
            "announced",
            "arriving",
            "available",
            "unknown"
          ]
        },
        "source": {
          "type": "string"
        },
        "observed_variant": {
          "type": "string"
        },
        "preview": {
          "type": "boolean"
        },
        "confirmed": {
          "type": "boolean",
          "description": "A reset row counts as a verified global reset; banked rows are true."
        },
        "banked_grant": {
          "type": "boolean",
          "description": "true on the row that is a banked grant; false on a grant's later updates."
        }
      }
    }
  }
}