Updates metadata for a calendar. Try it now.
Request
HTTP request
PUT https://www.googleapis.com/calendar/v3/calendars/calendarIdParameters
| Parameter name | Value | Description |
|---|---|---|
| Path parameters | ||
calendarId |
string |
Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword.
|
Authorization
This request requires authorization with at least one of the following scopes:
| Scope |
|---|
https://www.googleapis.com/auth/calendar |
https://www.googleapis.com/auth/calendar.app.created |
https://www.googleapis.com/auth/calendar.calendars |
For more information, see the authentication and authorization page.
Request body
In the request body, supply a Calendars resource with the following properties:
| Property name | Value | Description | Notes |
|---|---|---|---|
| Optional Properties | |||
description |
string |
Description of the calendar. Optional. | writable |
labelProperties |
nested object |
Label properties defined on this calendar. If specified, overwrites the existing label properties. If not specified, the label properties remain unchanged. | writable |
labelProperties.eventLabels[] |
list |
Event labels defined on this calendar. If this is present when updating the calendar, it will replace the existing event labels. Extend the list to add a new event label, and remove entities from the list to delete a label from calendar. Each calendar can have a maximum of 200 labels. |
writable |
labelProperties.eventLabels[].backgroundColor |
string |
Background color of the label in hexadecimal format, such as "#039be5". Events with this label are displayed in this color. Required. |
writable |
labelProperties.eventLabels[].id |
string |
The ID of the label. Optional when inserting a new label. If not provided, a unique ID will be generated. Required when updating a label. If provided, the ID must be unique within the calendar and follow UUID format. |
writable |
labelProperties.eventLabels[].name |
string |
Name of the label. Optional. If provided this must have at most 50 characters. |
writable |
location |
string |
Geographic location of the calendar as free-form text. Optional. | writable |
summary |
string |
Title of the calendar. | writable |
timeZone |
string |
The time zone of the calendar. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) Optional. | writable |
workingHours |
object |
Represents the information about the user's working hours. Only available for primary calendars of Google Workspace users. To update the working hours, the entire working hours object must be passed. If not specified (or passed as null or an empty object), the existing working hours remain unchanged. To disable working hours or clear the schedule, set workingHoursEnabled to false (and omit availableTimes or pass an empty list). |
writable |
workingHours.availableTimes[] |
list |
Working hours. Each availability period represents the user's working hours block during one day. | writable |
workingHours.availableTimes[].dayOfWeek |
string |
Day of the week. Required. Possible values are:
|
writable |
workingHours.availableTimes[].periodEnd |
integer |
Period end, in minutes from the start of the day, exclusive. Required. | writable |
workingHours.availableTimes[].periodStart |
integer |
Period start, in minutes from the start of the day, inclusive. Required. | writable |
workingHours.workingHoursEnabled |
boolean |
Whether the working hours are enabled for this calendar. Cannot be set to true when availableTimes is empty. |
writable |
Response
If successful, this method returns a Calendars resource in the response body.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.