Skip to content
Skip to main content
GET
https://api.us.nylas.com/v3/grants/{grant_id}/events/import

Import events

Returns 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 events from the time frame to your application (for example, to enrich events with custom data or integrate events into your own calendaring solution).

By default, recurring-event results differ by provider:

  • Google: Returns individual occurrences in the requested window, including edited and cancelled occurrences. Cancelled occurrences have status=cancelled. Series parents and their recurrence rules (RRULE) are not returned.
  • Microsoft: Returns the series parent for ordinary occurrences and returns edits individually. A window containing only an edit can return the edit alone. A returned parent can start outside the window and includes the RRULE and EXDATE values for edits and deletions.
  • iCloud and EWS: Retain their existing non-expanded listing behavior with series parents and provider-supplied overrides and exclusions.

Use List Events with expand_recurring=false when you need series parents, recurrence rules, and edited occurrences instead of every occurrence. The parameter remains supported and defaults to true on List Events. Import Events does not accept expand_recurring. With Google's default Import behavior, use List Events for non-expanded results or set recurrence_mode=series on Import Events. See Choose List Events or Import Events for a comparison.

Set recurrence_mode=expanded or recurrence_mode=series to choose the same representation on Google, Microsoft Graph, iCloud, and EWS. Omitting the parameter preserves the provider-specific behavior above. See Import recurrence modes for cancellation and pagination requirements.

Limitations

  • Nylas might return multiple instances of a single recurring event if the results are paginated.
  • The number of events Nylas returns might be lower than limit, even if others match your query parameters.
  • Events are not guaranteed to be sorted by their start time.
  • Nylas does not support metadata for this endpoint.
  • Nylas does not support this endpoint for virtual calendars. Requests on a virtual calendar grant return a 400 error.
  • The end value must be later than start. If the two values are equal, Nylas returns a 400 error.
  • Agent Account grants ignore the select query parameter and return full Event objects.

Works with an API key, an access token (use /v3/grants/me/ in place of the grant ID), or an IAM API key with the events.import permission.

Parameters

Path parameters

grant_id*string

ID of the grant to access. Use /me/ to refer to the grant associated with an access token.

Query parameters

limitinteger

Specifies the maximum number of events Nylas returns in a single page of results. The actual number of events Nylas returns might be lower than this limit, even if other events match your query parameters.

Default: 50
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.

calendar_id*string

Filter for the specified calendar ID.

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

For an Agent Account, you can also pass the account's own email address, in any letter case, to query its primary calendar. Any other email address returns a 400 error.

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.

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.

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.

recurrence_modestring

Supported for Google, Microsoft Graph, iCloud, and Exchange (EWS). Choose a consistent Import Events recurrence representation across providers:

  • expanded: Returns active individual occurrences and single events in the requested window, including edited occurrences, without series parents or recurrence rules. Cancelled records are excluded. Reconcile deletions only after fetching every page of the same window snapshot.
  • series: Returns series parents with recurrence rules and relevant overrides instead of ordinary occurrences. Parents can start outside the requested window. Collect all pages and merge exclusions using master_event_id and original_start_time before expanding a series. Google series mode requires calendar permissions to read event details, not just free/busy.

Omit this parameter to preserve existing behavior: Google returns expanded results with its existing cancellation handling; Microsoft Graph, iCloud, and EWS retain their existing non-expanded series listing behavior. Import does not change the default for List Events or deprecate expand_recurring=false.

These modes return window snapshots, not deletion change feeds. Keep the same mode, calendar, window, limit, and field selection while paginating. A page token cannot be reused with another mode or with the parameter omitted. See Import recurrence modes for cancellation handling and snapshot reconciliation.

expandedseries

Responses

request_idstring

The request ID.

dataarray<object>
next_cursorstringnullable

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

GEThttps://api.us.nylas.com/v3/grants/{grant_id}/events/import?limit=50

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

grant_idrequiredstring

ID of the grant to access. 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. For an Agent Account, you can also pass the account's own email address, in any letter case, to query its primary calendar. Any other email address returns a 400 error.