{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postbase-so/json-schema/postbase-so-analytics-post-schema.json",
  "title": "AnalyticsPost",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postbase-so-openapi.json#/components/schemas/AnalyticsPost",
  "type": "object",
  "properties": {
    "post_id": {
      "type": "string",
      "format": "uuid"
    },
    "body": {
      "type": "string"
    },
    "published_at": {
      "type": "string",
      "format": "date-time"
    },
    "channels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "channel_id": {
            "type": "string"
          },
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "handle": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "metrics": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "metrics_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    },
    "totals": {
      "$ref": "#/$defs/Metrics"
    }
  },
  "$defs": {
    "Metrics": {
      "type": "object",
      "properties": {
        "impressions": {
          "type": [
            "number",
            "null"
          ]
        },
        "likes": {
          "type": "number"
        },
        "comments": {
          "type": "number"
        },
        "shares": {
          "type": "number"
        },
        "saves": {
          "type": "number"
        },
        "engagement": {
          "type": "number",
          "description": "likes + comments + shares + saves"
        }
      }
    }
  }
}