{
  "$id": "https://intentschema.org/intents/productivity/calendar/event/cancel/v1.json",
  "fqdn": "org.intentschema.productivity.calendar.event.cancel.v1",
  "title": "Cancel calendar event",
  "description": "Cancel an existing event and notify attendees via iTIP CANCEL. Reversibility note: a series-CANCEL fan-out to many attendees is hard to unwind.",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "allOf": [
          {
            "$ref": "https://intentschema.org/common/target/v1.json"
          },
          {
            "required": [
              "external_id"
            ]
          }
        ]
      },
      "object": {
        "type": "object",
        "properties": {
          "comment": {
            "type": "string",
            "description": "Optional note included in the cancellation notification."
          },
          "notify_attendees": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "idempotency_key": {
        "type": "string"
      }
    }
  },
  "result": {
    "type": "object",
    "properties": {
      "external_id": {
        "type": "string"
      },
      "cancelled_at": {
        "type": "string",
        "format": "date-time"
      }
    }
  },
  "examples": [
    {
      "name": "cancel event",
      "value": {
        "target": {
          "system": "google_calendar",
          "external_id": "evt_abc123"
        },
        "object": {
          "comment": "Conflict; will reschedule."
        }
      }
    }
  ]
}
