--- summary: "CLI reference for `openclaw webhooks` (Gmail Pub/Sub setup and runner)" read_when: - You want to wire Gmail Pub/Sub events into OpenClaw - You need the full flag list and default values title: "Webhooks" --- # `openclaw webhooks` Webhook helpers and integrations. Today this surface is scoped to Gmail Pub/Sub flows built on the bundled `gog` watcher. ## Subcommands ```bash openclaw webhooks gmail setup --account [...] openclaw webhooks gmail run [--account ] [...] ``` | Subcommand | Description | | ------------- | ------------------------------------------------------------------------------------- | | `gmail setup` | One-time wizard: Gmail watch, Pub/Sub topic/subscription, and OpenClaw hook delivery. | | `gmail run` | Run `gog watch serve` plus the watch auto-renew loop in the foreground. | The Gateway also auto-starts `gog gmail watch serve` on boot once `hooks.enabled=true` and `hooks.gmail.account` is set (set by `gmail setup`). `gmail run` is the same logic in the foreground, useful for debugging or when the Gateway watcher is disabled. See [Gmail Pub/Sub integration](/automation/cron-jobs#gmail-pubsub-integration) for the auto-start details and `OPENCLAW_SKIP_GMAIL_WATCHER` opt-out. ## `webhooks gmail setup` ```bash openclaw webhooks gmail setup --account you@example.com openclaw webhooks gmail setup --account you@example.com --project my-gcp-project --json openclaw webhooks gmail setup --account you@example.com --hook-url https://gateway.example.com/hooks/gmail ``` Installs `gcloud` and `gog` if missing, authenticates `gcloud`, creates the Pub/Sub topic and subscription, starts the Gmail watch, and writes `hooks.gmail` config with `hooks.enabled=true`. Prints `Next: openclaw webhooks gmail run`. ### Required | Flag | Description | | ------------------- | ----------------------- | | `--account ` | Gmail account to watch. | ### Pub/Sub options | Flag | Default | Description | | ----------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | `--project ` | (none) | GCP project id (the OAuth client owner). Falls back to the topic's own project id, then to the project resolved from `gog` credentials. | | `--topic ` | `gog-gmail-watch` | Pub/Sub topic name. | | `--subscription ` | `gog-gmail-watch-push` | Pub/Sub subscription name. | | `--label