{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Cancel an active subscription",
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "subscriptionUri": {
              "description": "AT-URI of the subscription to cancel",
              "format": "at-uri",
              "type": "string"
            },
            "workflow": {
              "description": "Workflow callback envelope. Present on agent-driven callbacks; absent on initial calls.",
              "ref": "com.atiproto.actions#inboundWorkflow",
              "type": "ref"
            }
          },
          "required": [
            "subscriptionUri"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "accessUntil": {
              "description": "Timestamp when access expires",
              "format": "datetime",
              "type": "string"
            },
            "subscription": {
              "description": "Updated subscription record",
              "ref": "com.atiproto.subscription#view",
              "type": "ref"
            },
            "subscriptionUri": {
              "description": "URI of the updated subscription record",
              "format": "at-uri",
              "type": "string"
            },
            "workflow": {
              "description": "Workflow envelope. When present, the agent runs the actions and calls back. When absent, this is the final native result.",
              "ref": "com.atiproto.actions#outboundWorkflow",
              "type": "ref"
            }
          },
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "com.atiproto.payment.subscription.cancel",
  "lexicon": 1
}
