{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-cancel-subscription-request-schema.json",
  "title": "CancelSubscriptionRequest",
  "description": "Request to cancel a subscription.\n\nDefault behavior cancels at period end (soft cancel). Pass `immediate=True`\nto terminate the subscription right away — this requires `confirm` to equal\nthe subscription's `resource_id` (e.g. the graph_id) as a guard against\naccidental destructive calls.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-billing-api-openapi.yml#/components/schemas/CancelSubscriptionRequest",
  "properties": {
    "immediate": {
      "type": "boolean",
      "title": "Immediate",
      "description": "If true, cancel immediately and trigger fast-path deprovisioning of the underlying resource (within ~10 minutes). If false (default), cancel at the end of the current billing period.",
      "default": false
    },
    "confirm": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Confirm",
      "description": "Required when immediate=True. Must equal the subscription's resource_id (e.g. graph_id) to confirm intent."
    },
    "user_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "User Id",
      "description": "Organization member whose subscription to cancel. Defaults to the caller; canceling another member's requires org owner or admin."
    }
  },
  "additionalProperties": false,
  "type": "object"
}