The gateway enables HTTP webhooks for external integrations. Configure the server, pairing flow, and optional tunnel providers.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nullclaw/nullclaw/llms.txt
Use this file to discover all available pages before exploring further.
Basic Gateway Configuration
Port to bind the HTTP server to.
Host address to bind to. Use
127.0.0.1 (localhost) for local-only access, or 0.0.0.0 to allow external connections.Require clients to complete pairing flow before sending webhooks. Highly recommended.
Allow binding to
0.0.0.0 (all interfaces). Must be explicitly enabled for security.Pairing Flow
The pairing flow authenticates external clients:- Client requests pairing code:
POST /pair/request - NullClaw displays pairing code to the user
- User approves pairing
- Client exchanges code for token:
POST /pair/confirm - Client uses token in
Authorization: Bearer <token>header for all requests
Pairing Configuration
Rate limit for pairing requests (per IP address).
Rate limit for webhook requests (per token).
TTL for idempotency keys (prevents duplicate webhook processing).
Pre-authorized bearer tokens (bypasses pairing flow). Use for service-to-service integration.
Example: Pre-authorized Token
Authorization: Bearer service-token-abc123 without pairing.
Tunnel Configuration
Tunnels expose the local gateway to the public internet:Tunnel provider:
none— No tunnel (default)cloudflared— Cloudflare Tunnelngrok— Ngrok tunneltailscale— Tailscale Funnelcustom— Custom tunnel command
Cloudflare Tunnel
Automatic HTTPS tunnel via Cloudflare:- Install
cloudflared: Download - Run NullClaw with tunnel enabled:
- NullClaw will print the public HTTPS URL
Ngrok Tunnel
Expose via ngrok:- Install ngrok: Download
- Set auth token:
ngrok authtoken <your-token> - Run NullClaw:
Tailscale Funnel
Expose via Tailscale:- Install Tailscale: Download
- Enable Funnel:
tailscale funnel on - Run NullClaw
Webhook Endpoints
The gateway exposes these endpoints:POST /pair/request
Request a pairing code. Response:POST /pair/confirm
Exchange pairing code for token. Request:POST /webhook
Send a message to NullClaw. Headers:GET /health
Health check endpoint (no auth required). Response:Example: Public Gateway with Tunnel
- Binds gateway to localhost (secure)
- Requires pairing for all clients
- Exposes via Cloudflare Tunnel (automatic HTTPS)
- Rate limits pairing and webhook requests
Example: Service Integration
Security Best Practices
Always enable require_pairing
Always enable require_pairing
Pairing flow prevents unauthorized access. Only disable if using
paired_tokens for service accounts.Use localhost by default
Use localhost by default
Bind to
127.0.0.1 (localhost) unless you need external access. Use tunnels for internet exposure.Rate limit aggressively
Rate limit aggressively
Set conservative rate limits to prevent abuse:
pair_rate_limit_per_minute: 5(pairing is rare)webhook_rate_limit_per_minute: 30(adjust based on usage)
Use idempotency keys
Use idempotency keys
Always send
X-Idempotency-Key header to prevent duplicate processing of webhooks.Rotate paired tokens
Rotate paired tokens
Pre-authorized tokens in
paired_tokens don’t expire. Rotate them periodically.The gateway uses HTTPS when accessed via tunnels (cloudflared, ngrok, tailscale). Local access uses HTTP.