Restrict to email body to last X emails

Hey,
While reading emails, is there a way I can restrict the number of emails that are read from a thread?

Hello from the Nylas Team,
Thank you for bringing this matter to us!

The short answer is yes.

Let me elaborate:

Nylas works by retrieving information from the Mailbox you have connected as a Grant. Using the endpoint, you can get messages available on the Mailbox, and you can filter the results with the Messages Search Parameters. This is the simple solution to it.

Keep in mind, this solution works better for simple requests, as the Email Providers may find trouble working with multiple search parameters and return unexpected items.

A more precise solution is to retrieve the messages using GET /messages and filter/sort them locally, using a cached version of this information, so that you can ensure you have the correct data to display.

I hope this is helpful!

—Carlos Higuerey
Support Engineer, Nylas