{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/donolink/json-schema/donolink-activity-schema.json",
  "title": "Activity",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/donolink-openapi.json#/components/schemas/Activity",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "type",
    "platform",
    "occurred_at",
    "recorded_at",
    "actor",
    "message",
    "value",
    "unit",
    "currency",
    "refunded_amount_cents"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(don|evt)_[a-z0-9]{15}$"
    },
    "type": {
      "type": "string",
      "enum": [
        "donation",
        "follow",
        "subscription",
        "giftsub",
        "cheer",
        "raid"
      ]
    },
    "platform": {
      "type": "string",
      "enum": [
        "donolink",
        "twitch",
        "kick",
        "youtube",
        "tiktok",
        "tipeeestream",
        "streamlabs",
        "streamelements",
        "kofi",
        "csv"
      ]
    },
    "occurred_at": {
      "type": "string",
      "format": "date-time"
    },
    "recorded_at": {
      "type": "string",
      "format": "date-time"
    },
    "actor": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "message": {
      "type": [
        "string",
        "null"
      ]
    },
    "value": {
      "type": "integer",
      "minimum": 0
    },
    "unit": {
      "type": "string",
      "enum": [
        "cents",
        "none",
        "months",
        "subscriptions",
        "bits",
        "diamonds",
        "viewers"
      ]
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 4217 code of value for donations: euro as before (\"eur\", or \"EUR\" when unknown), other currencies uppercase (\"PLN\", \"HUF\", ...). Compare case-insensitively. null for other events."
    },
    "refunded_amount_cents": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    }
  }
}