# updateEvent (https://www.cal-sdk.com/docs/reference/update-event)

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.

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

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

## Options [#options]

<TypeTable
  type={{
    eventId: { type: 'string', required: true },
    patch: { type: 'EventPatch', description: 'Fields to change. Left out fields stay as they are; `null` clears a field. `start` and `end` can be replaced, not cleared.', required: true },
    calendarId: { type: 'string', default: "'primary'" },
    scope: { type: "'this' | 'all' | 'thisAndFollowing'", description: 'For occurrence and exception ids: change only this instance, the whole series, or this and later instances.', default: "'this'" },
    ifMatch: { type: 'string', description: "Only update if the event's `etag` still matches, otherwise throw `ConflictError`." },
    sendUpdates: { type: "'all' | 'externalOnly' | 'none'", description: 'Whether attendees are notified.' },
  }}
/>

Plus the [common options](/docs/reference#common-options). `EventPatch` has the fields of [`EventInput`](/docs/reference/create-event#eventinput), all optional.

## Result [#result]

<TypeTable
  type={{
    event: { type: 'CalendarEvent', description: 'The updated event. Its `id` can differ from `eventId`: Cal.com replaces a booking when it moves. Use the returned id from then on.', required: true },
    warnings: { type: 'Warning[]', required: true },
  }}
/>

## Throws [#throws]

- `NotFoundError` when the event does not exist.
- `ConflictError` when `ifMatch` no longer matches.
- `InvalidArgumentError` for the same input problems as [`createEvent`](/docs/reference/create-event#throws), or a `null` `start` or `end`.
- `UnsupportedFunctionalityError` for a scope, rule or change the provider cannot make.
