updateEvent

Applies a partial update to an event, one occurrence, or a series.

Use updateEvent to move a meeting, rename it or change who's invited. Send only the fields that change, and for a recurring event, scope decides how much of the series changes with it.

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

const { event } = await updateEvent({
  calendar,
  eventId,
  patch: { title: 'Moved to Friday', location: null },
  ifMatch: previous.etag,
});

Options

eventIdstring
patchEventPatch
Fields to change. Left out fields stay as they are; null clears a field. start and end can be replaced, not cleared.
calendarId?string= 'primary'
scope?'this' | 'all' | 'thisAndFollowing'= 'this'
For occurrence and exception ids: change only this instance, the whole series, or this and later instances.
ifMatch?string
Only update if the event's etag still matches, otherwise throw ConflictError.
sendUpdates?'all' | 'externalOnly' | 'none'
Whether attendees are notified.

Plus the common options. EventPatch has the fields of EventInput, all optional.

Result

eventCalendarEvent
The updated event. Its id can differ from eventId: Cal.com replaces a booking when it moves. Use the returned id from then on.
warningsWarning[]

Throws

  • NotFoundError when the event does not exist.
  • ConflictError when ifMatch no longer matches.
  • InvalidArgumentError for the same input problems as createEvent, or a null start or end.
  • UnsupportedFunctionalityError for a scope, rule or change the provider cannot make.

On this page