Command
nylas auth token
Display current API token.
Written by Qasim Muhammad Staff SRE
What does nylas auth token do?
The nylas auth token command prints the active API token or access token for the current grant. Useful for debugging authentication issues, passing tokens to external scripts, or inspecting token claims.
Usage
nylas auth tokenFlags
| 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 | Limit results (most list commands) |
| --yes(-y) | Skip confirmations |
| --copy(-c) | Copy to clipboard |
Examples
Display token
nylas auth tokenPass token to curl
curl -H "Authorization: Bearer $(nylas auth token)" https://api.us.nylas.com/v3/grantsExample output
API Key: nyl_abc123def456ghi789
Region: us
Use --copy to copy the key to your clipboard.Troubleshooting
No token displayed
You're not authenticated. Run `nylas auth config --api-key` or `nylas auth login` first.
Token doesn't work with API calls
Make sure you're using the right base URL for your region (us or eu). Check with `nylas auth show`.
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.
Book meeting rooms from the CLI
Book meeting rooms from the CLI by listing calendar resources, using each room email as a calendar ID, and adding it as an event participant with less setup.
OfflineIMAP vs Nylas: Python IMAP sync
OfflineIMAP is a Python tool that syncs IMAP mail to local Maildir. Compare its config, Gmail OAuth2, sync speed, and an API email CLI that skips the mirror.
neomutt vs Nylas: IMAP reader vs email API
neomutt is a configurable IMAP terminal mail reader. Compare it to an API-backed email CLI on OAuth setup, scripting, offline access, and calendar reach.
mbsync vs Nylas: IMAP sync vs email API
mbsync (isync) syncs IMAP mailboxes to local Maildir for mutt or neomutt. Compare its sync model, Gmail OAuth setup, and where an API email CLI skips it.
Google Calendar API Sync Tokens
Use Google Calendar API sync tokens for incremental event sync, handle the 410 GONE full-resync, and read calendars from the CLI.
Run nylas auth token --help for full help output.