Command

nylas email list

List recent emails with optional filters.

Written by Qasim Muhammad Staff SRE

What does nylas email list do?

The nylas email list command fetches recent emails from your connected mailbox and displays them in your terminal. Filter by unread, starred, or sender. Use --json for pipe-friendly output in scripts, cron jobs, or AI agent tool calls. When the active grant is a Nylas agent account (provider=nylas), this is also the command to read its inbox — replaces the deprecated nylas inbound messages.

Usage

nylas email list [grant-id] [--unread] [--limit N]

Flags

FlagDescription
--jsonOutput as JSON
--no-colorDisable color output
--verbose(-v)Enable verbose output
--configCustom config file path
--help(-h)Show help for the command
--limitLimit results (most list commands)
--yes(-y)Skip confirmations
--unreadShow only unread
--starredShow only starred
--fromFilter by sender
--limitNumber of messages to fetch (default 10)
--all(-a)Fetch all messages (paginated)
--all-foldersShow messages from all folders (default: INBOX only)
--folderFilter by folder (e.g., INBOX, SENT, TRASH, or folder ID)
--idShow message IDs
--maxMaximum messages to fetch with --all (0=unlimited)
--metadataFilter by metadata (format: key:value, only key1-key5 supported)

Examples

List recent emails

nylas email list --limit 10

Unread only

nylas email list --unread

JSON for scripting

nylas email list --json --limit 20

Read an agent account inbox

nylas email list <agent-account-id> --unread --json

Example output

FROM                 SUBJECT              DATE
Alice Chen           Q3 planning          2026-06-21 09:14
Bob Diaz             Re: Invoice #482     2026-06-20 17:02
Newsletter           Weekly digest        2026-06-20 08:30

3 messages

Troubleshooting

Migrating from nylas inbound messages <id>

There is no agent-specific messages subcommand. Use nylas email list with the agent account as the active grant (or pass <agent-account-id> positionally). Set NYLAS_AGENT_GRANT_ID for a default.

Recommended guides

Run nylas email list --help for full help output.