Mark an email as read. Works across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP.
The nylas email mark-read command sets the read/seen flag on a message. Combine with nylas email list --unread and a shell loop to mark all unread messages as read in one pass.
Syntax
nylas email mark-read --id MESSAGE_ID
How It Works
The Nylas CLI abstracts away the differences between Gmail's API, Microsoft Graph, Exchange Web Services, and raw IMAP. You write one command; it works across all providers. This matters for automation — your cron job or CI pipeline doesn't need provider-specific logic.
Examples
Mark a single email as read:
nylas email mark-read --id msg_abc123
Mark all unread emails as read:
nylas email list --unread --json | jq -r '.[].id' | while read id; do nylas email mark-read --id "$id"; done
Common Issues
Email marked read but still shows unread in provider
Some providers take a few seconds to sync. Wait and refresh your webmail client.
Message ID not found
Run nylas email list --unread --json to get valid unread message IDs.
Tips
Pipe to jq: nylas email mark-read --json | jq '.' gives you structured data you can filter and transform.
Combine with other commands: Chain nylas email mark-read with other Nylas CLI commands using shell pipes and variables for complex workflows.
Full docs: nylas email mark-read reference — all flags, advanced examples, and troubleshooting.
All commands: Nylas CLI Command Reference
Get started: brew install nylas/nylas-cli/nylas — other install methods
Top comments (0)