Command
nylas email search
Search emails by query and filters.
Written by Qasim Muhammad Staff SRE
What does nylas email search do?
The nylas email search command finds emails matching a query across your connected mailbox. Filter by sender, date range, read status, or attachment presence. Results are returned in reverse chronological order. Use --json for structured output in scripts and AI agent tool calls.
Usage
nylas email search <query> [grant-id] [flags]Flags
| Flag | Description |
|---|---|
| --json | Output as JSON |
| --no-color | Disable color output |
| --verbose(-v) | Enable verbose output |
| --config | Custom config file path |
| --help(-h) | Show help for the command |
| --limit(-l) | Maximum number of results |
| --yes(-y) | Skip confirmations |
| --after | Messages after date (YYYY-MM-DD) |
| --before | Messages before date (YYYY-MM-DD) |
| --from | Filter by sender |
| --has-attachment | Only messages with attachments |
| --in | Filter by folder (for example, INBOX or SENT) |
| --starred | Only starred messages |
| --subject | Filter by subject |
| --to | Filter by recipient |
| --unread | Only unread messages |
Examples
The nylas email search command finds emails matching a query across your connected mailbox.
Search by subject
nylas email search "project update"Search with filters
nylas email search "meeting" --from "boss@company.com" --unreadSearch any subject by sender
nylas email search "*" --from "support@example.com"Search in a folder
nylas email search "invoice" --in INBOXExample output
FROM SUBJECT DATE
Alice Chen Q3 planning 2026-06-21 09:14
Bob Diaz Q3 budget review 2026-06-18 11:47
2 results for "Q3"Troubleshooting
Recommended guides
List Fastmail emails from the CLI
List Fastmail emails from the CLI through Nylas IMAP access, using app passwords, inbox filters, JSON output, and Fastmail-specific auth troubleshooting.
Why Cloud Servers Block SMTP Ports
AWS, GCP, and Azure block outbound SMTP port 25 while ports 587 and 465 stay open. Confirm the block and send email over an HTTPS API instead.
Send Email From a Docker Container
Cloud providers block SMTP port 25 from containers. Send email over an HTTPS API on port 443 with one command and no mail daemon at all.
MailerSend vs Nylas: Email Compared
MailerSend sends transactional email from verified domains. Nylas reads and syncs user inboxes across 6 providers. Compare features, pricing, and use cases.
Customer.io vs Nylas: Email Compared
Customer.io sends lifecycle emails to your user base. Nylas reads and sends from real user inboxes via OAuth. Compare use cases, pricing, and AI agent support.
Knock vs Nylas: Notifications vs Email API
Knock delivers multi-channel product notifications via workflows; Nylas provides two-way email and calendar sync. Compare scope, pricing, and agent support.
Run nylas email search --help for full help output.