#a question about `/hooks/agent`.(webhook)

1 messages · Page 1 of 1 (latest)

lusty tusk
#

Using this request, the message in the console will automatically disappear, and the task requested in the message will not be executed.
curl -X POST https://your-gateway/hooks/agent \ -H "Authorization: Bearer your-secret-token" \ -H "Content-Type: application/json" \ -d '{ "agent": "my-agent", "message": "Please check server status and generate a report", "sessionKey": "optional-custom-session" }'

unkempt duneBOT
#

/hooks/agent doesn’t behave like a normal console/chat message — it starts an isolated one-shot agent run and returns immediately with a runId. So the console message disappearing can be normal, but the task not running usually points to config/payload issues.

Two likely problems in your example:

  1. Use agentId, not agent.
  2. sessionKey is rejected/ignored unless hooks are configured to allow request-supplied session keys.

Try:

curl -i -X POST http://127.0.0.1:18789/hooks/agent \
  -H 'Authorization: Bearer <hooks.token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "agentId": "my-agent",
    "name": "Server status",
#
    "message": "Please check server status and generate a report",
    "deliver": false
  }'

Minimum config:

{
  hooks: {
    enabled: true,
    path: "/hooks",
    token: "your-secret-token",
    defaultSessionKey: "hook:agent"
  }
#
}

If you really need caller-provided sessionKey, add:

hooks: {
  allowRequestSessionKey: true,
  allowedSessionKeyPrefixes: ["hook:"]
}

Then restart the gateway.

If it still doesn’t run, please paste: