Calendar Service

  • The Google Calendar service for Apps Script allows scripts to access and modify user calendars.

  • Various classes like Calendar, CalendarApp, CalendarEvent, and CalendarEventSeries are available to manage calendars and events.

  • Enums like Color, EventColor, EventType, and Visibility define properties and statuses for calendars and events.

  • Methods are provided to create, retrieve, modify, and delete calendars and events, including handling guests and recurrences.

  • Detailed methods are available for managing individual events and entire recurring event series.

This service allows a script to access and modify the user's Google Calendar, including additional calendars that the user is subscribed to.

Classes

NameBrief description
CalendarRepresents a calendar that the user owns or is subscribed to.
CalendarAppAllows a script to read and update the user's Google Calendar.
CalendarEventRepresents a single calendar event.
CalendarEventSeriesRepresents a series of events (a recurring event).
ColorAn enum representing the named colors available in the Calendar service.
EventColorAn enum representing the named event colors available in the Calendar service.
EventGuestRepresents a guest of an event.
EventRecurrenceRepresents the recurrence settings for an event series.
EventTransparencyAn enum representing the transparency of an event.
EventTypeAn enum representing the type of an event.
GuestStatusAn enum representing the statuses a guest can have for an event.
RecurrenceRuleRepresents a recurrence rule for an event series.
VisibilityAn enum representing the visibility of an event.

Methods

MethodReturn typeBrief description
createAllDayEvent(title, date)CalendarEventCreates a new all-day event.
createAllDayEvent(title, startDate, endDate)CalendarEventCreates a new all-day event that can span multiple days.
createAllDayEvent(title, startDate, endDate, options)CalendarEventCreates a new all-day event that can span multiple days.
createAllDayEvent(title, date, options)CalendarEventCreates a new all-day event.
createAllDayEventSeries(title, startDate, recurrence)CalendarEventSeriesCreates a new all-day event series.
createAllDayEventSeries(title, startDate, recurrence, options)CalendarEventSeriesCreates a new all-day event series.
createEvent(title, startTime, endTime)CalendarEventCreates a new event.
createEvent(title, startTime, endTime, options)CalendarEventCreates a new event.
createEventFromDescription(description)CalendarEventCreates an event from a free-form description.
createEventSeries(title, startTime, endTime, recurrence)CalendarEventSeriesCreates a new event series.
createEventSeries(title, startTime, endTime, recurrence, options)CalendarEventSeriesCreates a new event series.
deleteCalendar()voidDeletes the calendar permanently.
getColor()StringGets the color of the calendar.
getDescription()StringGets the description of the calendar.
getEventById(iCalId)CalendarEventGets the event with the given ID.
getEventSeriesById(iCalId)CalendarEventSeriesGets the event series with the given ID.
getEvents(startTime, endTime)CalendarEvent[]Gets all events that occur within a given time range.
getEvents(startTime, endTime, options)CalendarEvent[]Gets all events that occur within a given time range and meet the specified criteria.
getEventsForDay(date)CalendarEvent[]Gets all events that occur on a given day.
getEventsForDay(date, options)CalendarEvent[]Gets all events that occur on a given day and meet specified criteria.
getId()StringGets the ID of the calendar.
getName()StringGets the name of the calendar.
getTimeZone()StringGets the time zone of the calendar.
isHidden()BooleanDetermines whether the calendar is hidden in the user interface.
isMyPrimaryCalendar()BooleanDetermines whether the calendar is the primary calendar for the effective user.
isOwnedByMe()BooleanDetermines whether the calendar is owned by you.
isSelected()BooleanDetermines whether the calendar's events are displayed in the user interface.
setColor(color)CalendarSets the color of the calendar.
setDescription(description)CalendarSets the description of a calendar.
setHidden(hidden)CalendarSets whether the calendar is visible in the user interface.
setName(name)CalendarSets the name of the calendar.
setSelected(selected)CalendarSets whether the calendar's events are displayed in the user interface.
setTimeZone(timeZone)CalendarSets the time zone of the calendar.
unsubscribeFromCalendar()voidUnsubscribes the user from a calendar.

CalendarApp

Properties

PropertyTypeDescription
ColorColorAn enum representing the named colors available in the Calendar service.
EventColorEventColorAn enum representing the named event colors available in the Calendar service.
EventTransparencyEventTransparencyThe EventTransparency enumeration.
EventTypeEventTypeThe EventType enumeration.
GuestStatusGuestStatusAn enum representing the statuses a guest can have for an event.
MonthMonthAn enum representing the months of the year.
VisibilityVisibilityAn enum representing the visibility of an event.
WeekdayWeekdayAn enum representing the days of the week.

Methods

MethodReturn typeBrief description
createAllDayEvent(title, date)CalendarEventCreates a new all-day event.
createAllDayEvent(title, startDate, endDate)CalendarEventCreates a new all-day event that can span multiple days.
createAllDayEvent(title, startDate, endDate, options)CalendarEventCreates a new all-day event that can span multiple days.
createAllDayEvent(title, date, options)CalendarEventCreates a new all-day event.
createAllDayEventSeries(title, startDate, recurrence)CalendarEventSeriesCreates a new all-day event series.
createAllDayEventSeries(title, startDate, recurrence, options)CalendarEventSeriesCreates a new all-day event series.
createCalendar(name)CalendarCreates a new calendar, owned by the user.
createCalendar(name, options)CalendarCreates a new calendar, owned by the user.
createEvent(title, startTime, endTime)CalendarEventCreates a new event.
createEvent(title, startTime, endTime, options)CalendarEventCreates a new event.
createEventFromDescription(description)CalendarEventCreates an event from a free-form description.
createEventSeries(title, startTime, endTime, recurrence)CalendarEventSeriesCreates a new event series.
createEventSeries(title, startTime, endTime, recurrence, options)CalendarEventSeriesCreates a new event series.
getAllCalendars()Calendar[]Gets all calendars that the user owns or is subscribed to.
getAllOwnedCalendars()Calendar[]Gets all calendars that the user owns.
getCalendarById(id)CalendarGets the calendar with the given ID.
getCalendarsByName(name)Calendar[]Gets all calendars with a given name that the user owns or is subscribed to.
getColor()StringGets the color of the calendar.
getDefaultCalendar()CalendarGets the user's default calendar.
getDescription()StringGets the description of the calendar.
getEventById(iCalId)CalendarEventGets the event with the given ID.
getEventSeriesById(iCalId)CalendarEventSeriesGets the event series with the given ID.
getEvents(startTime, endTime)CalendarEvent[]Gets all events that occur within a given time range.
getEvents(startTime, endTime, options)CalendarEvent[]Gets all events that occur within a given time range and meet the specified criteria.
getEventsForDay(date)CalendarEvent[]Gets all events that occur on a given day.
getEventsForDay(date, options)CalendarEvent[]Gets all events that occur on a given day and meet specified criteria.
getId()StringGets the ID of the calendar.
getName()StringGets the name of the calendar.
getOwnedCalendarById(id)CalendarGets the calendar with the given ID, if the user owns it.
getOwnedCalendarsByName(name)Calendar[]Gets all calendars with a given name that the user owns.
getTimeZone()StringGets the time zone of the calendar.
isHidden()BooleanDetermines whether the calendar is hidden in the user interface.
isMyPrimaryCalendar()BooleanDetermines whether the calendar is the primary calendar for the effective user.
isOwnedByMe()BooleanDetermines whether the calendar is owned by you.
isSelected()BooleanDetermines whether the calendar's events are displayed in the user interface.
newRecurrence()EventRecurrenceCreates a new recurrence object, which can be used to create rules for event recurrence.
setColor(color)CalendarSets the color of the calendar.
setDescription(description)CalendarSets the description of a calendar.
setHidden(hidden)CalendarSets whether the calendar is visible in the user interface.
setName(name)CalendarSets the name of the calendar.
setSelected(selected)CalendarSets whether the calendar's events are displayed in the user interface.
setTimeZone(timeZone)CalendarSets the time zone of the calendar.
subscribeToCalendar(id)CalendarSubscribes the user to the calendar with the given ID, if the user is allowed to subscribe.
subscribeToCalendar(id, options)CalendarSubscribes the user to the calendar with the given ID, if the user is allowed to subscribe.

CalendarEvent

CalendarEventSeries

Color

Properties

PropertyTypeDescription
BLUEEnum Blue (#2952A3).
BROWNEnum Brown (#8D6F47).
CHARCOALEnum Charcoal (#4E5D6C).
CHESTNUTEnum Chestnut (#865A5A).
GRAYEnum Gray (#5A6986).
GREENEnum Green (#0D7813).
INDIGOEnum Indigo (#5229A3).
LIMEEnum Lime (#528800).
MUSTARDEnum Mustard (#88880E).
OLIVEEnum Olive (#6E6E41).
ORANGEEnum Orange (#BE6D00).
PINKEnum Pink (#B1365F).
PLUMEnum Plum (#705770).
PURPLEEnum Purple (#7A367A).
REDEnum Red (#A32929).
RED_ORANGEEnum Red-Orange (#B1440E).
SEA_BLUEEnum Sea Blue (#29527A).
SLATEEnum Slate (#4A716C).
TEALEnum Teal (#28754E).
TURQOISEEnum Turquoise (#1B887A).
YELLOWEnum Yellow (#AB8B00).

EventColor

Properties

PropertyTypeDescription
PALE_BLUEEnum Pale Blue ("1"), referred to as "Peacock" in th Calendar UI.
PALE_GREENEnum Pale Green ("2"), referred to as "Sage" in th Calendar UI.
MAUVEEnum Mauve ("3"),, referred to as "Grape" in th Calendar UI.
PALE_REDEnum Pale Red ("4"), referred to as "Flamingo" in th Calendar UI.
YELLOWEnum Yellow ("5"), referred to as "Banana" in th Calendar UI.
ORANGEEnum Orange ("6"), referred to as "Tangerine" in th Calendar UI.
CYANEnum Cyan ("7"), referred to as "Lavender" in th Calendar UI.
GRAYEnum Gray ("8"), referred to as "Graphite" in th Calendar UI.
BLUEEnum Blue ("9"), referred to as "Blueberry" in th Calendar UI.
GREENEnum Green ("10"), referred to as "Basil" in th Calendar UI.
REDEnum Red ("11"), referred to as "Tomato" in th Calendar UI.

EventGuest

EventRecurrence

EventTransparency

Properties

PropertyTypeDescription
OPAQUEEnumThe event does block time on the calendar.
TRANSPARENTEnumThe event does not block time on the calendar.

EventType

Properties

PropertyTypeDescription
DEFAULTEnumThe event is a regular event.
BIRTHDAYEnumThe event is a special all-day event with an annual recurrence.
FOCUS_TIMEEnumThe event is a focus-time event.
FROM_GMAILEnumThe event is an event from Gmail.
OUT_OF_OFFICEEnumThe event is an out-of-office event.
WORKING_LOCATIONEnumThe event is a working location event.

GuestStatus

Properties

PropertyTypeDescription
INVITEDEnumThe guest has been invited, but has not indicated whether they are attending.
MAYBEEnumThe guest has indicated they might attend.
NOEnumThe guest has indicated they are not attending.
OWNEREnumThe guest is the owner of the event.
YESEnumThe guest has indicated they are attending.

RecurrenceRule

Visibility

Properties

PropertyTypeDescription
CONFIDENTIALEnumThe event is private.
DEFAULTEnumUses the default visibility for events on the calendar.
PRIVATEEnumThe event is private and only event attendees may view event details.
PUBLICEnumThe event is public and event details are visible to all readers of the calendar.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.