Nylas API Reference
The Nylas API is designed using the REST ideology to provide simple and predictable URIs to access and modify objects. Requests support standard HTTP methods like GET, PUT, POST, and DELETE, and standard status codes. Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise.
You can use the Nylas Postman collection to quickly start using the Nylas APIs. For more information, check out the Nylas Postman collection documentation.
Enable compression to optimize performance
The Email, Calendar, Contacts, and Scheduler APIs return gzip-compressed responses when your request includes the Accept-Encoding: gzip header. Most HTTP libraries negotiate and decompress gzip responses automatically. With curl, use --compressed. Nylas skips compression for responses under about 200 bytes.
Compression pairs well with query parameters that limit the number of objects returned and field selection that limits which fields come back in each object. For the full walkthrough, including webhook, Pub/Sub, and SNS compression, see Reducing payload size with compression.
Query parameters
Nylas allows you to include query parameters in GET requests that return a list of results. Query parameters let you narrow the results Nylas returns, meaning fewer requests to the provider and less data for your application to sift through. For more information, see Rate limits in Nylas.
The table below shows the query parameters you can use for the GET requests in the Email, Calendar, Contacts, and Notetaker APIs.
| Endpoint | Query parameters |
|---|---|
GET /v3/grants/<NYLAS_GRANT_ID>/calendars |
limit, page_token, metadata_pair, select |
GET /v3/grants/<NYLAS_GRANT_ID>/events |
calendar_id (required), limit, page_token, show_cancelled, title, description, ical_uid, location, start, end, master_event_id, metadata_pair, busy, updated_before, updated_after, attendees, event_type, expand_recurring, tentative_as_busy, select |
GET /v3/grants/<NYLAS_GRANT_ID>/drafts |
limit, page_token, subject, any_email, to, cc, bcc, starred, thread_id, has_attachment, query_imap, select |
GET /v3/grants/<NYLAS_GRANT_ID>/messages |
limit, page_token, subject, any_email, to, from, cc, bcc, in, unread, starred, thread_id, received_before, received_after, has_attachment, fields, search_query_native, metadata_pair, query_imap, shared_from, select |
GET /v3/grants/<NYLAS_GRANT_ID>/threads |
limit, page_token, subject, any_email, to, from, cc, bcc, in, unread, starred, latest_message_before, latest_message_after, has_attachment, search_query_native, earliest_message_date, shared_folder_id, shared_from, select |
GET /v3/grants/<NYLAS_GRANT_ID>/folders |
limit, page_token, parent_id, include_hidden_folders, shared_from, single_level, select |
GET /v3/grants/<NYLAS_GRANT_ID>/contacts |
limit, page_token, email, phone_number, source, group, recurse, select |
GET /v3/grants/<NYLAS_GRANT_ID>/notetakers |
limit, page_token, prev_page_token, join_time_start, join_time_end, state, order_by, order_direction |
You can use the limit parameter to set the maximum number of results Nylas returns for your request. Nylas recommends setting a lower limit if you encounter rate limits on the provider. For more information, see Avoiding rate limits in Nylas.
Nylas supports case-insensitive partial matches for some query parameters:
description,location, andtitlein Get all Events requests.subjectin Get all Messages, Get all Drafts, and Get all Threads requests.
If the specified field contains the query term, Nylas matches it regardless of the case. For example, if you set the subject query parameter to march in a Get all Messages request, Nylas might return the following messages:
- "Company March Meeting"
- "Today in history: Mussolini's march on Rome"
- "Your coupon code: mARch"
Since Nylas matches keywords, it won't return the following messages:
- "Confirmation code: abcMarch123"
- "McDonald's golden arches"
Pagination
Nylas might return multiple pages of data when you make a "Get all" request (for example, Get all Events). When this happens, Nylas includes the next_cursor field in its response. You can pass the value of next_cursor as the page_token query parameter in your next request to get the next page of results.
You can use the limit parameter to specify the maximum number of results you want in one page of data. If you see rate limits from the provider, try using a smaller limit value.
| Query Parameter | Type | Description |
|---|---|---|
limit |
integer | The number of objects to return, up to a maximum of 200 (defaults to 50). |
page_token |
string | An identifier that specifies which page of data to return. This value should be taken from the next_cursor response body field. |
Updating objects
PUT and PATCH requests behave similarly in Nylas: when you make a request, Nylas replaces all data in the nested object with the information you define. Because of this, your request might fail if you don't include all mandatory fields.
Nylas doesn't erase the data from fields that you don't include in your request, so you can define only the mandatory fields and any that you want to update.
/me/ syntax for API calls
Nylas includes the /me/ syntax which you can use in access-token authorized API calls instead of specifying a user's grant ID (for example, GET /v3/grants/me/messages).
The /me/ syntax looks up the grant associated with the request's access token, and uses the grant_id as a locator. You can use this syntax for API requests that access account data only, and only if you use access tokens to authorize requests. You can't use this syntax if you're using API key authorization, because there is no grant associated with an API key.
Metadata
You can use the metadata object to add a list of key-value pairs to Calendar, Event, Message, and Draft objects so you can store custom data with them. Both keys and values can be any string. If you want to filter on metadata, however, you must write values to one of the five Nylas-specific keys.
For more information, see the Metadata documentation.
Metadata keys and filtering
Nylas reserves five metadata keys (key1, key2, key3, key4, key5) and indexes their contents. Nylas uses key5 to identify events that count towards the max-fairness round-robin calculation for event availability. For more information, see Group availability and booking best practices.
You can add values to each of these reserved keys, and reference them in a query to filter the objects that Nylas returns. You can also add these filters as query parameters, as in the following examples:
https://api.us.nylas.com/calendar?metadata_pair=key1:on-sitehttps://api.us.nylas.com/events?calendar_id=<CALENDAR_ID>&metadata_pair=key1:on-site
You can't create a query that includes both a provider and metadata filter, other than calendar_id. For example, https://api.us.nylas.com/calendar?metadata_pair=key1:plan-party&title=Birthday returns an error.
Reduce response size with field selection
Field selection allows you to use the select query parameter to specify which fields you want Nylas to include in the response.
You can use field selection for all Nylas API endpoints, except the following:
- All
DELETEendpoints. - All Attachments endpoints.
- All Smart Compose endpoints.
- The Send Message endpoint.
- The Create a Draft endpoint.
Field selection helps to reduce the size of the response, improves latency, and helps you avoid rate limiting issues. You can also use it in cases where you want to avoid working with information from your users that you think might be sensitive.
Field selection can evaluate top-level object fields only. You cannot use it to return only nested fields.
For example, the following request specifies Nylas should return only the id and name fields of the Calendar object.
curl --request GET \
--url 'https://api.us.nylas.com/v3/grants/me/calendars?select=id,name'
The response payload includes only the id and name fields in the data object, as in the example below.
{
"request_id": "5fa64c92-e840-4357-86b9-2aa364d35b88",
"data": [
{
"id": "5d3qmne77v32r8l4phyuksl2x",
"name": "My Calendar"
},
{
"id": "5d3qmne77v32r23aphyuksl2x",
"name": "My Calendar 2"
}
]
}
Nylas encoding
Response bodies are always UTF-8 encoded JSON objects, unless explicitly documented otherwise.
https://api.us.nylas.comNylas provides two ways to handle authentication: Bring Your Own (BYO) Authentication , which uses the /v3/connect/custom endpoint. In BYO Authenticat...
Grants are the main objects that power Nylas, because they grant your Nylas application specific scopes of access (for example, permission to read ema...
The Nylas Send API allows you to send messages immediately, and schedule them to be sent in the future (asynchronously). You can save scheduled messag...
A thread is a grouping of messages which are responses to the same original message. Threads display conversations in a logical and hierarchical way,...
Drafts represent messages that have been composed, but not yet sent. The Nylas Email API uses the same commands to manage drafts across providers, and...
To simplify your experience, the Nylas Email API uses the same commands to manage both folders and labels, and can refer to specific folders using the...
The Smart Compose endpoints extend the Nylas Messages API. Currently, Smart Compose supports only two methods of getting AI responses: you can either...
You can use the attachments schema in a Send Message request to send attachments, regardless of the email provider. You use the Drafts endpoints to ad...
Nylas' Transactional Send endpoint lets you send messages directly from an email domain that you've verified with Nylas. You can use this to send pass...
The Nylas Signatures API lets you create and store HTML email signatures on Nylas, and reference them by ID when sending messages or creating drafts....
Nylas ExtractAI allows you to connect to a user's email inbox and detect messages that match certain criteria. ExtractAI is currently available for on...
The Nylas Calendar API allows you to create and manage calendars, and access the events they contain. Nylas uses the same commands to manage calendars...
Events represent scheduled items on a calendar. The Nylas Events API uses the same commands to manage events across providers, and can refer to specif...
The Nylas Contacts API allows you to return information about rooms that you can book for meetings, conferences, and other events. Room resource booki...
The Nylas Contacts API allows you to create and manage contacts, and organize them into contact groups. Nylas uses the same commands to manage contact...
A configuration is a collection of event settings and preferences. Nylas Scheduler stores Configuration objects in the Scheduler database and loads th...
Nylas Scheduler uses session IDs to authorize requests to the /v3/scheduling/availability and /v3/scheduling/bookings endpoints. When you create a ses...
Nylas Scheduler uses the /v3/scheduling/bookings endpoint to manage bookings. Booking types Nylas Scheduler supports two booking types, booking and or...
Nylas Scheduler uses the /v3/scheduling/availability endpoint to retrieve availability information. When you make a request, Nylas validates the provi...
Group meetings let you host events with multiple participants. Unlike one-on-one meetings, group events are designed for collaborative scheduling wher...
Nylas Notetaker is a real-time meeting bot that you can invite to your online meetings. It records and transcribes your discussion, and delivers resul...
Nylas Notetaker is a real-time meeting bot that you can invite to your online meetings. It records and transcribes your discussion, and delivers resul...
Your application receives information about changes to user accounts and data through Nylas webhooks. 🔍 The term "webhook" can refer to any of three...
Nylas offers two ways to get notifications of what's happening on the provider. You can either subscribe to webhook notifications, or you can set up a...
Amazon SNS notification channels allow you to receive Nylas event notifications through Amazon Simple Notification Service (SNS) instead of webhooks....
Application-level templates let you create reusable messages with dynamic content. Each template is linked to the Nylas application associated with th...
Grant-level templates let you create reusable messages with dynamic content. Each template is linked to the grant specified in a Create Template reque...
Application-level workflows automatically send messages to certain users when a defined event is triggered. For example, if you want to send a confirm...
Grant-level workflows automatically send messages to certain users when a defined event is triggered. For example, if you want to send a confirmation...
In the context of the Nylas APIs, an "application" is the object record of your Nylas application. 🔍 The term "application" can refer to any of three...
In Nylas, a connector (formerly called an "integration") stores information that allows your Nylas application to connect to a third party services, s...
A Nylas connector credential is a special type of record that securely stores information (such as provider settings) that allows you to connect using...
The Manage API Keys endpoints let you create, list, and delete API keys from your Nylas application outside of the Nylas Dashboard. Nylas Service Acco...
The Manage Domains endpoints let you register, verify, update, and delete email domains for use with Transactional Send and Nylas Inbound. Before you...
Workspaces group and organize grants in a Nylas application by a common attribute, such as the email address domain (for example, nylas.com). Assign g...
The Policies endpoints let you define the operational configuration for Nylas Agent Accounts, including message limits, attachment constraints, spam d...
The Rules endpoints let you define automated filtering and routing logic for Nylas Agent Accounts. Each rule specifies a trigger (inbound or outbound)...
The Lists endpoints let you manage typed collections of values (email addresses, domains, or top-level domains) that can be referenced by Rules using...