Creates an event. Try it now .
Request
HTTP request
POST https://www.googleapis.com/calendar/v3/calendars/ calendarId /events
Parameters
calendarId
string
primary
" keyword.conferenceDataVersion
integer
0
to 1
, inclusive.maxAttendees
integer
sendNotifications
boolean
Whether to send notifications about the creation of the new event. Note that some emails might still be sent even if you set the value to
false
. The default is false
.sendUpdates
string
false
.Acceptable values are:
- "
all
": Notifications are sent to all guests. - "
externalOnly
": Notifications are sent to non-Google Calendar guests only. - "
none
": No notifications are sent.
supportsAttachments
boolean
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.events
|
https://www.googleapis.com/auth/calendar.app.created
|
https://www.googleapis.com/auth/calendar.events.owned
|
For more information, see the authentication and authorization page.
Request body
In the request body, supply an Events resource with the following properties:
end
nested object
start
nested object
anyoneCanAddSelf
boolean
attendees[]
list
attendees[].
additionalGuests
integer
attendees[].
displayName
string
attendees[].
email
string
Required when adding an attendee.
attendees[].
optional
boolean
attendees[].
resource
boolean
attendees[].
responseStatus
string
- "
needsAction
" - The attendee has not responded to the invitation (recommended for new events). - "
declined
" - The attendee has declined the invitation. - "
tentative
" - The attendee has tentatively accepted the invitation. - "
accepted
" - The attendee has accepted the invitation.
birthdayProperties
nested object
eventType
is "birthday"
. Immutable. birthdayProperties.
type
string
-
"anniversary"
- An anniversary other than birthday. Always has acontact
. -
"birthday"
- A birthday event. This is the default value. -
"custom"
- A special date whose label is further specified in thecustomTypeName
field. Always has acontact
. -
"other"
- A special date which does not fall into the other categories, and does not have a custom label. Always has acontact
. -
"self"
- Calendar owner's own birthday. Cannot have acontact
.
"birthday"
. The type cannot be changed after the event is created.colorId
string
event
section of the colors definition (see the colors endpoint
). Optional.conferenceData
nested object
createRequest
field. To persist your changes, remember to set the conferenceDataVersion
request parameter to 1
for all event modification requests.description
string
end.
date
date
end.
dateTime
datetime
timeZone
. end.
timeZone
string
eventType
string
- "
birthday
" - A special all-day event with an annual recurrence. - "
default
" - A regular event or not further specified. - "
focusTime
" - A focus-time event. - "
fromGmail
" - An event from Gmail. This type of event cannot be created. - "
outOfOffice
" - An out-of-office event. - "
workingLocation
" - A working location event.
extendedProperties.
private
object
focusTimeProperties
nested object
eventType
is focusTime
. gadget.
display
string
- "
icon
" - The gadget displays next to the event's title in the calendar view. - "
chip
" - The gadget displays when the event is clicked.
gadget.
height
integer
gadget.
iconLink
string
gadget.
link
string
gadget.
preferences
object
gadget.
title
string
gadget.
type
string
gadget.
width
integer
guestsCanInviteOthers
boolean
guestsCanModify
boolean
guestsCanSeeOtherGuests
boolean
id
string
- characters allowed in the ID are those used in base32hex encoding, i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938
- the length of the ID must be between 5 and 1024 characters
- the ID must be unique per calendar
If you do not specify an ID, it will be automatically generated by the server.
Note that the icalUID
and the id
are not identical and only one of them should be supplied at event creation time. One difference in their semantics is that in recurring events, all occurrences of one event have different id
s while they all share the same icalUID
s.
location
string
originalStartTime.
date
date
originalStartTime.
dateTime
datetime
timeZone
. originalStartTime.
timeZone
string
outOfOfficeProperties
nested object
eventType
is outOfOffice
.recurrence[]
list
start
and end
fields. This field is omitted for single events or instances of recurring events. reminders.
overrides[]
list
reminders.overrides[].
method
string
- "
email
" - Reminders are sent via email. - "
popup
" - Reminders are sent via a UI popup.
Required when adding a reminder.
reminders.overrides[].
minutes
integer
Required when adding a reminder.
reminders.
useDefault
boolean
sequence
integer
source.
title
string
source.
url
string
start.
date
date
start.
dateTime
datetime
timeZone
. start.
timeZone
string
status
string
- "
confirmed
" - The event is confirmed. This is the default status. - "
tentative
" - The event is tentatively confirmed. - "
cancelled
" - The event is cancelled (deleted). The list method returns cancelled events only on incremental sync (whensyncToken
orupdatedMin
are specified) or if theshowDeleted
flag is set totrue
. The get method always returns them.A cancelled status represents two different states depending on the event type:
- Cancelled exceptions of an uncancelled recurring event indicate that this instance should no longer be presented to the user. Clients should store these events for the lifetime of the parent recurring event.
Cancelled exceptions are only guaranteed to have values for the
id
,recurringEventId
andoriginalStartTime
fields populated. The other fields might be empty. - All other cancelled events represent deleted events. Clients should remove their locally synced copies. Such cancelled events will eventually disappear, so do not rely on them being available indefinitely.
Deleted events are only guaranteed to have the
id
field populated.
showDeleted
set to false will not return these details.If an event changes its organizer (for example via the move operation) and the original organizer is not on the attendee list, it will leave behind a cancelled event where only the
id
field is guaranteed to be populated. - Cancelled exceptions of an uncancelled recurring event indicate that this instance should no longer be presented to the user. Clients should store these events for the lifetime of the parent recurring event.
summary
string
transparency
string
- "
opaque
" - Default value. The event does block time on the calendar. This is equivalent to setting Show me asto Busyin the Calendar UI. - "
transparent
" - The event does not block time on the calendar. This is equivalent to setting Show me asto Availablein the Calendar UI.
visibility
string
- "
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.
workingLocationProperties
nested object
workingLocationProperties.
customLocation
object
workingLocationProperties.customLocation.
label
string
workingLocationProperties.
homeOffice
any value
workingLocationProperties.
officeLocation
object
workingLocationProperties.officeLocation.
buildingId
string
workingLocationProperties.officeLocation.
deskId
string
workingLocationProperties.officeLocation.
floorId
string
workingLocationProperties.officeLocation.
floorSectionId
string
workingLocationProperties.officeLocation.
label
string
workingLocationProperties.
type
string
- "
homeOffice
" - The user is working at home. - "
officeLocation
" - The user is working from an office. - "
customLocation
" - The user is working from a custom location.
Required when adding working location properties.
Response
If successful, this method returns an Events resource in the response body.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.
attendees[]. comment
string