{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cherami-to/json-schema/cherami-to-quota-schema.json",
  "title": "Quota",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cherami-to-sending-api-openapi.yml#/components/schemas/Quota",
  "type": "object",
  "properties": {
    "allowance": {
      "type": "integer",
      "minimum": 0,
      "description": "Recipients the account can send to in any 24 hours."
    },
    "used": {
      "type": "integer",
      "minimum": 0,
      "description": "Recipients charged in the last 24 hours."
    },
    "remaining": {
      "type": "integer",
      "minimum": 0,
      "description": "Recipients you can send to now."
    },
    "next_capacity_at": {
      "anyOf": [
        {
          "type": "string",
          "description": "UTC timestamp with milliseconds.",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        {
          "type": "null"
        }
      ],
      "description": "When the next units return; null when nothing is charged."
    },
    "next_capacity_amount": {
      "type": "integer",
      "minimum": 0,
      "description": "Recipients that become available at next_capacity_at."
    },
    "window_hours": {
      "const": 24
    },
    "unit": {
      "const": "recipient_deliveries",
      "description": "One unit per To, Cc or Bcc recipient."
    },
    "increase_request": {
      "type": "string",
      "description": "How to ask for a larger allowance."
    },
    "policy_url": {
      "type": "string"
    }
  },
  "required": [
    "allowance",
    "used",
    "remaining",
    "next_capacity_at",
    "next_capacity_amount",
    "window_hours",
    "unit",
    "increase_request",
    "policy_url"
  ]
}