Google Calendar API

Events: update

Requires authorization

Updates an event. Try it now or see an example.

Request

HTTP request

PUT https://www.googleapis.com/calendar/v3/calendars/calendarId/events/eventId

Parameters

Parameter name Value Description
Path parameters
calendarId string Calendar identifier.
eventId string Event identifier.
Optional query parameters
alwaysIncludeEmail boolean Whether to always include a value in the "email" field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.
maxAttendees integer The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.
sendNotifications boolean Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.

Authorization

This request requires authorization with the following scope (read more about authentication and authorization).

Scope
https://www.googleapis.com/auth/calendar

Request body

In the request body, supply an Events resource with the following properties:

Property name Value Description Notes
Required Properties
attendees[].email string The attendee's email address, if available. This field must be present when adding an attendee.
end nested object The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance.
reminders.overrides[].method string The method used by this reminder. Possible values are:
  • "email" - Reminders are sent via email.
  • "sms" - Reminders are sent via SMS.
  • "popup" - Reminders are sent via a UI popup.
reminders.overrides[].minutes integer Number of minutes before the start of the event when the reminder should trigger.
start nested object The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance.
Optional Properties
anyoneCanAddSelf boolean Whether anyone can invite themselves to the event. Optional. The default is False. writable
attendees[] list The attendees of the event. writable
attendees[].additionalGuests integer Number of additional guests. Optional. The default is 0. writable
attendees[].comment string The attendee's response comment. Optional. writable
attendees[].displayName string The attendee's name, if available. Optional. writable
attendees[].optional boolean Whether this is an optional attendee. Optional. The default is False. writable
attendees[].responseStatus string The attendee's response status. Possible values are:
  • "needsAction" - The attendee has not responded to the invitation.
  • "declined" - The attendee has declined the invitation.
  • "tentative" - The attendee has tentatively accepted the invitation.
  • "accepted" - The attendee has accepted the invitation.
writable
attendeesOmitted boolean Whether attendees may have been omitted from the event's representation. When retrieving an event, this may be due to a restriction specified by the 'maxAttendee' query parameter. When updating an event, this can be used to only update the participant's response. Optional. The default is False. writable
colorId string The color of the event. This is an ID referring to an entry in the "event" section of the colors definition (see the "colors" endpoint). Optional. writable
description string Description of the event. Optional. writable
end.date date The date, in the format "yyyy-mm-dd", if this is an all-day event. writable
end.dateTime datetime The time, as a combined date-time value (formatted according to RFC 3339). A time zone offset is required unless a time zone is explicitly specified in 'timeZone'. writable
end.timeZone string The name of the time zone in which the time is specified (e.g. "Europe/Zurich"). Optional. The default is the time zone of the calendar. writable
extendedProperties.private object Properties that are private to the copy of the event that appears on this calendar. writable
extendedProperties.shared object Properties that are shared between copies of the event on other attendees' calendars. writable
gadget.display string The gadget's display mode. Optional. Possible values are:
  • "icon" - The gadget displays next to the event's title in the calendar view.
  • "chip" - The gadget displays when the event is clicked.
writable
gadget.height integer The gadget's height in pixels. Optional. writable
gadget.preferences object Preferences. writable
gadget.title string The gadget's title. writable
gadget.type string The gadget's type. writable
gadget.width integer The gadget's width in pixels. Optional. writable
guestsCanInviteOthers boolean Whether attendees other than the organizer can invite others to the event. Optional. The default is True. writable
guestsCanSeeOtherGuests boolean Whether attendees other than the organizer can see who the event's attendees are. Optional. The default is True. writable
location string Geographic location of the event as free-form text. Optional. writable
originalStartTime.date date The date, in the format "yyyy-mm-dd", if this is an all-day event. writable
originalStartTime.dateTime datetime The time, as a combined date-time value (formatted according to RFC 3339). A time zone offset is required unless a time zone is explicitly specified in 'timeZone'. writable
originalStartTime.timeZone string The name of the time zone in which the time is specified (e.g. "Europe/Zurich"). Optional. The default is the time zone of the calendar. writable
recurrence[] list List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event. This field is omitted for single events or instances of recurring events. writable
reminders.overrides[] list If the event doesn't use the default reminders, this lists the reminders specific to the event, or, if not set, indicates that no reminders are set for this event. writable
reminders.useDefault boolean Whether the default reminders of the calendar apply to the event. writable
sequence integer Sequence number as per iCalendar. writable
source.title string Title of the source; for example a title of a web page or an email subject. writable
source.url string URL of the source pointing to a resource. URL's protocol must be HTTP or HTTPS. writable
start.date date The date, in the format "yyyy-mm-dd", if this is an all-day event. writable
start.dateTime datetime The time, as a combined date-time value (formatted according to RFC 3339). A time zone offset is required unless a time zone is explicitly specified in 'timeZone'. writable
start.timeZone string The name of the time zone in which the time is specified (e.g. "Europe/Zurich"). Optional. The default is the time zone of the calendar. writable
status string Status of the event. Optional. Possible values are:
  • "confirmed" - The event is confirmed. This is the default status.
  • "tentative" - The event is tentatively confirmed.
  • "cancelled" - The event is cancelled.
writable
summary string Title of the event. writable
transparency string Whether the event blocks time on the calendar. Optional. Possible values are:
  • "opaque" - The event blocks time on the calendar. This is the default value.
  • "transparent" - The event does not block time on the calendar.
writable
visibility string Visibility of the event. Optional. Possible values are:
  • "default" - Uses the default visibility for events on the calendar. This is the default value.
  • "public" - The event is public and event details are visible to all readers of the calendar.
  • "private" - The event is private and only event attendees may view event details.
  • "confidential" - The event is private. This value is provided for compatibility reasons.
writable

Response

If successful, this method returns an Events resource in the response body.

Examples

Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).

Java

Uses the Java client library.

// First retrieve the event from the API.
Event event = service.events().get("primary", "eventId").execute();

event.setSummary("Appointment at Somewhere");

Event updatedEvent = service.events().update("primary", event.getId(), event).execute();

// Print the updated date.
System.out.println(updatedEvent.getUpdated());

Python

Uses the Python client library.

# First retrieve the event from the API.
event = service.events().get(calendarId='primary', eventId='eventId').execute()

event['summary'] = 'Appointment at Somewhere'

updated_event = service.events().update(calendarId='primary', eventId=event['id'], body=event).execute()

# Print the updated date.
print updated_event['updated']

PHP

Uses the PHP client library.

// First retrieve the event from the API.
$event = $service->events->get('primary', 'eventId');

$event->setSummary('Appointment at Somewhere');

$updatedEvent = $service->events->update('primary', $event->getId(), $event);

// Print the updated date.
echo $updatedEvent->getUpdated();

Ruby

Uses the Ruby client library.

result = client.execute(:api_method => service.events.get,
                        :parameters => {'calendarId' => 'primary', 'eventId' => 'eventId')
event = result.data
event.summary = 'Appointment at Somewhere'
result = client.execute(:api_method => service.events.update,
                        :parameters => {'calendarId' => 'primary', 'eventId' => event.id},
                        :body_object => event,
                        :headers => {'Content-Type' => 'application/json'})
print result.data.updated

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.