Skip to content
Skip to main content
GET
/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).

If you want to retrieve a list of all events from a calendar, use the Get all Events endpoint instead.

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 max_results, 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.
  • Support for Microsoft Graph is in beta.
NYLAS API KEYACCESS TOKEN

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.

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.

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/{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.