{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://backscroll.hubersoftware.com/schemas/backscroll-export.schema.json",
  "title": "Backscroll JSON export envelope, version 1",
  "type": "object",
  "required": ["schema_version", "channel", "channel_id", "exported_at", "count", "partial", "messages"],
  "properties": {
    "schema_version": { "const": 1 },
    "product": { "type": "string" },
    "channel": { "type": "string" },
    "channel_id": { "type": "string", "pattern": "^[0-9]+$" },
    "guild_id": { "type": ["string", "null"] },
    "exported_at": { "type": "string", "format": "date-time" },
    "count": { "type": "integer", "minimum": 0 },
    "partial": { "type": "boolean" },
    "date_range": {
      "type": "object",
      "properties": { "after": { "type": ["number", "null"] }, "before_exclusive": { "type": ["number", "null"] } }
    },
    "messages": { "type": "array", "items": { "$ref": "https://backscroll.hubersoftware.com/schemas/backscroll-message.schema.json#/$defs/message" } }
  },
  "additionalProperties": true
}
