POST - Create a new event

Purpose

This API is used to create a new event in a user's calendar.

Request URL

https://calendar.zoho.com/api/v1/calendars/<CALENDAR_UID>/events

OAuth Scope

scope=ZohoCalendar.event.ALL

(or)

scope=ZohoCalendar.event.CREATE

scope=ZohoMeeting.meeting.ALL (Needs to be added while adding meetings to the event)

ALL - Full access to events

CREATE - Creates an event

Parameters

  • eventdataJSONObject, mandatory

    Events data JSON can be passed to update the events data od a particular event in the calendar using the following keys and values.

    Input JSON keys
    • titlestring

      Title of the event to be added.

    • dateandtimeJSONObject, mandatory

      Send JSON Object of the start time, end time in Unix time format along with the time zone information, in case, different from the current user time zone.

      • start- The format should be yyyyMMdd'T'HHmmss'Z' in GMT format or yyyyMMdd (if it is an all-day event).
      • end- The format should be yyyyMMdd'T'HHmmss'Z' in GMT format or yyyyMMdd (if it is an all-day event).
      • timezone- Mention the timezone in which the event is being created.
    • isalldayboolean

      Whether the event is an all-day event(True) or not(False).

      • true - If true, use all-day event format in dateandtime JSONobject.
      • false
    • isprivateboolean

      Whether the event is a private event (true) or not (false). If set as private, the event details will not be shared even when the calendar is made public or shared with others with any permissions except delegate permission.

    • urlstring

      URL details that need to be shared for the event, along with the description, if any. Example: "https://mail.zoho.com"

    • locationstring

      Location details for the event. Maximum length- 255 characters.

    • descriptionstring

      Description of the event. To provide more details about the event to the attendees. Maximum length- 10000 characters.

    • colorstring

      Hex-color for the event. In case, a specific color needs to be provided for the event, different from the default color. Example- #E574B0

    • rrule string

      This param is used to create repeat events. The possible values are:

      • FREQ - DAILY|WEEKLY|MONTHLY|YEARLY
      • INTERVAL - Periodic occurrence (default value is 1 if not mentioned) (ex: 1-> everyday, 2-> 2 days once )
      • COUNT - The no of times the event will occur
      • BYDAY - Days of the week (used when FREQ is WEEKLY, MONTHLY or YEARLY). The values= MO, TU, WE, TH, FR, SA, SU.
      • UNTIL - Unill when the event should occur (used for all types of FREQs) Example: UNTIL=20230818T094500
      • BYSETPOS - occurrence of the week (used when FREQ is MONTHLY or YEARLY). The possible values are: 1 | 2 | 3 | 4 | -1 (1 - First, 2- Second, 3 - Third, 4 - Fourth, -1 - Last)Example: First Monday - 1MO
      • BYMONTHDAY - The day of the month (used when FREQ is MONTHLY or YEARLY). The values are:1 to 31
      • BYMONTH - Month (used when FREQ is YEARLY). The possible values are: 1 to 12 ( 1 - Jan, 12- Dec)

      Examples:

      • For daily recurring event :
        "FREQ=DAILY;COUNT=5;INTERVAL=1" (every 1 day once, ends)
        "FREQ=DAILY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR;COUNT=5" (Every weekday for 5 times)
      • For weekly recurring event:
        "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU;UNTIL=20230817T064600Z" (Every week on Monday,Tuesday Until 17 Aug 2023)
      • For monthly recurring event:
        "FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=17" (Every month on day 17)
        "FREQ=MONTHLY;INTERVAL=1;BYDAY=TU;BYSETPOS=-1;COUNT=2" (Every month on Last Tuesday for 2 times)
      • For yearly recurring event:
        "FREQ=YEARLY;INTERVAL=1;BYDAY=MO;BYSETPOS=3;BYMONTH=7" (Every year on Third Monday of July)
        "FREQ=YEARLY;INTERVAL=1;BYMONTH=7;BYMONTHDAY=17;COUNT=1" (Every July on day 17 for 1 Times)
    • attendees JSONArray

      This param is used to include the attendee details for the event. This JSONArray includes below params as JSONObject.

      • email string
        - The email id of the attendee (mandatory).
      • zid long
        - The zuid of the attendee.
      • permission - The attendee's permission for the event from the options - 0|1|2|3.
        • 0 - Guest
        • 1 - View
        • 2 - Invite
        • 3 - Edit
      • attendence- 0|1|2
        • 0- Non participant
        • 1- Required participant
        • 2 - Optional participant
      • Example: "attendees": [{"email":"user1@domain.com", "permission":"1"},{"email":"user2@domain.com","permission":"1"}]

      Note:

      Each attendee's details have to be mentioned as a separate JSONObject.

    • group_attendeesJSONArray

      This param is used to include the Group attendees' to whom the event invitation should be sent. This JSONArray includes below params as JSONObject:

      • zidlong
        - The zuid of the group.(mandatory)
      • Example: "group_attendees":[{"zid":"123565"}]
    • repeatJSONArray(Use either rrule or repeat param to add repeat events)

      This param is used to add repeat events.This JSONArray includes below params as JSONObject:

       Example: "repeat": [{"freq": "yearly", "bymonth": "4", "bymonthday": "28", "interval": 1}]

      • freq - daily|weekly|monthly|yearly (mandatory).
      • count - Mentions the number of times the event should repeat. For example,when you want this event to repeat everyday for 5days, the count value should be 5.
      • interval - Periodic occurrence. For example, if you want the event to repeat every 3 days once, the interval value is 3.
      • until- The date until which the event needs to repeat. The format should be yyyyMMdd'T'HHmmss'Z' in GMT format or yyyyMMdd (if it is an allday event)
      • byday - Used in monthly and yearly events. For example, 4FR i.e fourth friday.
      • bymonthday - Used in monthly and yearly events. For example,28 i.e On day 28. The possible values are 1-31
      • bymonth - Used in yearly events. The possible values are 1|2|3|4|5|6|7|8|9|10|11|12
    • reminders JSONArray

      Type of reminders to be set for the event. This JSONArray includes below params as JSONObject:

      • action - email|popup|notification
      • minutes - int - mandatory
    • calendar_alarm boolean

      Whether to add calendar alarm (true) or not (false)

    • notify_attendee int

      Used to notify the attendees of the event. The possible values are 0|1|2,

      • 0- none
      • 1- notify attendees only
      • 2- notify both attendees and myself
    • attach JSONObject

      Used to attach files to an event.

      • fileId -string, The format should be a comma(,) separated filelds. (Use attach API to get the fileId value)
    • transparency int

      Whether the event should be added to the free/busy schedule. The possible values are,

      • 0 - add to free/busy schedule.
      • 1- don't add to your free/busy schedule. The grid will be shown as free even if events are present at that time.
    • conference string

      The possible values are - zmeeting|none

    • notifyType int

      The value is- 1

      • DEFAULT_NOTIFICATION(1)
    • allowForwarding boolean

      Whether the attendees are allowed to forward the event (true) or not (false).

      Note:

      allowForwarding - User A adds an event with user B as an attendee with allowForwarding as "true". User B forwards it to user C and user C receives an email. The event will be added to his calendar only if he accepts the event invite email.

      Note:

      If you are sending the params in Postman, it needs to be encoded.

Sample Request

Copiedhttps://calendar.zoho.com/api/v1/calendars/849d6badb4e04acc91860c43db0fb109/events?eventdata={
 "reminders":[
  {
   "action":"popup",
   "minutes":-60
  }
 ],
 "dateandtime": {
        "timezone": "Asia/Kolkata",
        "start": "20221130T180000Z",
        "end": "20221130T183000Z"
    },
"attach":{
"fileId":"1669786154601000001,1669786188806000001"
},
 "title":"test invitation",
 "attendees":[
  {
   "email":"user2@pavi1.com",
   "status":"NEEDS-ACTION"
  }
 ],
"conference":"zmeeting"
}

Sample Response

Copied{
    "events": [
        {
            "reminders": [
                {
                    "minutes": "-60",
                    "action": "popup"
                }
            ],
            "enable_eventmanagement": false,
            "conference": "zmeeting",
            "role": "organizer",
            "color": "",
            "orgDName": "user10 ",
            "calid": "293770000000002003",
            "has_attachment": true,
            "title": "test invitation",
            "calendar_alarm": false,
            "duration": "1800000",
            "uid": "78fb74a782f94f7bb307201f5b43f086@zoho.com",
            "createdby": "user10@pavi1.com",
            "etype": "EVENT",
            "attach": [
                {
                    "fileName": "",
                    "size": 0,
                    "contentType": "",
                    "fileId": "1669788842017000001"
                },
                {
                    "fileName": "",
                    "size": 0,
                    "contentType": "",
                    "fileId": "1669788842020000002"
                }
            ],
            "id": "293770000000010005",
            "app_data": {
                "meetingdata": {
                    "meetinglink": "https://meeting.zoho.com/meeting/meeting-start?key=1074329242"
                }
            },
            "isApproved": true,
            "viewEventURL": "https://calendar.zoho.com/zc/viewevent/849d6badb4e04acc91860c43db0fb109_EID78fb74a782f94f7bb307201f5b43f086@zoho.com",
            "dateandtime": {
                "timezone": "Asia/Kolkata",
                "start": "20221130T233000+0530",
                "end": "20221201T000000+0530"
            },
            "lastmodifiedtime": "20221130T061401Z",
            "isprivate": false,
            "rsvpStatus": 1,
            "attendees": [
                {
                    "dName": "User2",
                    "id": 70256353,
                    "privilege": 1,
                    "email": "user2@pavi1.com",
                    "attendance": 1,
                    "status": "NEEDS-ACTION"
                },
                {
                    "dName": "",
                    "id": 70421263,
                    "privilege": 4,
                    "email": "user10@pavi1.com",
                    "attendance": 1,
                    "status": "ACCEPTED"
                }
            ],
            "createdtime_millis": "1669788841981",
            "createdtime": "20221130T061401Z",
            "user_timezone": "Asia/Kolkata",
            "notifyType": 0,
            "estatus": "added",
            "organizer": "user10@pavi1.com",
            "isallday": false,
            "transparency": 0,
            "conference_data": {
                "meetingdata": {
                    "zoho_meeting_id": "1074329242",
                    "meeting_id": "1074329242",
                    "meeting_link": "https://meeting.zoho.com/meeting/meeting-start?key=1074329242",
                    "status": "needsAction"
                }
            },
            "modifiedby": "user10@pavi1.com",
            "etag": "1669788841981",
            "caluid": "849d6badb4e04acc91860c43db0fb109",
            "multiday": false,
            "allowForwarding": false
        }
    ]
}