Source: https://cli.nylas.com/docs/commands/webhook-server

# nylas webhook server

The nylas webhook server command starts a local HTTP server that receives webhook events from Nylas. It automatically creates a tunnel so Nylas can reach your machine. Use --port to choose a port. Events are logged to the terminal in real time, making it easy to debug webhook payloads during development.

## Usage

```bash
nylas webhook server [--port PORT]
```

## 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 |
| --port | Port to listen on (default: 4567) |

## Examples

### Start on default port

```bash
nylas webhook server
```

### Start on a custom port

```bash
nylas webhook server --port 8080
```

## Troubleshooting

### Port already in use

Choose a different port with --port, or stop the process using the default port (lsof -i:4567).

### Tunnel fails to connect

Check your internet connection. If behind a corporate proxy, set HTTPS_PROXY. Try a different port.

## Recommended guides

[Extract OTP Codes from Email — Skip the InboxPull 2FA verification codes from email without opening your inbox. nylas otp get copies the code to your clipboard. Works with Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP.](https://cli.nylas.com/guides/extract-otp-codes-from-email)

[CI/CD Email Alerts with PowerShellSend build notifications, deployment reports, and test failure alerts from GitHub Actions, Azure DevOps, and Jenkins using PowerShell and Nylas CLI.](https://cli.nylas.com/guides/powershell-email-cicd)

[E2E Email Testing with PlaywrightTest password reset, invitation, and verification emails end-to-end. Poll with Nylas CLI, verify content in Playwright, and click links. No Gmail config needed.](https://cli.nylas.com/guides/e2e-email-testing)

Run `nylas webhook server --help` for full help output.
