Events
Events represent scheduled items on a calendar. The Nylas Events API uses the same commands to manage events across providers, and can refer to specific events using the provider's event_id parameter. Events can be public, private, or shared among a group of users. They might include details like participants, locations, and timing, along with other information.
The Events API includes the Send RSVP endpoint, which allows you to send RSVPs directly from your Nylas application, even for participants who might not have access to edit a specific event.
Metadata on events
You can add metadata to new and existing events by including the metadata sub-object in your POST, PUT, or PATCH request. For more information, see the Metadata documentation.
Virtual calendars
Nylas allows you to create virtual calendars for users and resources that might not have calendars on your providers (for example, external contractors or meeting rooms). You can use the Nylas Calendar and Events APIs with the virtual accounts that power virtual calendars, just like you would any other account. Virtual accounts don't provide email or contacts features, so you can't use them with the Email or Contacts APIs.
For more information, see Using virtual calendars.
Events scopes
The table below lists the Events endpoints and which scopes they require. The table shortens the full scope URI for space reasons, so add the prefix for the provider when requesting scopes.
The ☑️ in each column indicates the most restrictive scope you can request for each provider and still use that API. More permissive scopes appear under the minimum option. If you're already using one of the permissive scopes, you don't need to add the more restrictive scope.
| Endpoint | Google Scopeshttps://www.googleapis.com/auth/... |
Microsoft Scopeshttps://graph.microsoft.com/... |
|---|---|---|
GET /eventsGET /events/<EVENT_ID> |
/calendar.events.readonly ☑️/calendar.events/calendar (Required to use primary keyword when referencing calendars.) |
Calendars.Read ☑️Calendars.ReadWrite |
POST /eventsPUT /events/<EVENT_ID>DELETE /events/<EVENT_ID>POST /events/<EVENT_ID>/send-rsvp |
/calendar.events ☑️/calendar (Required to use primary keyword when referencing calendars.) |
Calendars.ReadWrite ☑️ |
For more information about scopes, see Using scopes to request user data.
Events notifications
You can subscribe to the following notification triggers so Nylas notifies you about changes to your users' event data:
event.createdevent.updatedevent.deleted
These are separate from the event reminders which you might send to your users. For more information, see the Event webhook notification schemas.
Microsoft event considerations
Microsoft Outlook events are often shared across all calendars in a user's account. If the user creates an event on one of their calendars, you can retrieve it using another calendar ID from their grant.
iCloud query considerations
If you're searching for an event within a certain time range on an iCloud account, the difference between start and end can't be greater than six months. If you include a time range greater than six months, Nylas returns an "Invalid request" error similar to the following example.
"error": {
"type": "invalid_request_error",
"message": "The maximum time range for iCloud event queries is 6 months."
}
For more information about searching for events, see Searching with Nylas.
GET /v3/grants/{grant_id}/eventsReturns all events on the user's calendars.
POST /v3/grants/{grant_id}/eventsCreates an event. Microsoft limitations Microsoft ignores the notify participants field and always sends email notifications about changes to events. iCloud limitations iCloud ignores the notify parti...
GET /v3/grants/{grant_id}/events/importReturns a list of recurring events, recurring event exceptions, and single events from the specified calendar within a given time frame. This is useful when you want to import, store, and synchronize...
GET /v3/grants/{grant_id}/events/{event_id}Returns the specified event.
PUT /v3/grants/{grant_id}/events/{event_id}Updates the specified event, conference, or metadata. When you make a PUT request, Nylas replaces all data in the nested object with the information included in your request. For more information, see...
DELETE /v3/grants/{grant_id}/events/{event_id}Delete the specified event. Google sends deleted events to the "Trash" folder, and you can read them for a period of time using the show cancelled query parameter. Microsoft deletes events immediately...
POST /v3/grants/{grant_id}/events/{event_id}/send-rsvp(Not supported for iCloud) Sends a response to an event that you're added to as a participant. You can't directly update events as a participant. For most events on EWS, if you decline the event by se...