deleteEvent

Deletes an event, one occurrence, or a series.

For a recurring event, scope decides whether one occurrence, the rest of the series or the whole series goes. Pass sendUpdates to tell the guests, where the provider can.

import { deleteEvent } from '@cal-sdk/core';

await deleteEvent({ calendar, eventId });

Options

eventIdstring
calendarId?string= 'primary'
scope?'this' | 'all' | 'thisAndFollowing'= 'this'
For occurrence and exception ids: delete only this instance, the whole series, or this and later instances.
ifMatch?string
Only delete if the event's etag still matches, otherwise throw ConflictError. On Outlook, calsdk checks it just before deleting, so a change in between isn't caught.
sendUpdates?'all' | 'externalOnly' | 'none'
Whether attendees are notified.

Plus the common options.

Result

{ warnings }, plus providerMetadata and response when the provider sets them.

Throws

  • NotFoundError when the event does not exist. If a retry finds the event gone because an earlier attempt deleted it, the call succeeds instead.
  • ConflictError when ifMatch no longer matches.
  • UnsupportedFunctionalityError for a scope the provider cannot use, or on a read-only ICS feed.

On this page