calendar_delete_calendar
Remove an entire calendar and every event in it; non-empty calendars require a preview and owner approval before deletion.
Instructions
Delete a whole calendar with every event in it; one that holds events needs a second call with a token from an owner-approved preview.
Use when: the owner explicitly asks to remove a calendar. Not for removing single events (use calendar_delete_event), for renaming (use calendar_update_calendar), or for keeping some events (move them out first with calendar_move_event). Parameters: calendar is a name (any case) or id from calendar_list_calendars. Omit confirm_token on the first call; pass the preview's token on the second. The token is bound to that calendar and its event count and expires after 10 minutes. Behavior:
An empty calendar is deleted at once.
One with events is left untouched by the first call, which returns a preview: show the owner the count and next events and call again only on their yes.
The default calendar (DEFAULT_CALENDAR, else 'Calendar' or 'Home') is refused; iCloud refuses shared or subscribed calendars.
The owner can restore a deleted calendar at iCloud.com (Settings, then Restore Calendars) for about 30 days; this server cannot. Returns: preview {deleted: false, calendar, events, next [{start, summary}], confirm_token, note}; done {deleted: true, calendar, events_deleted, note}. Errors:
"No calendar named '...'. Use one of: ..." for an unknown name or id: nothing is deleted; pick a listed name or check calendar_list_calendars.
A value that is one calendar's name and another's id is refused, not guessed: use the other calendar's name.
Token invalid, expired or stale because the event count changed: call again without it for a new preview.
Default calendar refused, or iCloud refused the delete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| calendar | Yes | The calendar to delete, by name. | |
| confirm_token | No | From the preview; needed when it holds events. |