Skip to content
Skip to main content
GET
/v3/grants/{grant_id}/events

Return all events

Returns all events on the user's calendars.

NYLAS API KEYACCESS TOKEN

Parameters

Path parameters

grant_id*string

ID of the grant to access. You can also use the email address associated with the grant, or use /me/ to refer to the grant associated with an access token.

Query parameters

attendeesstring

(Not supported for virtual calendars) Filter for events that include the specified attendees. This parameter accepts a comma-delimited list of email addresses.

busyboolean

(Not supported for iCloud) Filter for events with the specified busy status.

calendar_id*string

Filter for the specified calendar ID.

(Not supported for iCloud) You can use primary to query the user's primary calendar.

descriptionstring

Filter for events matching the specified description. The filter is case insensitive and will match partial descriptions.

endinteger

Filter for events that end at or before the specified time, in seconds using the Unix timestamp format. For example, if you filter for events that end at 5:00p.m., and the calendar includes an event that runs from 4:30–5:30p.m., Nylas returns that event.

Defaults to one month from the time you make the request.

The end value cannot be earlier than start. For iCloud accounts, the difference between start and end can't be greater than one year.

event_typestring

(Google only) Filter for events with the specified event type. You can pass this query parameter multiple times to select or exclude multiple event types. For example, event_type=default&event_type=outOfOffice returns all events that are default or OOO, and excludes any events that are focusTime or that have a workingLocation.

If you don't specify an event type, Nylas uses default to filter for regular events that don't have another specific type.

defaultoutOfOfficefocusTimeworkingLocation
expand_recurringboolean

This parameter is deprecated. Use the Import Events endpoint instead.

When true, Nylas returns all recurring events within the specified time range, including individual occurrences of the recurring event. Otherwise, Nylas only returns the parent event and any event overrides (individual occurrences that have been edited) in the time range.

Default: true
ical_uidstring

(Not supported for iCloud) Filter for events with the specified ical_uid. You cannot apply other filters if you use this parameter.

limitinteger

The maximum number of objects to return. See Pagination for more information.

Default: 50
locationstring

Filter for events with the specified location. The filter is case insensitive and will match partial locations.

master_event_idstring

(Not supported for iCloud) Filter for instances of recurring events with the specified master_event_id.

master_event_id is not respected by metadata filtering.

When using master_event_id to fetch recurring events with a Google grant, the order of the results will not be sorted chronologically. Instead, Nylas returns the unchanged occurrences first, followed by the modified occurrences. For example, if you have a recurring event with the following occurrences:

  • 2025-01-01
  • 2025-01-02
  • 2025-01-03

But you modify the time of the second occurrence to 2025-01-02, the results will be:

  • 2025-01-01
  • 2025-01-03
  • 2025-01-02 (modified)
metadata_pairstring

Pass a metadata key/value pair (for example, ?metadata_pair=key1:value) to search for metadata associated with objects. See Metadata for more information.

page_tokenstring

An identifier that specifies which page of data to return. You can get this value from the next_cursor response field. See Pagination for more information.

selectstring

Specify fields that you want Nylas to return, as a comma-separated list (for example, select=id,updated_at). This allows you to receive only the portion of object data that you're interested in. You can use select to optimize response size and reduce latency by limiting queries to only the information that you need.

show_cancelledboolean

(Not supported for iCloud or EWS) If true, Nylas includes events whose status is cancelled.

Different providers have different semantics for cancelled events:

  • Google: An event is considered cancelled after a user deletes it from their calendar, until it's eventually hard-deleted and is no longer readable.
  • Microsoft: An event is considered cancelled if the user is invited to an event and the organizer deletes it. The cancelled version of the event stays on the participants' calendars until they delete it manually.
Default: false
startinteger

Filter for events that start at or after the specified time, in seconds using the Unix timestamp format. For example, if you filter for events that start at 9:00a.m., and the calendar includes an event that runs from 8:30–9:30a.m., Nylas returns that event.

Defaults to the time that you make the request.

The start value cannot be later than end. For iCloud accounts, the difference between start and end can't be greater than one year.

tentative_as_busyboolean

(Microsoft and EWS only) When true, Nylas treats tentative events as busy.

Default: true
titlestring

Filter for events that match the specified title. The filter is case insensitive and will match partial titles.

updated_afterinteger

(Google, Microsoft, and EWS only) Filter for events that have been updated after the specified time, in seconds using the Unix timestamp format.

updated_after is not respected by metadata filtering.

updated_beforeinteger

(Google, Microsoft, and EWS only) Filter for events that have been updated before the specified time, in seconds using the Unix timestamp format.

updated_before is not respected by metadata filtering.

Responses

request_idstring

The request ID.

dataarray<object>
next_cursorstringnull

A cursor pointing to the next page of results for the request.

GEThttps://api.us.nylas.com/v3/grants/nyla%40example.com/events?expand_recurring=true&limit=50&show_cancelled=false&tentative_as_busy=true

Find your API key in the Nylas Dashboard under API Keys in your application settings.

grant_idrequiredstring

ID of the grant to access. You can also use the email address associated with the grant, or use /me/ to refer to the grant associated with an access token.

calendar_idrequiredstring

Filter for the specified calendar ID. (Not supported for iCloud) You can use primary to query the user's primary calendar.