{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "global-relay-event-card.json",
  "title": "Global Relay Event Card",
  "description": "An event card archived in the Global Relay Archive, representing activity from collaboration platforms, social media, or customer experience tools. Cards contain sections, each with individual events.",
  "type": "object",
  "required": [
    "cardId",
    "channelType",
    "sections"
  ],
  "properties": {
    "cardId": {
      "type": "string",
      "description": "Unique identifier for the event card"
    },
    "channelType": {
      "type": "string",
      "description": "The type of digital channel",
      "enum": [
        "SocialMedia",
        "Collaboration",
        "CustomerExperience",
        "Website",
        "Other"
      ]
    },
    "title": {
      "type": "string",
      "description": "Title of the event card"
    },
    "source": {
      "type": "string",
      "description": "Source platform name"
    },
    "sections": {
      "type": "array",
      "description": "Sections within the event card",
      "items": {
        "type": "object",
        "required": [
          "sectionId",
          "events"
        ],
        "properties": {
          "sectionId": {
            "type": "string",
            "description": "Unique identifier for the section"
          },
          "title": {
            "type": "string",
            "description": "Title of the section"
          },
          "events": {
            "type": "array",
            "description": "Events within this section",
            "items": {
              "type": "object",
              "required": [
                "eventType",
                "timestamp"
              ],
              "properties": {
                "eventType": {
                  "type": "string",
                  "description": "Type of event",
                  "enum": [
                    "Post",
                    "Comment",
                    "Reply",
                    "Reaction",
                    "Share",
                    "Edit",
                    "Delete",
                    "Like",
                    "Follow"
                  ]
                },
                "timestamp": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Timestamp of the event in ISO 8601 format"
                },
                "author": {
                  "type": "object",
                  "properties": {
                    "authorId": {
                      "type": "string",
                      "description": "Unique identifier for the author"
                    },
                    "displayName": {
                      "type": "string",
                      "description": "Display name of the author"
                    },
                    "email": {
                      "type": "string",
                      "format": "email",
                      "description": "Email address of the author"
                    }
                  }
                },
                "body": {
                  "type": "string",
                  "description": "Content body of the event"
                },
                "fileIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "IDs of files uploaded via /files endpoint"
                },
                "metadata": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  },
                  "description": "Additional metadata key-value pairs"
                }
              }
            }
          }
        }
      }
    }
  }
}
