Sooner or later your app needs to find specific messages: every email from one sender, everything with "invoice" in the subject, unread mail from last week, or a complex query only Gmail's search box can express. Nylas gives you two ways to do this, and they trade off against each other. Standard query parameters are normalized across providers, so largely one code path searches Gmail and Outlook alike, give or take a few provider-specific constraints. The search_query_native parameter lets you pass the provider's own query language for power searches the standard set doesn't cover. This post walks both with the Email API and shows the CLI for the portable one.

It's a worked use case rather than an endpoint tour, covering searching messages from two angles: the HTTP API your backend calls and the nylas CLI for searching from the terminal. I work on the CLI, so the commands below are the ones I reach for when I just need to find a message.

Two ways to search

The split is between portable and provider-specific. Standard query parameters, things like from, subject, unread, and date filters, are normalized by Nylas, so the same request returns matching messages whether the account is Google, Microsoft, or IMAP. You write the search once and it works across providers, which is the whole point of an abstraction layer over many of them, though a couple of providers add constraints covered later.