{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/schedchie-com/json-schema/schedchie-com-account-analytics-schema.json",
  "title": "AccountAnalytics",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/schedchie-com-openapi.json#/components/schemas/AccountAnalytics",
  "type": "object",
  "required": [
    "accountId",
    "platform"
  ],
  "properties": {
    "accountId": {
      "type": "string"
    },
    "platform": {
      "type": "string"
    },
    "username": {
      "type": "string"
    },
    "providerState": {
      "type": "string"
    },
    "range": {
      "$ref": "#/$defs/AnalyticsRange"
    },
    "kpis": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "value": {},
          "change": {}
        }
      }
    },
    "series": {
      "type": "object",
      "description": "Daily series keyed by metric."
    },
    "posts": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "postMetricKeys": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "audience": {
      "type": "array"
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "comingSoon": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "access": {
      "type": "object",
      "description": "Why the platform's numbers are missing, when they are (`permissions_required`, `reconnect_required`, `unavailable`).",
      "properties": {
        "state": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "missingScopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "expectedState": {
      "type": "string"
    }
  },
  "$defs": {
    "AnalyticsRange": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "days": {
          "type": "integer"
        },
        "previous": {
          "type": "object",
          "description": "The comparison period, when `compare` was set."
        }
      }
    }
  }
}