Command
nylas webhook server
The nylas webhook server command starts a local HTTP server that receives webhook events from Nylas. It listens on port 3000 by default, can expose a cloudflared tunnel with --tunnel, and can verify signed payloads with --secret before your app code runs.
Written by Qasim Muhammad Staff SRE
What does nylas webhook server do?
The nylas webhook server command starts a local HTTP server that receives webhook events from Nylas. It listens on port 3000 by default, can expose a cloudflared tunnel with --tunnel, and can verify signed payloads with --secret before your app code runs.
Usage
nylas webhook server [--port PORT] [--path PATH] [--secret SECRET] [--tunnel cloudflared]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 | Limit results (most list commands) |
| --yes(-y) | Skip confirmations |
| --allow-unsigned | Allow unsigned events when --tunnel is set |
| --json | Output events as JSON |
| --no-tunnel | Skip tunnel preflight and run loopback-only |
| --path | Webhook endpoint path (default: /webhook) |
| --port(-p) | Port to listen on (default: 3000) |
| --quiet(-q) | Suppress startup messages, only show events |
| --secret(-s) | Webhook secret for signature verification |
| --tunnel(-t) | Tunnel provider, such as cloudflared |
Examples
Start with interactive tunnel preflight
nylas webhook serverStart loopback-only on port 3000
nylas webhook server --no-tunnel --port 3000Start with a cloudflared tunnel and signature checks
nylas webhook server --tunnel cloudflared --secret "$NYLAS_WEBHOOK_SECRET"Troubleshooting
Port already in use
Choose a different port with --port, or stop the process using the default port (lsof -i :3000).
Tunnel fails to connect
Check your internet connection. If behind a corporate proxy, set HTTPS_PROXY. Try a different port.
Recommended guides
Mailtrap Alternative for Real Inbox Testing
Compare Mailtrap, Mailosaur, and Nylas Agent Accounts for testing transactional email flows with real inbox delivery.
Cypress Email Testing
Test password resets, magic links, and OTP emails in Cypress with a real inbox, Nylas CLI JSON output, and isolated agent accounts.
Test Email Webhooks Locally
Test Nylas email webhooks locally with tunnel setup, signed payload checks, trigger discovery, and replayable fixtures before shipping handlers.
Extract OTP Codes from Email — Skip the Inbox
Pull 2FA verification codes from email without opening your inbox. The nylas otp get command copies the latest code to your clipboard across all providers.
CI/CD Email Alerts with PowerShell
Send build failure alerts, deployment reports, and test results from GitHub Actions, Azure DevOps, and Jenkins pipelines using PowerShell and Nylas CLI.
E2E Email Testing with Playwright
Test password reset, invitation, and verification emails end-to-end. Poll with Nylas CLI, verify content in Playwright, and click links. No Gmail config needed.
Run nylas webhook server --help for full help output.