{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/antwork-io/json-schema/antwork-io-engagement-history-schema.json",
  "title": "EngagementHistory",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/antwork-io-openapi.json#/components/schemas/EngagementHistory",
  "type": "object",
  "required": [
    "object",
    "schema",
    "rows",
    "rowCount",
    "workspaceId",
    "days"
  ],
  "properties": {
    "object": {
      "const": "engagement_history"
    },
    "schema": {
      "type": "object",
      "description": "Column names and BigQuery-style types (STRING, INTEGER, DATE, BOOL); every column is NULLABLE.",
      "properties": {
        "fields": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "mode": {
                "const": "NULLABLE"
              }
            }
          }
        }
      }
    },
    "rows": {
      "type": "array",
      "description": "Workspace: date, platform (`all` for the day), likes, comments, shares, impressions, reachBasis, reach, saves, clicks, bookmarks, linkClicks, profileVisits, follows, watchTimeSeconds, degraded, awaitingPermission. Post: date, platform, cumulative* and daily* for each counter, spanDays, unreadableFields, awaitingPermission.",
      "items": {
        "type": "object",
        "additionalProperties": {
          "type": [
            "string",
            "number",
            "boolean",
            "null"
          ]
        }
      }
    },
    "rowCount": {
      "type": "integer"
    },
    "workspaceId": {
      "type": "string"
    },
    "postId": {
      "type": "string",
      "description": "With `postId` only."
    },
    "days": {
      "type": [
        "integer",
        "null"
      ]
    },
    "startDate": {
      "type": "string",
      "format": "date"
    },
    "endDate": {
      "type": "string",
      "format": "date"
    },
    "platforms": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "platformTotals": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "additionalProperties": {
          "type": "number"
        }
      }
    },
    "rangeTotals": {
      "type": "object",
      "additionalProperties": {
        "type": [
          "number",
          "null"
        ]
      }
    },
    "followers": {
      "type": "object",
      "description": "A second table, one row per (date, account): date, accountId, accountName, platform, followers (null, never 0, when not counted), dailyChange, approximate, unavailableReason."
    },
    "message": {
      "type": "string",
      "description": "Present when there is no daily data yet."
    }
  }
}