Aperçu

Register webhook traffic spike

POST/api/v1/register_webhook_traffic_spike
Features

Register a webhook for the 'traffic_spike' event (BUSINESS, advanced event) — the direct call for 'notify us when…', 'alert me if…', 'ping our channel when…' about this event. Fires when traffic exceeds typical baseline (advanced event). Delivery is an asynchronous HTTP POST. A Slack (hooks.slack.com) or Discord (discord.com/api/webhooks) incoming-webhook URL is recognised by its host and the message shaped for that platform — paste it as-is; any other URL receives the signed JSON envelope (HMAC-SHA256 in X-Docsbook-Signature-256, event type in X-Docsbook-Event). Below the BUSINESS plan the call returns PLAN_RESTRICTION naming the tier — no pre-check needed.

Price — $0.00001 per call (twice what serving it costs us), charged to the workspace balance, the same as over MCP.

Also reachable by name at POST /api/v1/tools/register_webhook_traffic_spike.

Input3
Authorizationheaderrequired
Your API key, sent as Authorization: Bearer dbk_YOUR_API_KEY.Sent from your browser straight to the API — never to Docsbook, never stored.
urlstring · body
HTTPS endpoint to receive POST callbacks
secretstring · body
Optional shared secret (>=16 chars). One is generated if omitted.
auth_headerstring · body
Optional Authorization header value sent verbatim on delivery, e.g. 'Bearer sk-…' for endpoints that require auth (Claude Code routine fire URLs).
Output3
okboolean
Whether the tool itself succeeded. A tool that ran and refused — an exhausted balance, a plan restriction, a bad argument — answers 200 with ok: false: the call was made and billed, and that refusal is its answer.
resultobject
The tool's own JSON answer, already parsed — not a string to parse a second time.
Show child attributes8
okboolean
webhook_idnumber
workspace_idnumber
event_typestring
urlstring
channelstring
slack | claude | api — read off the URL's host.
secretstring
The HMAC signing secret — generated if one was not given.
enabledboolean
duration_msinteger
Server-side wall time for the call.
Responses
200The tool ran. Read ok to see whether it succeeded.
401Missing or invalid API key.
Example input
curl -X POST 'https://docsbook.io/api/v1/register_webhook_traffic_spike' \
  -H 'Authorization: Bearer dbk_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{}'
Example output
{
  "ok": true,
  "result": {
    "ok": true,
    "webhook_id": 0,
    "workspace_id": 0,
    "event_type": "<event_type>",
    "url": "<url>",
    "channel": "<channel>",
    "secret": "<secret>",
    "enabled": true
  },
  "duration_ms": 0
}

Mis à jour

Cette page vous a-t-elle été utile ?