{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/MonthlyQuotaNotice/v1/schema.json",
  "title": "MonthlyQuotaNotice",
  "description": "The data of the webhook events MonthlyQuotaApproaching and MonthlyQuotaReached: an OrganizationAccount's billable requests this month crossed a step of its spending cap (monthlyQuota). MonthlyQuotaApproaching is sent at 80, 85, 90 and 95%, MonthlyQuotaReached at 100%, when requests start getting 429. Each step is sent once a month; raising the cap re-arms the steps above the new usage. It holds no personal data.",
  "type": "object",
  "properties": {
    "organizationAccountID": {
      "type": "string",
      "description": "The OrganizationAccount whose usage crossed the step"
    },
    "month": {
      "type": "string",
      "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$",
      "description": "The calendar month (UTC), YYYY-MM"
    },
    "percentUsed": {
      "type": "integer",
      "enum": [80, 85, 90, 95, 100],
      "description": "The step crossed, as a share of the cap"
    },
    "usage": {
      "type": "integer",
      "minimum": 0,
      "description": "The billable requests counted this month when the step was crossed"
    },
    "cap": {
      "type": "integer",
      "minimum": 1,
      "description": "The spending cap the step is a share of: monthlyQuota, or the default when it is 0"
    }
  },
  "required": ["organizationAccountID", "month", "percentUsed", "usage", "cap"],
  "additionalProperties": false
}
