POST/users/{userId}/calendar/events

Creates an event in a specified user's default calendar.

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

calendar

HTTP Request

POSThttps://www.worksapis.com/v1.0/users/{userId}/calendar/events

Path Parameters

ParameterTypeDescription
userId string 

User ID


required
example : userf7da-f82c-4284-13e7-030f3b4c756x 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

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.

PropertyTypeDescription
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 

Event

PropertyTypeDescription
eventId string 

Event ID

  • It is automatically assigned if not specified.

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

View the event information to get the 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.
(See https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.4.4)

 
transparency string 

Indicates whether the event is busy or free

  • OPAQUE: Busy
  • TRANSPARENT: Free

default : OPAQUE
Allowed values : OPAQUE, TRANSPARENT 
visibility string 

Indicates whether the event is public or private

  • PUBLIC: Public
  • PRIVATE: Private

default : PUBLIC
Allowed values : PUBLIC, PRIVATE 
sequence integer 

Event sequence number.
For more information, see 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 

map

PropertyTypeDescription
type string 

Map type

  • NAVER, Google, etc.
 
geo string 

Latitude and longitude of the attached map

 

mapUrl

PropertyTypeDescription
mapUrl string 

Map URL

 
imageId string 

Map image

 

start

PropertyTypeDescription
date string 

It is present if the event type is all day.

  • Format: YYYY-MM-DD

The start date is inclusive, and the end date is exclusive.

 
dateTime string 

It is present if the event type is not all day.

  • Format: YYYY-MM-DDTHH:mm:ss
 
timeZone string 

Timezone of dateTime (It is present if the event is not all day.)
Timezone

 

end

PropertyTypeDescription
date string 

It is present if the event type is all day.

  • Format: YYYY-MM-DD

The start date is inclusive, and the end date is exclusive.

 
dateTime string 

It is present if the event type is not all day.

  • Format: YYYY-MM-DDTHH:mm:ss
 
timeZone string 

Timezone of dateTime (It is present if the event is not all day.)
Timezone

 

Recurrence

PropertyTypeDescription
Recurrence string 

This property defines a recurrence rule for a recurring event.
For more information, see the following:
EXDATE: https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.5.1
RRULE: https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10
Example) When the event recurs every Tuesday
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH

 

Attendee

PropertyTypeDescription
id string 

Resource ID

  • It is required if a resource is specified.
 
email string 

Attendee's email address

  • It is required if an attendee is specified.
 
displayName string 

User or resource name

 
partstat string 

Attendance status

  • NEEDS-ACTION: No response
  • ACCEPTED: Accepted
  • TENTATIVE: Tentative
  • DECLINED: Declined

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

 

videoMeeting

PropertyTypeDescription
url string 

Video conference URL


format : uri 
resourceId string 

Video conference ID

 

Alarm

PropertyTypeDescription
method string 

Reminder type

  • DISPLAY: Push or service notification
  • EMAIL: Email notification

required
Allowed values : DISPLAY, EMAIL 
trigger string 

Sets a reminder for the event.

  • For more information, see Trigger. Example)
    -PT0S: at time of event
  • PT15M: 15 minutes before
  • PT12H: 12 hours before
    -P1D: 1 day before
  • P1W: 1 week before
  • P6DT12H: 6 days 12 hours before
 
triggerDateTime object (triggerDateTime) 

Date and time

 

triggerDateTime

PropertyTypeDescription
dateTime string 

Format: YYYY-MM-DDTHH:mm:ss

 
timeZone string 

Timezone

 

Request Example

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}

Response

HTTP 201

OK

PropertyTypeDescription
eventComponents array (Event) 

Event information

 
organizerCalendarId string 

Calendar ID of the event

 

Event

PropertyTypeDescription
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.
It refers to the calendar which the event belongs to.

  • Default calendar: Email address (if exists) or login ID of the default calendar master
  • Other calendars: Calendar's unique email address

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.
(See https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.4.4)

 
transparency string 

Indicates whether the event is busy or free

  • OPAQUE: Busy
  • TRANSPARENT: Free

default : OPAQUE
Allowed values : OPAQUE, TRANSPARENT 
visibility string 

Indicates whether the event is public or private

  • PUBLIC: Public
  • PRIVATE: Private

default : PUBLIC
Allowed values : PUBLIC, PRIVATE 
sequence integer 

Event sequence number.
For more information, see 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 

createdTime

PropertyTypeDescription
dateTime string 

Format: YYYY-MM-DDTHH:mm:ss

 
timeZone string 

Timezone

 

updatedTime

PropertyTypeDescription
dateTime string 

Format: YYYY-MM-DDTHH:mm:ss

 
timeZone string 

Timezone

 

map

PropertyTypeDescription
type string 

Map type

  • NAVER, Google, etc.
 
geo string 

Latitude and longitude of the attached map

 

mapUrl

PropertyTypeDescription
mapUrl string 

Map URL

 
imageId string 

Map image

 

organizer

PropertyTypeDescription
email string 

Organizer's email address
Required


required 
displayName string 

Organizer name

 

start

PropertyTypeDescription
date string 

It is present if the event type is all day.

  • Format: YYYY-MM-DD

The start date is inclusive, and the end date is exclusive.

 
dateTime string 

It is present if the event type is not all day.

  • Format: YYYY-MM-DDTHH:mm:ss
 
timeZone string 

Timezone of dateTime (It is present if the event is not all day.)
Timezone

 

end

PropertyTypeDescription
date string 

It is present if the event type is all day.

  • Format: YYYY-MM-DD

The start date is inclusive, and the end date is exclusive.

 
dateTime string 

It is present if the event type is not all day.

  • Format: YYYY-MM-DDTHH:mm:ss
 
timeZone string 

Timezone of dateTime (It is present if the event is not all day.)
Timezone

 

Recurrence

PropertyTypeDescription
Recurrence string 

This property defines a recurrence rule for a recurring event.
For more information, see the following:
EXDATE: https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.5.1
RRULE: https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10
Example) When the event recurs every Tuesday
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=TH

 

Attendee

PropertyTypeDescription
id string 

Resource ID

  • It is required if a resource is specified.
 
email string 

Attendee's email address

  • It is required if an attendee is specified.
 
displayName string 

User or resource name

 
partstat string 

Attendance status

  • NEEDS-ACTION: No response
  • ACCEPTED: Accepted
  • TENTATIVE: Tentative
  • DECLINED: Declined

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

 

videoMeeting

PropertyTypeDescription
url string 

Video conference URL


format : uri 
resourceId string 

Video conference ID

 

Alarm

PropertyTypeDescription
method string 

Reminder type

  • DISPLAY: Push or service notification
  • EMAIL: Email notification

required
Allowed values : DISPLAY, EMAIL 
trigger string 

Sets a reminder for the event.

  • For more information, see Trigger. Example)
    -PT0S: at time of event
  • PT15M: 15 minutes before
  • PT12H: 12 hours before
    -P1D: 1 day before
  • P1W: 1 week before
  • P6DT12H: 6 days 12 hours before
 
triggerDateTime object (triggerDateTime) 

Date and time

 

triggerDateTime

PropertyTypeDescription
dateTime string 

Format: YYYY-MM-DDTHH:mm:ss

 
timeZone string 

Timezone

 

File

PropertyTypeDescription
fileUrl string 

File URL


readOnly : true 
fileName string 

File name


readOnly : true 
fileSize integer 

File size (in bytes)


minimum : 0
format : int64
readOnly : true 

Response Example

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}

HTTP 400

Bad Request

HTTP 403

Forbidden

HTTP 404

Not Found