{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rumoro-dev/json-schema/rumoro-dev-analytics-summary-schema.json",
  "title": "AnalyticsSummary",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rumoro-dev-analytics-api-openapi.yml#/components/schemas/AnalyticsSummary",
  "type": "object",
  "properties": {
    "window": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "The first day included."
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
          "description": "The last day included."
        },
        "days": {
          "type": "integer",
          "minimum": 0,
          "description": "How many days the window spans."
        },
        "timezone": {
          "type": "string",
          "description": "The IANA time zone used to split the days."
        }
      },
      "required": [
        "from",
        "to",
        "days",
        "timezone"
      ],
      "description": "Start and end of the period."
    },
    "matched": {
      "type": "integer",
      "minimum": 0,
      "description": "All matches in the window, relevant or not. Usage counts this number."
    },
    "relevant": {
      "type": "integer",
      "minimum": 0,
      "description": "Matches whose relevance score reached the threshold."
    },
    "posts": {
      "type": "integer",
      "minimum": 0,
      "description": "Unique posts among the matches. A post that matches two keywords counts as two matches but one post."
    },
    "people": {
      "type": "integer",
      "minimum": 0,
      "description": "Unique authors among the matches."
    },
    "sentiment": {
      "type": "object",
      "properties": {
        "positive": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches with positive sentiment."
        },
        "neutral": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches with neutral sentiment."
        },
        "negative": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches with negative sentiment."
        },
        "unclassified": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches without a score, either still waiting or failed."
        }
      },
      "required": [
        "positive",
        "neutral",
        "negative",
        "unclassified"
      ],
      "description": "Sentiment split of the matched mentions."
    },
    "buyIntent": {
      "type": "integer",
      "minimum": 0,
      "description": "Matches tagged buy_intent."
    },
    "questions": {
      "type": "integer",
      "minimum": 0,
      "description": "Matches tagged question."
    },
    "reach": {
      "type": "object",
      "properties": {
        "followers": {
          "type": "integer",
          "minimum": 0,
          "description": "The total followers of the unique authors with a known count. A rough idea of how many feeds the posts reached."
        },
        "people": {
          "type": "integer",
          "minimum": 0,
          "description": "The number of `people` whose follower count is known."
        }
      },
      "required": [
        "followers",
        "people"
      ],
      "description": "An estimate of reach."
    },
    "triage": {
      "type": "object",
      "properties": {
        "open": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches with status open."
        },
        "ignored": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches with status ignored."
        },
        "done": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches with status done."
        },
        "waiting": {
          "type": "integer",
          "minimum": 0,
          "description": "Relevant matches still open more than 24 hours after they matched."
        },
        "handledRate": {
          "type": [
            "number",
            "null"
          ],
          "description": "The done count over the relevant count. Null if nothing was relevant."
        },
        "medianTimeToDoneMs": {
          "type": [
            "number",
            "null"
          ],
          "description": "The median time in milliseconds between a match and its done status. Null when nothing is done."
        }
      },
      "required": [
        "open",
        "ignored",
        "done",
        "waiting",
        "handledRate",
        "medianTimeToDoneMs"
      ],
      "description": "The status of the matches in your inbox."
    },
    "previous": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "matched": {
          "type": "integer",
          "minimum": 0,
          "description": "All matches in the window, relevant or not. Usage counts this number."
        },
        "relevant": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches whose relevance score reached the threshold."
        },
        "posts": {
          "type": "integer",
          "minimum": 0,
          "description": "Unique posts among the matches. A post that matches two keywords counts as two matches but one post."
        },
        "people": {
          "type": "integer",
          "minimum": 0,
          "description": "Unique authors among the matches."
        },
        "sentiment": {
          "type": "object",
          "properties": {
            "positive": {
              "type": "integer",
              "minimum": 0,
              "description": "Matches with positive sentiment."
            },
            "neutral": {
              "type": "integer",
              "minimum": 0,
              "description": "Matches with neutral sentiment."
            },
            "negative": {
              "type": "integer",
              "minimum": 0,
              "description": "Matches with negative sentiment."
            },
            "unclassified": {
              "type": "integer",
              "minimum": 0,
              "description": "Matches without a score, either still waiting or failed."
            }
          },
          "required": [
            "positive",
            "neutral",
            "negative",
            "unclassified"
          ],
          "description": "Sentiment split of the matched mentions."
        },
        "buyIntent": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches tagged buy_intent."
        },
        "questions": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches tagged question."
        },
        "reach": {
          "type": "object",
          "properties": {
            "followers": {
              "type": "integer",
              "minimum": 0,
              "description": "The total followers of the unique authors with a known count. A rough idea of how many feeds the posts reached."
            },
            "people": {
              "type": "integer",
              "minimum": 0,
              "description": "The number of `people` whose follower count is known."
            }
          },
          "required": [
            "followers",
            "people"
          ],
          "description": "An estimate of reach."
        },
        "triage": {
          "type": "object",
          "properties": {
            "open": {
              "type": "integer",
              "minimum": 0,
              "description": "Matches with status open."
            },
            "ignored": {
              "type": "integer",
              "minimum": 0,
              "description": "Matches with status ignored."
            },
            "done": {
              "type": "integer",
              "minimum": 0,
              "description": "Matches with status done."
            },
            "waiting": {
              "type": "integer",
              "minimum": 0,
              "description": "Relevant matches still open more than 24 hours after they matched."
            },
            "handledRate": {
              "type": [
                "number",
                "null"
              ],
              "description": "The done count over the relevant count. Null if nothing was relevant."
            },
            "medianTimeToDoneMs": {
              "type": [
                "number",
                "null"
              ],
              "description": "The median time in milliseconds between a match and its done status. Null when nothing is done."
            }
          },
          "required": [
            "open",
            "ignored",
            "done",
            "waiting",
            "handledRate",
            "medianTimeToDoneMs"
          ],
          "description": "The status of the matches in your inbox."
        }
      },
      "required": [
        "matched",
        "relevant",
        "posts",
        "people",
        "sentiment",
        "buyIntent",
        "questions",
        "reach",
        "triage"
      ],
      "description": "With compare=true, the same counts for the equal period before. Otherwise null."
    }
  },
  "required": [
    "window",
    "matched",
    "relevant",
    "posts",
    "people",
    "sentiment",
    "buyIntent",
    "questions",
    "reach",
    "triage",
    "previous"
  ]
}