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.
Agent Account grants support metadata on events, with the same 50-pair limit and the same five indexed reserved keys as connected grants.
Agent Account events
When you need to host events for a user or resource that has no account on a provider (for example, an external contractor, a meeting room, or an AI agent), create an Agent Account. All of the Events endpoints work on an Agent Account grant. Because the account is a real mailbox, creating an event with notify_participants=true sends an invitation to each participant, updates and cancellations reach every attendee's calendar, and the Send RSVP endpoint answers invitations the account receives.
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...