{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commsharbor/json-schema/commsharbor-metricas-schema.json",
  "title": "Metricas",
  "description": "7-day operator dashboard. `payments` only appears with the token and only on Base mainnet.",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commsharbor-metrics-api-openapi.yml#/components/schemas/Metricas",
  "type": "object",
  "properties": {
    "app": {
      "type": "string",
      "description": "Product name."
    },
    "today": {
      "type": "string",
      "description": "Reference day (UTC, YYYY-MM-DD)."
    },
    "today_visits": {
      "type": "integer",
      "description": "Interface visits counted today."
    },
    "today_contacts": {
      "type": "integer",
      "description": "Contact messages today. Only with `METRICS_TOKEN`: contact counts never leave without the token."
    },
    "days": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "One row per day of the window, with each metric's count."
    },
    "usage": {
      "type": "object",
      "description": "`entregas`: deliveries per day — real product usage, not catalog load."
    },
    "accounts": {
      "type": "object",
      "description": "`organizacoes`: total organizations registered."
    },
    "financeiro": {
      "type": "object",
      "description": "Day aggregate: `hoje_usd`, `hoje_count`, `rede`. Only with `METRICS_TOKEN`: money never leaves without the token; the full series is `payments`."
    },
    "payments": {
      "type": "object",
      "description": "x402 financial summary; METRICS_TOKEN only."
    }
  },
  "required": [
    "app",
    "today",
    "today_visits",
    "days",
    "usage",
    "accounts"
  ]
}