POST/users/{userId}/calendar/events
Creates an event in a specified user's default calendar.
OAuth 2.0 authentication.
For more information, see Authentication and Authorization.
calendar
| Parameter | Type | Description |
|---|---|---|
| userId | string | User ID required example : userf7da-f82c-4284-13e7-030f3b4c756x |
| Header | type | Description |
|---|---|---|
| Authorization | string | Bearer {token} required |
| Content-Type | string | application/json required example : application/json |
Add an event, recurring or non-recurring event as an element of an array.
Set the same eventId for all the events in the array.
| Property | Type | Description |
|---|---|---|
| eventComponents | array (Event) | Set the same eventId for all the events in the array. |
| sendNotification | boolean | Indicates whether to send event notifications default : true writeOnly : true |
| Property | Type | Description |
|---|---|---|
| eventId | string | Event ID
minLength : 1 maxLength : 255 |
| summary | string | Event content required |
| description | string | Event memo minLength : 0 maxLength : 5000 |
| location | string | Event location |
| map | object (map) | Location information |
| mapUrl | object (mapUrl) | Image and URL of the attached map |
| categoryId | string | Event category ID
|
| start | object (start) | Start or end time of the event required |
| end | object (end) | Start or end time of the event |
| recurrence | array (Recurrence) | Recurrence minItems : 0 maxItems : 100 |
| recurringEventId | string | Non-recurring event ID. |
| transparency | string | Indicates whether the event is busy or free
default : OPAQUE Allowed values : OPAQUE, TRANSPARENT |
| visibility | string | Indicates whether the event is public or private
default : PUBLIC Allowed values : PUBLIC, PRIVATE |
| sequence | integer | Event sequence number. default : 0 minimum : 0 format : int32 |
| attendees | array (Attendee) | Attendee information minItems : 0 maxItems : 500 |
| videoMeeting | object (videoMeeting) | Video conference information in the event |
| reminders | array (Alarm) | Reminder information minItems : 0 maxItems : 100 |
| priority | integer | Level of importance 0: Undefined 1: Most important 2: Second most important .... 9: Least important default : 0 minimum : 0 maximum : 9 |
| Property | Type | Description |
|---|---|---|
| type | string | Map type
|
| geo | string | Latitude and longitude of the attached map |
| Property | Type | Description |
|---|---|---|
| mapUrl | string | Map URL |
| imageId | string | Map image |
| Property | Type | Description |
|---|---|---|
| date | string | It is present if the event type is all day.
|
| dateTime | string | It is present if the event type is not all day.
|
| timeZone | string | Timezone of dateTime (It is present if the event is not all day.) |
| Property | Type | Description |
|---|---|---|
| date | string | It is present if the event type is all day.
|
| dateTime | string | It is present if the event type is not all day.
|
| timeZone | string | Timezone of dateTime (It is present if the event is not all day.) |
| Property | Type | Description |
|---|---|---|
| Recurrence | string | This property defines a recurrence rule for a recurring event. |
| Property | Type | Description |
|---|---|---|
| id | string | Resource ID
|
| string | Attendee's email address
| |
| displayName | string | User or resource name |
| partstat | string | Attendance status
Allowed values : NEEDS-ACTION, ACCEPTED, DECLINED, TENTATIVE |
| isResource | boolean | Indicates whether it is a resource. default : false |
| isOptional | boolean | Indicates whether attendance is optional. default : false |
| resourceValue | string | Unique resource value |
| Property | Type | Description |
|---|---|---|
| url | string | Video conference URL format : uri |
| resourceId | string | Video conference ID |
| Property | Type | Description |
|---|---|---|
| method | string | Reminder type
required Allowed values : DISPLAY, EMAIL |
| trigger | string | Sets a reminder for the event.
|
| triggerDateTime | object (triggerDateTime) | Date and time |
| Property | Type | Description |
|---|---|---|
| dateTime | string | Format: YYYY-MM-DDTHH:mm:ss |
| timeZone | string |
example
1{2 "eventComponents": [3 {4 "eventId": "eventr8123-wehuh324-qwejqw123",5 "summary": "Meeting",6 "description": "Memo",7 "location": "CUNY Graduate Center",8 "map": {9 "type": "google",10 "geo": "40.7486484;-73.98400699999999"11 },12 "mapUrl": {13 "mapUrl": "https://mapUrl.googlemap.com",14 "imageId": "imageId123"15 },16 "categoryId": "1",17 "start": {18 "dateTime": "2021-12-13T14:00:00",19 "timeZone": "America/New_York"20 },21 "end": {22 "dateTime": "2021-12-13T15:00:00",23 "timeZone": "America/New_York"24 },25 "recurrence": [26 "RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=SU",27 "EXDATE;TZID=America/New_York:20211213T140000"28 ],29 "recurringEventId": "TZID=America/New_York:20211213T140000",30 "transparency": "OPAQUE",31 "visibility": "PUBLIC",32 "sequence": 1,33 "attendees": [34 {35 "email": "attendee1@example.com",36 "displayName": "user1",37 "partstat": "NEEDS-ACTION",38 "isOptional": false,39 "isResource": false40 },41 {42 "email": "attendee2@example.com",43 "displayName": "user2",44 "partstat": "ACCEPTED",45 "isOptional": true,46 "isResource": false47 },48 {49 "id": "10000355/10029600@97d9ddb4-ae93-4469-8471-110c573d13z1",50 "partstat": "ACCEPTED",51 "resourceValue": "https://calendar.worksmobile.com/resources/resource/10000355/10029600@97d9ddb4-ae93-4469-8471-110c573d13z1",52 "isOptional": false,53 "isResource": true54 },55 {56 "email": "attendee3@example.com",57 "displayName": "user3",58 "partstat": "DECLINED",59 "isOptional": false,60 "isResource": false61 }62 ],63 "videoMeeting": {64 "url": "https://works.do/x4gOs1_call",65 "resourceId": "x4gOs1_call"66 },67 "reminders": [68 {69 "method": "DISPLAY",70 "trigger": "-PT10M"71 },72 {73 "method": "EMAIL",74 "triggerDateTime": {75 "dateTime": "2021-12-13T10:00:00",76 "timeZone": "America/New_York"77 }78 }79 ],80 "priority": 081 }82 ],83 "sendNotification": false84}OK
| Property | Type | Description |
|---|---|---|
| eventComponents | array (Event) | Event information |
| organizerCalendarId | string | Calendar ID of the event |
| Property | Type | Description |
|---|---|---|
| eventId | string | Event ID required minLength : 1 maxLength : 255 |
| createdTime | object (createdTime) | Date and time readOnly : true |
| updatedTime | object (updatedTime) | Date and time readOnly : true |
| summary | string | Event content required minLength : 0 maxLength : 200 |
| description | string | Event memo minLength : 0 maxLength : 5000 |
| location | string | Event location minLength : 0 maxLength : 100 |
| map | object (map) | Location information |
| mapUrl | object (mapUrl) | Image and URL of the attached map |
| categoryId | string | Event category ID |
| organizer | object (organizer) | Event organizer.
readOnly : true |
| start | object (start) | Start or end time of the event required |
| end | object (end) | Start or end time of the event |
| recurrence | array (Recurrence) | minItems : 0 maxItems : 100 |
| recurringEventId | string | Non-recurring event ID. |
| transparency | string | Indicates whether the event is busy or free
default : OPAQUE Allowed values : OPAQUE, TRANSPARENT |
| visibility | string | Indicates whether the event is public or private
default : PUBLIC Allowed values : PUBLIC, PRIVATE |
| sequence | integer | Event sequence number. default : 0 minimum : 0 format : int32 |
| attendees | array (Attendee) | Attendee information minItems : 0 maxItems : 500 |
| videoMeeting | object (videoMeeting) | Video conference information in the event |
| reminders | array (Alarm) | Reminder information minItems : 0 maxItems : 100 |
| attachments | array (File) | Attachment information (The total size of the attached files cannot exceed 100 MB.) readOnly : true |
| viewUrl | string | URL to view events minLength : 0 format : uri readOnly : true |
| priority | integer | Level of importance 0: Undefined 1: Most important 2: Second most important .... 9: Least important default : 0 minimum : 0 maximum : 9 |
| Property | Type | Description |
|---|---|---|
| dateTime | string | Format: YYYY-MM-DDTHH:mm:ss |
| timeZone | string |
| Property | Type | Description |
|---|---|---|
| dateTime | string | Format: YYYY-MM-DDTHH:mm:ss |
| timeZone | string |
| Property | Type | Description |
|---|---|---|
| type | string | Map type
|
| geo | string | Latitude and longitude of the attached map |
| Property | Type | Description |
|---|---|---|
| mapUrl | string | Map URL |
| imageId | string | Map image |
| Property | Type | Description |
|---|---|---|
| string | Organizer's email address required | |
| displayName | string | Organizer name |
| Property | Type | Description |
|---|---|---|
| date | string | It is present if the event type is all day.
|
| dateTime | string | It is present if the event type is not all day.
|
| timeZone | string | Timezone of dateTime (It is present if the event is not all day.) |
| Property | Type | Description |
|---|---|---|
| date | string | It is present if the event type is all day.
|
| dateTime | string | It is present if the event type is not all day.
|
| timeZone | string | Timezone of dateTime (It is present if the event is not all day.) |
| Property | Type | Description |
|---|---|---|
| Recurrence | string | This property defines a recurrence rule for a recurring event. |
| Property | Type | Description |
|---|---|---|
| id | string | Resource ID
|
| string | Attendee's email address
| |
| displayName | string | User or resource name |
| partstat | string | Attendance status
Allowed values : NEEDS-ACTION, ACCEPTED, DECLINED, TENTATIVE |
| isResource | boolean | Indicates whether it is a resource. default : false |
| isOptional | boolean | Indicates whether attendance is optional. default : false |
| resourceValue | string | Unique resource value |
| Property | Type | Description |
|---|---|---|
| url | string | Video conference URL format : uri |
| resourceId | string | Video conference ID |
| Property | Type | Description |
|---|---|---|
| method | string | Reminder type
required Allowed values : DISPLAY, EMAIL |
| trigger | string | Sets a reminder for the event.
|
| triggerDateTime | object (triggerDateTime) | Date and time |
| Property | Type | Description |
|---|---|---|
| dateTime | string | Format: YYYY-MM-DDTHH:mm:ss |
| timeZone | string |
| Property | Type | Description |
|---|---|---|
| fileUrl | string | File URL readOnly : true |
| fileName | string | File name readOnly : true |
| fileSize | integer | File size (in bytes) minimum : 0 format : int64 readOnly : true |
example
1{2 "eventComponents": [3 {4 "eventId": "eventr8123-wehuh324-qwejqw123",5 "createdTime": {6 "dateTime": "2021-12-12T22:44:59",7 "timeZone": "America/New_York"8 },9 "updatedTime": {10 "dateTime": "2021-12-14T21:01:31",11 "timeZone": "America/New_York"12 },13 "summary": "Meeting",14 "description": "Memo",15 "location": "CUNY Graduate Center",16 "map": {17 "type": "google",18 "geo": "40.7486484;-73.98400699999999"19 },20 "mapUrl": {21 "mapUrl": "https://mapUrl.googlemap.com",22 "imageId": "imageId123"23 },24 "categoryId": "1",25 "organizer": {26 "email": "user1@example.com",27 "displayName": "userName1"28 },29 "start": {30 "dateTime": "2021-12-13T14:00:00",31 "timeZone": "America/New_York"32 },33 "end": {34 "dateTime": "2021-12-13T15:00:00",35 "timeZone": "America/New_York"36 },37 "transparency": "OPAQUE",38 "visibility": "PUBLIC",39 "sequence": 1,40 "attendees": [41 {42 "email": "attendee1@example.com",43 "displayName": "user1",44 "partstat": "NEEDS-ACTION",45 "isOptional": false,46 "isResource": false47 },48 {49 "email": "attendee2@example.com",50 "displayName": "user2",51 "partstat": "ACCEPTED",52 "isOptional": true,53 "isResource": false54 },55 {56 "id": "10000355/10029600@97d9ddb4-ae93-4469-8471-110c573d13z1",57 "partstat": "ACCEPTED",58 "resourceValue": "https://calendar.worksmobile.com/resources/resource/10000355/10029600@97d9ddb4-ae93-4469-8471-110c573d13z1",59 "isOptional": false,60 "isResource": true61 },62 {63 "email": "attendee3@example.com",64 "displayName": "user3",65 "partstat": "DECLINED",66 "isOptional": false,67 "isResource": false68 }69 ],70 "videoMeeting": {71 "url": "https://works.do/x4gOs1_call",72 "resourceId": "x4gOs1_call"73 },74 "reminders": [75 {76 "method": "DISPLAY",77 "trigger": "-PT10M"78 },79 {80 "method": "EMAIL",81 "triggerDateTime": {82 "dateTime": "2021-12-13T10:00:00",83 "timeZone": "Asia/Tokyo"84 }85 }86 ],87 "attachments": [88 {89 "fileUrl": "https://calendar.worksmobile.com/file/download?scheduleId=20211212T134459Z-153@zvcweb06.wcal.nfra.io&path=21785b23-760z-4394-badf-6463c9474746.10029600",90 "fileName": "4024939274.pdf",91 "fileSize": 4850692 }93 ],94 "viewUrl": "https://calendar.worksmobile.com/permanentLink.nhn",95 "priority": 096 }97 ],98 "organizerCalendarId": "calendar-96b8-4c74-8277-7953e0b4604a"99}Bad Request
Forbidden
Not Found