{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coldrig-dev/json-schema/coldrig-dev-cancel-result-schema.json",
  "title": "CancelResult",
  "description": "`effective` is `end_of_period` or `immediate`. `teardown` is `null` for an end-of-period cancel (nothing is released by that call) and the release summary for an immediate one. `periodEndsAt` is the end of the paid period as Stripe gave it when this call scheduled an end-of-period cancel that keeps running campaigns sending until then, and `null` otherwise (an immediate cancel, a repeated call, an account with no Stripe subscription, or one that was not paid up, which stops sending at once).\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coldrig-dev-account-api-openapi.yml#/components/schemas/CancelResult",
  "type": "object",
  "required": [
    "alreadyCanceled",
    "billingState",
    "effective",
    "teardown",
    "periodEndsAt"
  ],
  "properties": {
    "alreadyCanceled": {
      "type": "boolean"
    },
    "billingState": {
      "type": "string",
      "description": "`canceling` or `canceled` right after the call."
    },
    "effective": {
      "type": "string",
      "enum": [
        "end_of_period",
        "immediate"
      ]
    },
    "periodEndsAt": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Epoch milliseconds, from Stripe: when sending stops; `null` when this call stored no date."
    },
    "teardown": {
      "type": [
        "object",
        "null"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/CancelTeardown"
        }
      ]
    }
  },
  "$defs": {
    "CancelTeardown": {
      "type": "object",
      "description": "What an immediate cancel released. `mailboxReleaseFailures` counts mailboxes the provider refused to release; they are still live.\n",
      "required": [
        "reason",
        "effective",
        "domainsReleased",
        "mailboxesReleased",
        "mailboxReleaseFailures",
        "campaignsStopped",
        "annualDomainLiabilityCents",
        "ts"
      ],
      "properties": {
        "reason": {
          "type": "string",
          "enum": [
            "voluntary_cancel",
            "abuse_terminate"
          ]
        },
        "effective": {
          "type": "string"
        },
        "domainsReleased": {
          "type": "integer"
        },
        "mailboxesReleased": {
          "type": "integer"
        },
        "mailboxReleaseFailures": {
          "type": "integer"
        },
        "campaignsStopped": {
          "type": "integer"
        },
        "annualDomainLiabilityCents": {
          "type": "integer"
        },
        "ts": {
          "type": "integer",
          "description": "Epoch milliseconds."
        }
      }
    }
  }
}