# Update and delete calendar events

Source: https://developer.nylas.com/docs/cookbook/calendar/update-delete-events/

You created an event from your app, and now the meeting moves or gets cancelled. You need to push that change back to every attendee's calendar, the same way the create call did, without writing separate update logic for Google, Outlook, and the rest.

The Nylas Events API uses one update call and one delete call. You change the fields that moved, or remove the event entirely, and the participants see the update on their own calendars across all 4 providers.

## How do I update an event?

Send a `PUT /v3/grants/{grant_id}/events/{event_id}` request with the `calendar_id` query parameter and the fields you want to change. Nylas applies the update and notifies participants, so a new time or title reaches attendees' calendars across all 4 providers. Top-level fields merge, but a nested object like `when` is replaced wholesale, so send the complete block to reschedule.

The request below reschedules an event and updates its title and participants.

```bash
curl --compressed --request PUT \
  --url 'https://api.us.nylas.com/v3/grants/<NYLAS_GRANT_ID>/events/<EVENT_ID>?calendar_id=<CALENDAR_ID>' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "Birthday Party",
    "busy": true,
    "participants": [{
      "name": "Leyah Miller",
      "email": "leyah@example.com",
      "comment": "Might be late."
    }],
    "resources": [{
      "name": "Conference room",
      "email": "conference-room@example.com"
    }],
    "description": "Come ready to skate",
    "when": {
      "start_time": 1406887200,
      "end_time": 1417435200,
      "start_timezone": "America/New_York",
      "end_timezone": "America/New_York"
    },
    "location": "Roller Rink",
    "recurrence": [
      "RRULE:FREQ=WEEKLY;BYDAY=MO",
      "EXDATE:20211011T000000Z"
    ],
    "conferencing": {
        "provider": "Zoom Meeting",
        "autocreate": {
          "conf_grant_id": "<NYLAS_GRANT_ID>",
          "conf_settings": {
            "settings": {
              "join_before_host": true,
              "waiting_room": false,
              "mute_upon_entry": false,
              "auto_recording": "none"
            }
          }
        }
      },
    "reminder_minutes": "[20]",
    "reminder_method": "popup"
}'

```

## How do I delete an event?

Send a `DELETE /v3/grants/{grant_id}/events/{event_id}` request with the `calendar_id` query parameter. Nylas removes the event from the user's calendar and, for events with participants, sends a cancellation on their provider. This works the same across all 4 providers, so you delete a Google event and an Outlook event with an identical call.

```bash
curl --compressed --request DELETE \
  --url 'https://api.us.nylas.com/v3/grants/<NYLAS_GRANT_ID>/events/<EVENT_ID>?calendar_id=<CALENDAR_ID>' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json'

```

## Things to know about updating and deleting events

A couple of provider behaviors matter here. The `calendar_id` query parameter is required on both calls, because an event ID is only unique within its calendar, so passing the wrong calendar returns an error. Updates and deletes propagate to participants as provider notifications, so don't loop a bulk update without considering the invitation email it generates across all 4 providers.

Recurring events behave differently: updating or deleting one occurrence, the rest of the series, or the whole series each take a different approach. See [Recurring events and RRULE](/docs/v3/calendar/recurring-events/) for editing and deleting parts of a series.

## What's next

- [Create Google events](/docs/cookbook/calendar/events/create-events-google/) for the create side of the lifecycle
- [Recurring events and RRULE](/docs/v3/calendar/recurring-events/) to edit or delete occurrences in a series
- [RSVP to calendar event invitations](/docs/cookbook/calendar/rsvp-to-events/) to respond instead of editing
- [Get real-time updates with webhooks](/docs/cookbook/use-cases/build/realtime-webhooks/) for event.updated and event.deleted notifications