{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/devmargin-app/json-schema/devmargin-app-push-metrics-body-schema.json",
  "title": "metrics — latest state",
  "description": "Every field is optional; send only what you actually know. A missing\nfield shows as “—” and stays honestly unknown.\n\nOn a channel backed by a billing rail, `users` is the ONLY field\naccepted — everything else is the rail's to report.\n",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/devmargin-app-openapi-openapi.yml#/components/schemas/PushMetricsBody",
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "format": "uuid",
      "description": "Channel id, from Projects → the project → its channel."
    },
    "metrics": {
      "type": "object",
      "properties": {
        "users": {
          "type": "integer",
          "minimum": 0,
          "description": "The only field a rail-backed channel accepts."
        },
        "activeSubs": {
          "type": "integer",
          "minimum": 0
        },
        "newSubs": {
          "type": "integer",
          "minimum": 0
        },
        "churnedSubs": {
          "type": "integer",
          "minimum": 0
        },
        "mrr": {
          "type": "number",
          "minimum": 0,
          "description": "Push-rail channels only."
        },
        "arr": {
          "type": "number",
          "minimum": 0,
          "description": "Push-rail channels only."
        },
        "oneOffRevenue": {
          "type": "number",
          "minimum": 0,
          "description": "Push-rail channels only. Do not also report this money through\n`earned`, or the same takings are described twice.\n"
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Z]{3}$",
          "description": "ISO-4217. Converted to USD at snapshot FX."
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "channel",
    "metrics"
  ],
  "additionalProperties": false
}