{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/insidercable-com/json-schema/insidercable-com-feed-envelope-schema.json",
  "title": "FeedEnvelope",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/insidercable-com-openapi.json#/components/schemas/FeedEnvelope",
  "type": "object",
  "required": [
    "feed",
    "tier",
    "records"
  ],
  "properties": {
    "feed": {
      "type": "string"
    },
    "generated_at": {
      "type": "string"
    },
    "snapshot_sha256": {
      "type": [
        "string",
        "null"
      ]
    },
    "anchored_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": "string"
    },
    "rights": {
      "type": "string"
    },
    "provenance_note": {
      "type": "string"
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "forms_recorded": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "tier": {
      "$ref": "#/$defs/Tier"
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "happened_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "when the event occurred, per the source"
          },
          "observed_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "when this pipeline first saw the record"
          },
          "provenance": {
            "type": "string",
            "enum": [
              "observed",
              "pre-existing"
            ]
          }
        },
        "additionalProperties": true
      }
    }
  },
  "$defs": {
    "Tier": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "free",
            "token",
            "x402"
          ]
        },
        "total_in_feed": {
          "type": "integer"
        },
        "matched_filters": {
          "type": "integer"
        },
        "returned": {
          "type": "integer"
        },
        "withheld_for_freshness": {
          "type": "integer"
        },
        "truncated_by_cap": {
          "type": "integer"
        },
        "upgrade": {
          "type": "string"
        },
        "auth": {
          "type": "string",
          "enum": [
            "degraded"
          ]
        }
      }
    }
  }
}