Skip to main content
The gateway enables HTTP webhooks for external integrations. Configure the server, pairing flow, and optional tunnel providers.

Basic Gateway Configuration

number
default:"3000"
Port to bind the HTTP server to.
string
default:"127.0.0.1"
Host address to bind to. Use 127.0.0.1 (localhost) for local-only access, or 0.0.0.0 to allow external connections.
boolean
default:"true"
Require clients to complete pairing flow before sending webhooks. Highly recommended.
boolean
default:"false"
Allow binding to 0.0.0.0 (all interfaces). Must be explicitly enabled for security.
Setting allow_public_bind: true exposes the gateway to your network. Always use require_pairing: true and configure firewall rules.

Pairing Flow

The pairing flow authenticates external clients:
  1. Client requests pairing code: POST /pair/request
  2. NullClaw displays pairing code to the user
  3. User approves pairing
  4. Client exchanges code for token: POST /pair/confirm
  5. Client uses token in Authorization: Bearer <token> header for all requests

Pairing Configuration

number
default:"10"
Rate limit for pairing requests (per IP address).
number
default:"60"
Rate limit for webhook requests (per token).
number
default:"300"
TTL for idempotency keys (prevents duplicate webhook processing).
array
Pre-authorized bearer tokens (bypasses pairing flow). Use for service-to-service integration.

Example: Pre-authorized Token

Clients can use Authorization: Bearer service-token-abc123 without pairing.

Tunnel Configuration

Tunnels expose the local gateway to the public internet:
string
default:"none"
Tunnel provider:
  • none — No tunnel (default)
  • cloudflared — Cloudflare Tunnel
  • ngrok — Ngrok tunnel
  • tailscale — Tailscale Funnel
  • custom — Custom tunnel command

Cloudflare Tunnel

Automatic HTTPS tunnel via Cloudflare:
Setup:
  1. Install cloudflared: Download
  2. Run NullClaw with tunnel enabled:
  3. NullClaw will print the public HTTPS URL

Ngrok Tunnel

Expose via ngrok:
Setup:
  1. Install ngrok: Download
  2. Set auth token: ngrok authtoken <your-token>
  3. Run NullClaw:

Tailscale Funnel

Expose via Tailscale:
Setup:
  1. Install Tailscale: Download
  2. Enable Funnel: tailscale funnel on
  3. 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:
Response:

POST /webhook

Send a message to NullClaw. Headers:
Request:
Response:

GET /health

Health check endpoint (no auth required). Response:

Example: Public Gateway with Tunnel

This configuration:
  • 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

Use for service-to-service integration:

Security Best Practices

Pairing flow prevents unauthorized access. Only disable if using paired_tokens for service accounts.
Bind to 127.0.0.1 (localhost) unless you need external access. Use tunnels for internet exposure.
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)
Always send X-Idempotency-Key header to prevent duplicate processing of webhooks.
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.