> ## Documentation Index
> Fetch the complete documentation index at: https://docs.grindxp.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# grindxp gateway

> Manage the webhook gateway server.

The gateway is an HTTP server that receives incoming webhooks and normalizes them into `signals` for the Forge to process.

## Subcommands

### `gateway start`

```bash theme={null}
grindxp gateway start
```

Starts the gateway and enables autostart using the OS service manager when available (`launchd`, `systemd --user`, or Task Scheduler). Runtime state is tracked in `~/.grind/gateway-state.json`.

### `gateway enable`

```bash theme={null}
grindxp gateway enable
```

Alias for `gateway start`.

### `gateway stop`

```bash theme={null}
grindxp gateway stop
```

Stops the running gateway process.

### `gateway disable`

```bash theme={null}
grindxp gateway disable
```

Disables gateway autostart and stops the gateway.

### `gateway restart`

```bash theme={null}
grindxp gateway restart
```

Stops and restarts the gateway.

### `gateway status`

```bash theme={null}
grindxp gateway status
```

Shows runtime status, autostart status, health, and endpoint.

### `gateway serve`

```bash theme={null}
grindxp gateway serve
```

Runs the gateway in the foreground (useful for debugging webhook delivery).

## Webhook Endpoints

| Endpoint                      | Integration                                      |
| ----------------------------- | ------------------------------------------------ |
| `GET /health`                 | Health check                                     |
| `POST /hooks/inbound`         | Generic inbound signal                           |
| `POST /hooks/telegram`        | Telegram Bot API                                 |
| `POST /hooks/discord`         | Discord webhook (Ed25519 signature verification) |
| `POST /hooks/google-calendar` | Google Calendar push notifications               |
| `POST /hooks/whatsapp`        | WhatsApp Cloud API (HMAC signature verification) |

## Configuration

Configure via environment variables:

```bash theme={null}
GRIND_GATEWAY_PORT=5174              # default: 5174
GRIND_GATEWAY_TOKEN=...              # shared secret for /hooks/inbound
GRIND_TELEGRAM_BOT_TOKEN=...         # for Telegram webhook verification
GRIND_DISCORD_PUBLIC_KEY=...         # for Discord Ed25519 verification
GRIND_WHATSAPP_APP_SECRET=...        # for WhatsApp HMAC verification
GRIND_GOOGLE_CALENDAR_CHANNEL_TOKEN=...
```

See [Environment Reference](/docs/reference/env) for the full list.

## Related

* [Self-Hosting](/docs/install/self-hosting): expose the gateway publicly for webhooks via a reverse proxy
