Edit & Delete events

Learn how to edit and delete calendar events using Unipile API.

Use the event id returned by the API to update or delete an existing event.

To retrieve an event ID, you can:

  • store the ID returned when creating the event
  • list calendar events
  • fetch a specific event

Update an event

To edit an event, use Update a calendar event.

PATCH is partial, so you only need to send the fields you want to change.

import { UnipileCalendar } from "unipile";

const key = process.env.UNIPILE_API_KEY ?? "";
const calendarApi = new UnipileCalendar({ key });

const { data, error } = await calendarApi.updateCalendarEvent({
  path: {
    account_id: "acc_123456789",
    calendar_id: "calendar_id",
    event_id: "event_id",
  },
  body: {
    title: "Updated meeting",
    location: "Paris office",
    body: "Agenda updated",
  },
});
import unipile

configuration = unipile.Configuration()
configuration.api_key["apiKey"] = "your-api-key"

api_client = unipile.ApiClient(configuration)
calendar_api = unipile.CalendarApi(api_client)

event = calendar_api.update_calendar_event(
    "calendar_id",
    "event_id",
    "acc_123456789",
    {
        "title": "Updated meeting",
        "location": "Paris office",
        "body": "Agenda updated",
    },
)
curl --request PATCH \
     --url https://api.unipile.com/v2/account_id/calendars/calendar_id/events/event_id \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "title": "Updated meeting",
  "location": "Paris office",
  "body": "Agenda updated"
}
'

Update event dates

To update the schedule of a timed event, send new start and end values:

  • date_time should be an ISO 8601 datetime without timezone
  • timezone should be an IANA time zone ID
const { data, error } = await calendarApi.updateCalendarEvent({
  path: {
    account_id: "acc_123456789",
    calendar_id: "calendar_id",
    event_id: "event_id",
  },
  body: {
    start: {
      date_time: "2025-05-28T14:00:00",
      timezone: "Europe/Paris",
    },
    end: {
      date_time: "2025-05-28T15:00:00",
      timezone: "Europe/Paris",
    },
  },
});
event = calendar_api.update_calendar_event(
    "calendar_id",
    "event_id",
    "acc_123456789",
    {
        "start": {
            "date_time": "2025-05-28T14:00:00",
            "timezone": "Europe/Paris",
        },
        "end": {
            "date_time": "2025-05-28T15:00:00",
            "timezone": "Europe/Paris",
        },
    },
)
curl --request PATCH \
     --url https://api.unipile.com/v2/account_id/calendars/calendar_id/events/event_id \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "start": {
    "date_time": "2025-05-28T14:00:00",
    "timezone": "Europe/Paris"
  },
  "end": {
    "date_time": "2025-05-28T15:00:00",
    "timezone": "Europe/Paris"
  }
}
'

To update an all-day event, send date values instead:

const { data, error } = await calendarApi.updateCalendarEvent({
  path: {
    account_id: "acc_123456789",
    calendar_id: "calendar_id",
    event_id: "event_id",
  },
  body: {
    start: {
      date: "2025-05-28",
    },
    end: {
      date: "2025-05-29",
    },
  },
});
event = calendar_api.update_calendar_event(
    "calendar_id",
    "event_id",
    "acc_123456789",
    {
        "start": {"date": "2025-05-28"},
        "end": {"date": "2025-05-29"},
    },
)
curl --request PATCH \
     --url https://api.unipile.com/v2/account_id/calendars/calendar_id/events/event_id \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "start": {
    "date": "2025-05-28"
  },
  "end": {
    "date": "2025-05-29"
  }
}
'

Update a recurring event

Recurring events are updated with the same Update a calendar event endpoint.

To change the recurrence pattern, update the recurrence array. Learn more in the Recurring events guide.

❗️

Provider limitations

Recurring events do not behave exactly the same on Google Calendar and Outlook.

  • To edit the whole series, use the recurring event ID.
  • To edit one occurrence only, use the occurrence ID. This creates an exception.
  • Google Calendar does not support a single "this and following" update. It must be done by splitting the series into two recurring events.
  • Outlook may reject updates on one occurrence if the new date overlaps the previous or next occurrence in the series.
const { data, error } = await calendarApi.updateCalendarEvent({
  path: {
    account_id: "acc_123456789",
    calendar_id: "calendar_id",
    event_id: "event_id",
  },
  body: {
    recurrence: ["RRULE:FREQ=WEEKLY;BYDAY=MO,WE;UNTIL=20251231T230000Z"],
  },
});
event = calendar_api.update_calendar_event(
    "calendar_id",
    "event_id",
    "acc_123456789",
    {
        "recurrence": [
            "RRULE:FREQ=WEEKLY;BYDAY=MO,WE;UNTIL=20251231T230000Z"
        ],
    },
)
curl --request PATCH \
     --url https://api.unipile.com/v2/account_id/calendars/calendar_id/events/event_id \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "recurrence": [
    "RRULE:FREQ=WEEKLY;BYDAY=MO,WE;UNTIL=20251231T230000Z"
  ]
}
'

If you expanded a recurring series into instances, use the recurring event ID to edit the whole series.


Delete an event

To permanently remove an event, use Delete a Calendar event.

import { UnipileCalendar } from "unipile";

const key = process.env.UNIPILE_API_KEY ?? "";
const calendarApi = new UnipileCalendar({ key });

const { data, error } = await calendarApi.deleteCalendarEvent({
  path: {
    account_id: "acc_123456789",
    calendar_id: "calendar_id",
    event_id: "event_id",
  },
});
import unipile

configuration = unipile.Configuration()
configuration.api_key["apiKey"] = "your-api-key"

api_client = unipile.ApiClient(configuration)
calendar_api = unipile.CalendarApi(api_client)

response = calendar_api.delete_calendar_event(
    "calendar_id",
    "event_id",
    "acc_123456789",
)
curl --request DELETE \
     --url https://api.unipile.com/v2/account_id/calendars/calendar_id/events/event_id

Delete a recurring event

Deleting a recurring event uses the same Delete a Calendar event endpoint.

When deleting a recurring series, pass the recurring event ID to remove the whole series.

❗️

Provider limitations

  • To delete the whole series, use the recurring event ID.
  • To delete one occurrence only, use the occurrence ID.
  • On Google Calendar, deleting one occurrence creates a cancelled exception in the series.
  • On Outlook, organizers can delete or cancel a recurring occurrence, and cancellation may notify attendees.