set_webhook
Register (or replace) this account's webhook; the secret is returned ONCE. Admin scope.
Hook Detector POSTs signed job.succeeded/job.failed/credits.low (WP-M). `url` https, no
creds, public host; re-registering ROTATES the secret (a repeat call is not a no-op).
Verify via X-VHG-Signature: sha256=HMAC_SHA256(secret, raw_body); a webhook.test pings.
Args: url (1-2048), api_key (admin). Cost=free. Errors: unauthorized, forbidden,
invalid_request, rate_limited. Returns {url, secret, created_at, events, note,
test_delivery_id}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | https:// endpoint that will receive signed event POSTs. Must be a public host with no embedded credentials. Re-registering ANY url rotates the signing secret, so this is not safe to blind-retry. | |
| api_key | No | API key for this call. Omit to fall back to the Authorization: Bearer / X-API-Key request header (streamable-HTTP only), then the VHGENGINE_API_KEY env var (the stdio default). No key resolvable -> unauthorized. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | The endpoint now registered. | |
| note | No | Human-readable summary, including the rotation warning. | |
| events | No | Event types that will be delivered. | |
| secret | No | HMAC signing secret, shown exactly once. Verify deliveries with X-VHG-Signature: sha256=HMAC_SHA256(secret, raw_body). | |
| test_note | No | What that test delivery is and how to check it. | |
| created_at | No | Registration time, ISO-8601 UTC. | |
| test_delivery_id | No | A webhook.test ping enqueued immediately; look it up with list_webhook_deliveries to prove your receiver works. |