Skip to content
Skip to main content

Threads

A thread is a grouping of messages which are responses to the same original message. Threads display conversations in a logical and hierarchical way, depending on when the messages were sent and which of the messages in a chain they respond to.

Instead of displaying messages as individual and unrelated items, threads group related messages together based on any combination of the following:

  • Subject line
  • Message reference
  • In-reply-to
  • Recipients and senders
  • Time and chronology
  • Folder context

Threading provides an organized and coherent view of conversations, especially when several people are involved and there have been many replies. Threading allows participants to more easily follow the flow of a conversation, and understand the context and progression of the discussion.

Search threads

Search for threads by making a GET /v3/grants/<NYLAS_GRANT_ID>/threads request that includes any of the following query parameters:

  • subject
  • any_email, to, from, cc, bcc
  • latest_message_before, latest_message_after
  • in, unread, starred, has_attachment
  • search_query_native
⚠️ Nylas doesn't support filtering for folders using keywords or attributes (for example, in:inbox returns a 400 error). Instead, you should use the folder ID with in to get the data you need.

The search_query_native parameter allows you to add provider-specific query strings to your request for Google, Microsoft Graph, and EWS accounts. The value that you specify must be URL-encoded.

For more information and a list of provider considerations, see Searching with Nylas.

Threads rate limits

The Threads endpoints make a significant number of calls to the provider for each API request you make. Because of this, you might encounter rate limits when working with large threads of messages. Nylas recommends taking the following steps to avoid rate limits when using the Threads endpoints:

  • Specify a lower limit to reduce the number of results Nylas returns.
  • Add query parameters to your request to filter for specific threads.
  • Use the select parameter to tell Nylas to return just the top-level fields you need.