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;
nullclears a field.startandendcan 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
etagstill matches, otherwise throwConflictError. - 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
idcan differ fromeventId: Cal.com replaces a booking when it moves. Use the returned id from then on. - warningsWarning[]
Throws
NotFoundErrorwhen the event does not exist.ConflictErrorwhenifMatchno longer matches.InvalidArgumentErrorfor the same input problems ascreateEvent, or anullstartorend.UnsupportedFunctionalityErrorfor a scope, rule or change the provider cannot make.