{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codex-reset-com/json-schema/codex-reset-com-dataset-schema.json",
  "title": "Dataset",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codex-reset-com-data-api-openapi.yml#/components/schemas/Dataset",
  "type": "object",
  "required": [
    "title",
    "license",
    "attribution",
    "fields",
    "events"
  ],
  "properties": {
    "title": {
      "type": "string"
    },
    "license": {
      "type": "object"
    },
    "attribution": {
      "type": "string"
    },
    "fields": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DatasetRow"
      }
    }
  },
  "$defs": {
    "DatasetRow": {
      "type": "object",
      "required": [
        "event_id",
        "type",
        "announced_at",
        "date",
        "source"
      ],
      "properties": {
        "event_id": {
          "type": "string",
          "description": "Stable id: the X post id, the post id plus \"-banked\" for the grant a reset post also gave, or the site's own id for a grant only its monitoring saw."
        },
        "type": {
          "type": "string",
          "enum": [
            "reset",
            "banked"
          ],
          "description": "reset (usage limits reset for all users) or banked (a reset credit added to accounts for later use)."
        },
        "announced_at": {
          "type": "string",
          "format": "date-time",
          "description": "When the event was announced, UTC (ISO 8601). For a post, its exact time from the post id."
        },
        "date": {
          "type": "string",
          "format": "date",
          "description": "UTC date of announced_at."
        },
        "source": {
          "type": "string",
          "enum": [
            "post",
            "observed"
          ],
          "description": "post (an X post by @thsottiaux) or observed (the site's monitoring accounts; no post)."
        },
        "post_url": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "const": ""
            }
          ],
          "description": "The source post on X; empty for an observed grant."
        },
        "banked_state": {
          "type": "string",
          "enum": [
            "",
            "announced",
            "arriving",
            "available",
            "unknown"
          ],
          "description": "For a banked grant: announced, arriving, available or unknown. Empty for a reset."
        },
        "summary": {
          "type": "string",
          "description": "One-line English summary of the announcement."
        }
      }
    }
  }
}