OpenClaw operations guide

Set up your first OpenClaw agent webhook

Short answer. Enable the OpenClaw agent webhook on loopback, send a synthetic request with curl, and verify the completed run in Gateway logs. Use an installed Gateway service on the test machine. The examples assume the Gateway is bound to loopback on port 18789 and the test agent is main.

Last updated

The OpenClaw Complete Setup Pack is an optional paid kit ($14.95). Use its workspace starter files and tool-profile patches to prepare a test agent before connecting real events.

By CWYN · Reviewed November 19, 2026 against OpenClaw 2026.11.5

1. Pick one local test agent

Use an installed Gateway service on the test machine. The examples assume the Gateway is bound to loopback on port 18789 and the test agent is main. Confirm that the agent can answer a normal text prompt. Use an agent whose tool policy blocks external actions during this test. The inbound webhook reference describes how an HTTP request starts a turn.

2. Enable the hook for that agent

Find the active config with openclaw config file and merge this block. Replace HOOK_TOKEN with a long random token dedicated to webhooks. Use the same agent ID here and in the test request.

{
  hooks: {
    enabled: true,
    token: "HOOK_TOKEN",
    path: "/hooks",
    allowedAgentIds: ["main"],
    allowRequestSessionKey: false,
  },
}

3. Validate the config and watch the Gateway logs

Run these commands on the Gateway host. Correct any validation error before restarting. Leave the log view open for the test.

openclaw config validate
openclaw gateway restart
openclaw logs --follow

4. Send one test request on loopback

Use another terminal on the same host. Set OPENCLAW_HOOK_TOKEN in that terminal without saving the token in shell history, then adjust the port if needed. The synthetic message needs no tools or external delivery. deliver: false suppresses the announcement. Tool restrictions come from the agent policy.

curl --include http://127.0.0.1:18789/hooks/agent \
  -H "Authorization: Bearer $OPENCLAW_HOOK_TOKEN" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: webhook-smoke-001' \
  --data '{"message":"Summarize this test event: the sample import completed.","name":"Webhook smoke test","agentId":"main","deliver":false}'

5. Match the admitted run to a completed run

Look for HTTP 200 and a runId. That records admission. Find hook agent run completed with the same ID in the Gateway logs and check for status=ok. No chat announcement is expected for this test.

Get your free CWYN Score

Next steps