# Hooks — full documentation > Hooks is a webhook gateway for AI agents and automation: one stable HTTPS ingress per endpoint verifies signatures, stores the raw payload, filters and reshapes events, then fans them out asynchronously to HTTP or agent targets with retries and a replayable delivery log. This file concatenates every documentation page in order. Each section is also published as its own Markdown file under https://hooks.events/docs/. Generated from `apps/web/public/docs/*.md` by `pnpm --filter web llms:build`. Do not edit by hand. # Quickstart Hooks receives webhooks on a stable HTTPS ingress URL, verifies the signature, stores the raw request, and forwards the event to one or more destinations. Most integrations are live in under five minutes. 1. **Create an endpoint.** Pick a provider (GitHub, Stripe, Slack, Linear, or generic HMAC) and copy its ingestion URL. 2. **Verify the signature.** Confirm the request really came from the source before trusting the payload. 3. **Add a destination.** Forward verified events to an HTTPS endpoint or an agent target. ## Send a test event POST JSON to the endpoint's ingestion URL. Endpoints in the default verification mode accept unsigned requests: ```bash BODY='{"type":"order.created","data":{"id":"ord_1042"}}' curl -X POST "https://api.hooks.events/in/whk_9f3k1a" \ -H "Content-Type: application/json" \ -d "$BODY" ``` Hooks stores the event immediately and returns `202 Accepted`; fan-out to destinations happens asynchronously in a queue. ### HMAC-signed endpoints If the endpoint's verification mode is `hmac`, sign each request with the endpoint's secret: ```bash # Replace the endpoint URL and secret with your own values. URL="https://api.hooks.events/in/whk_9f3k1a" SECRET="" BODY='{"type":"order.created","data":{"id":"ord_1042"}}' T=$(date +%s) ID=$(uuidgen | tr 'A-Z' 'a-z') SIG=$(printf '%s.%s.%s' "$T" "$ID" "$BODY" \ | openssl dgst -sha256 -hmac "$SECRET" -hex \ | awk '{print $NF}') curl -X POST "$URL" \ -H "Content-Type: application/json" \ -H "x-hooks-timestamp: $T" \ -H "x-hooks-delivery: $ID" \ -H "x-hooks-signature: $SIG" \ -d "$BODY" ``` The signature is the lowercase hex HMAC-SHA256 of `$timestamp.$deliveryId.$body`, keyed with the endpoint secret. Timestamps older than five minutes are rejected, so generate `$T` right before sending; a tampered body or a wrong secret fails with `401`. ## What happens next - Every delivery attempt is recorded with its request, response status, and response body. - Failed deliveries retry automatically with exponential backoff. - You can replay an event or retry a delivery from the console or the REST API. > The ingestion URL is a secret. Anyone with it can create events, so keep it out of client-side code and public repositories. ## Next steps - [Receive events](./receive-events.md) — headers, accepted content types, response behavior. - [Verify signatures](./signatures.md) — HMAC scheme and provider-specific verification. - [Destinations](./destinations.md) — where verified events go. --- # Receive events Hooks accepts JSON and form-encoded payloads over HTTPS. It records the raw body and headers before applying verification rules, so you can inspect exactly what arrived. ## Request headers | Header | Description | | ------------------- | ----------------------------------------------------------------------------- | | `X-Hooks-Signature` | Timestamp and HMAC signature for the raw body. Verify this before processing. | | `X-Hooks-Event` | Unique event ID, useful for logging and support. | | `X-Hooks-Delivery` | Unique delivery ID. Reuse it as an idempotency key at your destination. | | `Content-Type` | `application/json` or `application/x-www-form-urlencoded`. | Provider-specific headers are preserved on the event as well, for example `X-GitHub-Event`, `Stripe-Signature`, or `Linear-Delivery`. ## Response behavior Hooks returns `202` as soon as the event is persisted. It does not wait for downstream services. - `202 Accepted` — the event was stored and queued for fan-out. - `4xx` — the request was rejected and no event was created. Check the endpoint's verification rules and signature configuration. - `429` — the endpoint's ingest rate limit was exceeded. Honor `Retry-After`. > Use the raw request body when computing signatures. Re-serializing JSON can change whitespace and key order, producing a false mismatch. ## Inbound authentication Set `verificationMode` on the endpoint to match what your sender can produce. All three shared-credential modes compare in constant time. ### API key in a header Use `shared-secret` with `sourceConfig.secretHeader`: ```json { "verificationMode": "shared-secret", "sourceConfig": { "secretHeader": "x-api-key" } } ``` The sender includes `x-api-key: `. The default header is `x-webhook-token` when `secretHeader` is omitted. Header values are redacted from stored event headers and the console. ### API key in a query parameter Low-code tools that cannot set headers can put the key in the URL instead: ```json { "verificationMode": "shared-secret", "sourceConfig": { "secretLocation": "query", "secretParam": "token" } } ``` The sender calls `https://hooks.events/in/?token=`. `secretParam` defaults to `token`. Hooks reads the parameter before storing the event and never writes it to the event record, so it does not appear in the console or API payloads. ### Basic Auth Use `basic` with the password stored as the endpoint secret and the username in config: ```json { "verificationMode": "basic", "secret": "", "sourceConfig": { "basicUsername": "acme" } } ``` The sender sends `Authorization: Basic base64("acme:")`. Wrong or missing credentials return `401` with `WWW-Authenticate: Basic realm="Hooks"`. ### HMAC signing Use `hmac` when the sender can sign each request with the endpoint secret: ```json { "verificationMode": "hmac", "secret": "" } ``` The sender sends `x-hooks-timestamp`, `x-hooks-delivery`, and `x-hooks-signature` — the lowercase hex HMAC-SHA256 of `..`, keyed with the secret. Requests older than five minutes, tampered bodies, and wrong secrets all return `401`. The full signing script is in [Verify signatures](./signatures.md#generic-inbound-hmac-mode). Provider endpoints (`github`, `stripe`, …) keep their native signature schemes; these modes are for generic endpoints. ## Body handling - JSON bodies are parsed and stored as structured data. - `application/x-www-form-urlencoded` bodies are parsed into fields; a GitHub-style `payload=` field is unpacked into the embedded JSON. - Any other body is stored as text and is not normalized into structured fields. ## Bookmarks and replay An event stays queryable only until the workspace retention window ends. To keep one payload longer, open the event and choose **Save bookmark**: Hooks copies the raw body and inbound headers into the bookmark, so the copy is independent of the event and survives cleanup. - Replay a bookmark from **Bookmarks** in the console or with `POST /v1/bookmarks/{id}/replay` and a `destinationId`. Any active destination in the workspace is a valid target. - Replays go through the normal pipeline: signing, retries, transforms, filters and lifecycle hooks all apply. - Rename and delete bookmarks from the console; deleting removes the saved payload too. - The number of bookmarks per workspace is capped by the plan. See [Limits](./limits.md). --- Every event follows the same path: ingest, verify, persist, fan out, retry. Each step is observable in the console and through the API. 1. **Ingest** — the source sends an HTTPS request to the endpoint's ingestion URL. 2. **Verify** — the provider adapter checks the signature, timestamp, and any source-specific rules. 3. **Persist** — the raw body, sanitized headers, and normalized event are stored before responding `202`. 4. **Fan out** — the event is queued once per active destination. 5. **Deliver** — the target adapter sends the request and records the outcome; failures are retried with backoff. ## Delivery guarantees - **At-least-once delivery.** A destination may receive the same event more than once, especially after a timeout. Deduplicate with `X-Hooks-Delivery`. - **Automatic retries are bounded.** The default target retries a failed delivery up to 5 attempts (1–10 configurable per destination). A retryable failure with no attempts left becomes `dead`; a permanent failure becomes `failed` immediately. See [Retries & idempotency](./retries.md). - **Ordering is not guaranteed.** Each destination is retried independently. Use event timestamps if order matters to your system. - **Paused endpoints stop new deliveries.** Events still arrive and are stored, but fan-out waits until the endpoint is resumed. ## What we do not guarantee - **Exactly-once processing.** No HTTP delivery can promise it. A retry after a lost response can run your handler twice; deduplicate with `X-Hooks-Delivery` or another idempotency key. - **Ordering between events.** Retries and parallel destinations reorder events. - **Unbounded retention.** Events, deliveries, attempts and payloads are deleted after the plan's retention window (7 days Free, 30 days Pro, 60 days Scale). A delivery that is still retrying, or data that has aged out, cannot be replayed after deletion. - **Uptime or delivery SLA on self-serve plans.** The service is provided as-is; any service-level commitment needs a separate written contract. The [status page](https://hooks.events/status) publishes no uptime percentage because no public probe data exists yet. The hard numbers behind these statements live on [Limits](/limits/): body size, retention by plan, retry attempts and delays, destination timeout, and quotas. ## Filters and templates - Destination filters run at fan-out time. A rejected destination gets no delivery row, while the event stays stored for the audit trail. - Templates reshape the payload per delivery without a proxy. ## Related - [Retries & idempotency](./retries.md) - [Destinations](./destinations.md) - [Payload templates](./templates.md) --- # Endpoints An endpoint is an ingestion URL plus verification and routing rules. Create one per source, not per destination — that keeps retries and logs easy to reason about. ## Create from the console 1. Open **Endpoints** and choose **Create endpoint**. 2. Pick a provider so Hooks pre-fills the right signature header. 3. Copy the ingestion URL into the provider's webhook settings. 4. Add at least one destination and send a test event. ## Endpoint fields | Field | Notes | | ---------------- | --------------------------------------------------------------------------------------------------------- | | `name` | Human-readable label shown in logs and alerts. | | `provider` | Preset for signature verification and event headers: `generic`, `github`, `stripe`, `slack`, or `linear`. | | `signing_secret` | Generated on creation. Rotate it from endpoint settings. | | `status` | `active` or `paused`. Paused endpoints keep receiving events. | ## Ingestion URL ``` https://api.hooks.events/in/{endpoint-public-id} ``` The public id is stable for the life of the endpoint. Treat the URL as a secret: anyone with it can create events. ## Providers | Provider | Signature header | Notes | | --------- | --------------------- | ---------------------------------------------------------------------- | | `generic` | `X-Hooks-Signature` | Timestamp + HMAC over the raw body. | | `github` | `X-Hub-Signature-256` | HMAC-SHA256 over the raw body. | | `stripe` | `Stripe-Signature` | `t=...,v1=...` with a 5-minute tolerance. | | `slack` | `X-Slack-Signature` | `v0=` HMAC over `v0::`. | | `linear` | `Linear-Signature` | Hex HMAC over the raw body plus a 60-second `webhookTimestamp` window. | ## Test events Queue a synthetic event instead of sending traffic through the public ingress: ```bash curl -X POST "https://api.hooks.events/v1/endpoints/$ENDPOINT_ID/test-events" \ -H "Authorization: Bearer $HOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"eventType":"agent.check"}' ``` --- # Destinations Destinations are where verified events go. Add several to one endpoint when different systems need the same event — each gets its own retry schedule and delivery history. ## Destination types | Type | Status | Description | | --------------------------- | --------- | -------------------------------------------------------- | | HTTPS endpoint (`http`) | Supported | JSON or form body, custom headers, bearer or basic auth. | | Grok Bot (`grokbot`) | Supported | Dispatch the event to a Grok Bot agent. | | Slack (`slack`) | Supported | Post to an incoming webhook or `chat.postMessage`. | | Feishu / Lark (`feishu`) | Supported | Post text to a custom group bot, optionally signed. | | DingTalk (`dingtalk`) | Supported | Post text to a custom robot, optionally signed. | | WeCom (`wecom`) | Supported | Post text or markdown to a WeCom group bot. | | Telegram (`telegram`) | Supported | Send a Bot API `sendMessage`, optional parse mode. | | Microsoft Teams (`teams`) | Supported | Post a MessageCard to an incoming webhook. | | Discord (`discord`) | Supported | Post content or embeds to an incoming webhook. | | Google Chat (`google-chat`) | Supported | Post text or cards v2 to an incoming webhook. | | LINE (`line`) | Supported | Send a Messaging API push message. | | Mattermost (`mattermost`) | Supported | Post to a self-hosted incoming webhook. | | Rocket.Chat (`rocketchat`) | Supported | Post to a self-hosted incoming webhook. | | WhatsApp (`whatsapp`) | Supported | Send a Cloud API template or text message. | | T3 Code (`t3code`) | Supported | Trigger a scheduled task (webhook automation). | | Paseo (`paseo`) | Supported | Dispatch a Hub manual run (agent run id recorded). | ## Add a destination ```bash curl -X POST "https://api.hooks.events/v1/endpoints/ep_7a3k2/destinations" \ -H "Authorization: Bearer $HOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://api.acme.com/hooks/orders", "method": "POST", "auth": { "type": "bearer", "token": "$DOWNSTREAM_TOKEN" } }' ``` ## Feishu / Lark group bot A `feishu` destination posts a text message to a custom group bot (自定义群机器人). The bot URL (`https://open.feishu.cn/open-apis/bot/v2/hook/`, or `https://open.larksuite.com/...` for international) is a credential, so store it in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.FEISHU_WEBHOOK_URL}}", "text": "New {{event.type}}: {{event.subject.title}}\n{{event.subject.url}}", "signature": { "secret": "{{secret.FEISHU_SIGN_SECRET}}" } } ``` - `text` uses the same template engine as other targets, so event fields and filters work as usual. - `signature` is optional; include it when the bot's signature check (加签) is enabled. Hooks sends `timestamp` and `sign = Base64(HMAC-SHA256(key = "\n", message = ""))` with the message. - A failed call can still be HTTP 200 with a non-zero business `code`; hooks treats that as a failure and records the Feishu code and message. - The webhook URL and signature secret are redacted from previews and delivery records. ## DingTalk group bot A `dingtalk` destination posts a text message to a custom robot (自定义机器人). The bot URL (`https://oapi.dingtalk.com/robot/send?access_token=`) carries the access token, so store the whole URL in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.DINGTALK_WEBHOOK_URL}}", "text": "New {{event.type}}: {{event.subject.title}}\n{{event.subject.url}}", "signature": { "secret": "{{secret.DINGTALK_SIGN_SECRET}}" } } ``` - `text` uses the same template engine as other targets, so event fields and filters work as usual. - `signature` is optional; include it when the robot's signature check (加签) is enabled. Hooks appends a millisecond `timestamp` and `sign = URL-encode(Base64(HMAC-SHA256(key = , message = "\n")))` to the URL query. - A failed call can still be HTTP 200 with a non-zero business `errcode`; hooks treats that as a failure and records the DingTalk code and message. Rate limiting (`130101`) is retried. - The webhook URL, access token and signature secret are redacted from previews and delivery records. ## WeCom group bot A `wecom` destination posts a text or markdown message to a WeCom (企业微信) group bot (群机器人). The bot URL (`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=`) carries the key, so store the whole URL in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.WECOM_WEBHOOK_URL}}", "mode": "markdown", "markdown": "**{{event.subject.title}}**\n[Open]({{event.subject.url}})" } ``` - `mode` is `text` (default) or `markdown`; `markdown` must be set when the mode is `markdown`. - `text` and `markdown` use the same template engine as other targets, so event fields and filters work as usual. - A failed call can still be HTTP 200 with a non-zero business `errcode`; hooks treats that as a failure, records the code and WeCom's `errmsg`, and retries the rate-limit codes `45009` / `45033`. - The webhook URL and key are redacted from previews and delivery records. ## Telegram bot A `telegram` destination calls the Telegram Bot API `sendMessage`. The bot token is a credential and lives in the request path (`https://api.telegram.org/bot/sendMessage`), so store it in a project secret and reference it from the config: ```json { "token": "{{secret.TELEGRAM_BOT_TOKEN}}", "chatId": "-1001234567890", "text": "New {{event.type}}: {{event.subject.title}}\n{{event.subject.url}}", "parseMode": "HTML" } ``` - `chatId` is a template too, so one bot can route different events to different chats. - `parseMode` is optional (`HTML` or `MarkdownV2`); the rendered text must already be escaped for it. - A failed call can still be HTTP 200 with `ok: false`; hooks treats that as a failure and records Telegram's `error_code` and `description`. Rate limits (`429` + `retry_after`) are retried. - The bot token is redacted from previews and delivery records. ## Microsoft Teams incoming webhook A `teams` destination posts a MessageCard to a Teams incoming webhook (Office 365 Connector or Workflows). The webhook URL is a credential, so store the whole URL in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.TEAMS_WEBHOOK_URL}}", "title": "New {{event.type}}: {{event.subject.title}}", "text": "{{event.subject.url}}", "themeColor": "0076D7" } ``` - `title` and `text` use the same template engine as other targets; `themeColor` is optional six hex digits. - Accepted hosts are `*.webhook.office.com`, `*.logic.azure.com` and `*.environment.api.powerplatform.com`; other hosts are rejected before sending. - Non-2xx responses are failures, and a JSON error body's `message` is appended to the recorded reason. - The webhook URL is redacted from previews and delivery records. ## Discord incoming webhook A `discord` destination posts to a Discord Incoming Webhook (`https://discord.com/api/webhooks//`). The URL carries the token, so store the whole URL in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.DISCORD_WEBHOOK_URL}}", "content": "New {{event.type}}: {{event.subject.title}}", "embeds": "{\"title\":\"{{event.subject.title}}\",\"url\":\"{{event.subject.url}}\"}" } ``` - `content` uses the same template engine as other targets; `embeds` is optional JSON (one object or an array of up to ten) rendered as a template. - Success is `204` (or `200` with `?wait=true`); 429 with `retry_after` is retried, and other non-2xx responses record Discord's `message` as the reason. - The webhook URL and token are redacted from previews and delivery records. ## Google Chat incoming webhook A `google-chat` destination posts to a Google Chat Incoming Webhook (`https://chat.googleapis.com/v1/spaces//messages?key=…&token=…`). The URL carries the key and token, so store the whole URL in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.GOOGLE_CHAT_WEBHOOK_URL}}", "text": "New {{event.type}}: {{event.subject.title}}\n{{event.subject.url}}", "cardsV2": "[{\"cardId\":\"issue\",\"card\":{\"header\":{\"title\":\"{{event.subject.title}}\"}}}]" } ``` - `text` uses the same template engine as other targets; `cardsV2` is optional JSON (one `{cardId, card}` object or an array of up to ten) rendered as a template. - Success is `200`; 429 with `Retry-After` is retried, and other non-2xx responses record Google's `error.message` as the reason. A 2xx body that still carries an `error` object is treated as a failure. - The webhook URL and its key/token are redacted from previews and delivery records. ## LINE Messaging API A `line` destination sends a **Push Message** through the LINE Messaging API. The channel access token is a credential, so store it in a project secret and reference it from the config: ```json { "channelAccessToken": "{{secret.LINE_CHANNEL_ACCESS_TOKEN}}", "to": "U1234567890abcdef", "text": "New {{event.type}}: {{event.subject.title}}\n{{event.subject.url}}" } ``` - `to` is the recipient id (`U…` user, `C…` group, `R…` room) and is a template; `text` uses the same template engine as other targets. - The request goes to `POST https://api.line.me/v2/bot/message/push` with `Authorization: Bearer `, never with the token in the URL. Only text messages are supported for now. - Success is `200`; `429` is retried (`LINE_RATE_LIMITED`), and other non-2xx responses record LINE's `message` as the reason. - The channel access token is redacted from previews and delivery records. ## Mattermost incoming webhook A `mattermost` destination posts to a self-hosted Mattermost incoming webhook. The webhook URL embeds the key, so store the whole URL in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.MATTERMOST_WEBHOOK_URL}}", "username": "hooks-bot", "channel": "alerts", "text": "New {{event.type}}: {{event.subject.title}}\n{{event.subject.url}}" } ``` - `webhookUrl` must be a `{{secret.NAME}}` reference; a literal URL is rejected at save time. - `text` is Mattermost Markdown rendered with the template engine and defaults to the event title and URL. - `username` and `channel` are optional server-side overrides; the Mattermost server must allow username overrides. - Success is `200` with a plain-text `ok`. Non-2xx responses fail (or retry on `408`/`425`/`429`/`5xx`) and record Mattermost's plain-text or JSON reason. - The webhook URL is redacted from previews and delivery records; attempts only keep the stored destination host. ## Rocket.Chat incoming webhook A `rocketchat` destination posts to a self-hosted Rocket.Chat incoming webhook. The webhook URL embeds the integration id and token, so store the whole URL in a project secret and reference it from the config: ```json { "webhookUrl": "{{secret.ROCKETCHAT_WEBHOOK_URL}}", "channel": "#alerts", "alias": "hooks-bot", "text": "New {{event.type}}: {{event.subject.title}}\n{{event.subject.url}}" } ``` - `webhookUrl` must be a `{{secret.NAME}}` reference; a literal URL is rejected at save time. - `text` is Markdown rendered with the template engine and defaults to the event title and URL. - `channel` overrides the room (room id, `#channel-name` or `@username`); `alias` overrides the display alias. - Success is `200` with `{"success":true}`. A 2xx body with `success:false` or a per-room `responses` error fails (`ROCKETCHAT_ERROR` / `ROCKETCHAT_ROOM_ERROR`); non-2xx responses fail or retry on `408`/`425`/`429`/`5xx` and record Rocket.Chat's reason. - The webhook URL is redacted from previews and delivery records; attempts only keep the stored destination host. ## WhatsApp Cloud API A `whatsapp` destination sends a message through the WhatsApp Cloud API, which is served by Meta's Graph API. The access token is a credential, so store it in a project secret and reference it from the config: ```json { "accessToken": "{{secret.WHATSAPP_ACCESS_TOKEN}}", "phoneNumberId": "109876543210987", "to": "+15551234567", "templateName": "order_update", "languageCode": "en_US", "templateParameters": ["{{event.subject.title}}", "{{event.subject.url}}"] } ``` - `mode` defaults to `template`; set it to `text` to send `{"type":"text","text":{"body":"…"}}` instead. Production notifications normally need an approved template (free-form text only works inside an open 24-hour window). - `phoneNumberId` is the numeric Cloud API sender id; `version` defaults to `v23.0`. - `to` is the recipient number in E.164 form and is a template; it must render to digits, otherwise the delivery fails with `INVALID_WHATSAPP_RECIPIENT`. `templateParameters` and `text` use the same template engine as other targets. - The request goes to `POST https://graph.facebook.com///messages` with `Authorization: Bearer `, never with the token in the URL. - Success is `200`; `429` and Graph error codes `131048`/`131056` are retried (`WHATSAPP_RATE_LIMITED`), transient Graph errors are retried (`WHATSAPP_TRANSIENT_ERROR`), and other non-2xx responses record Meta's `error.message` as the reason. A 2xx body that still carries an `error` object is a failure. - The access token is redacted from previews and delivery records. ## Filters A destination can accept only some events: ```json { "allow": [ { "field": "event.type", "op": "equals", "value": "issues.opened" }, { "field": "event.subject.labels", "op": "contains", "value": "agent" } ] } ``` Rules support `equals`, `not_equals`, `in`, `contains`, `matches`, and `exists` on fields such as `event.type`, `event.source`, `event.actor.login`, `event.repo`, `event.project`, and `event.subject.*`. Bot actors are ignored by default; set `ignoreBots: false` to include them. > Inbound secrets and cookies are never forwarded. Configure a separate outbound credential for each destination. --- # Payload templates Reshape an event before it reaches a destination without writing a proxy. Templates render per delivery and can mix normalized event fields, raw payload paths, headers, and constants. ## Variables | Variable | Resolves to | | ------------------------------ | --------------------------------------------------------------- | | `{{event.id}}` | Relay event ID. | | `{{event.type}}` | Unified event type, for example `issues.opened`. | | `{{event.source}}` | Source id: `github`, `stripe`, `slack`, `linear`, or `generic`. | | `{{event.actor.login}}` | Actor login/handle. | | `{{event.subject.title}}` | Subject title. | | `{{event.subject.labels.0}}` | Array index into subject labels. | | `{{event.raw.issue.html_url}}` | Any path in the original parsed payload. | | `{{event.payload}}` | Raw inbound body text. | | `{{delivery.id}}` | Delivery ID, safe to use as an idempotency key. | ## Filters | Filter | Example | Result | | ---------- | -------------------------------------------- | ---------------------------------- | | `default` | `{{event.actor.login \| default:"unknown"}}` | Fallback when the path is missing. | | `truncate` | `{{event.subject.title \| truncate:60}}` | First 60 characters. | | `join` | `{{event.subject.labels \| join:", "}}` | Joins arrays. | Missing variables resolve to an empty string by default. Strict mode turns a missing path into a failed delivery with the missing paths named, which is useful while building a template. ## JSON bodies When the destination body is JSON, resolved values are escaped so a title containing quotes or newlines stays valid JSON. Templates apply to the body, URL, headers, query parameters, and auth values. > Use a test event before enabling a template in production. --- # Transformations A destination can run a small JavaScript function before its declarative template. The transform receives the normalized event and returns either a replacement object for `{{event.*}}`, a replacement string for `{{event.payload}}`, or a skip instruction that filters the delivery. ```js function transform(event) { return { task: event.subject.title, repo: event.repo, labels: (event.subject.labels ?? []).join(", "), }; } ``` The transform is stored on the destination (`transform`) and runs per delivery, before filters are applied. It cannot reach the network, environment variables, secrets or the filesystem. ## Choosing between transforms and templates - **Declarative templates** ([payload templates](/templates/)) render the outbound body, URL, headers and auth. They are the right tool when the change is a field mapping or a format string. - **Transforms** run arbitrary JavaScript over the event object. Use them for recursion (flattening, PII stripping), computed values, or conditional routing that the template syntax cannot express. - Both can be combined: the transform runs first, then the template renders against the transformed event. ## Returning a value | Return value | Effect | | ------------------------ | ---------------------------------------------------------------- | | An object | Replaces the normalized event that `{{event.}}` reads | | A string | Replaces the inbound payload text that `{{event.payload}}` reads | | `null` / `undefined` | Keeps the event unchanged and the payload as received | | `{ skip: true, reason }` | Stops the delivery and records it as `filtered` with that reason | Returning an invalid value (for example a number or a function) fails the delivery with `TRANSFORM_INVALID_OUTPUT`. ## Limits The platform enforces these budgets; exceeding one fails the delivery with the listed code. See [limits](/limits/) for the full platform table. | Limit | Value | Error code | | ----------------- | ----------------- | ----------------------------------------------------------- | | Script length | 20,000 characters | Rejected when saving (`VALIDATION_ERROR`) | | CPU time | 50 ms | `TRANSFORM_TIMEOUT` | | Heap | 16 MiB | `TRANSFORM_MEMORY_LIMIT` | | Output size | 256 KiB | `TRANSFORM_OUTPUT_TOO_LARGE` | | Compile errors | — | `TRANSFORM_INVALID_SCRIPT` | | Runtime exception | — | `TRANSFORM_SCRIPT_ERROR` with the first line of the message | A transform failure is treated like a permanent destination failure: the delivery is `failed`, not retried, because the same script would fail the same way. Fix the script and replay the event. A skip is not a failure; the delivery is `filtered`. ## Ready-made examples The console transform editor has **Start from a template**. Choosing one inserts the script and runs it against the sample event; the result appears in the dry-run output. The same scripts are listed below. ### Stripe payment → Slack message ```js function transform(event) { const subject = event.subject || {}; const amount = typeof subject.amount === "number" ? subject.amount / 100 : null; const currency = (subject.currency || "usd").toUpperCase(); const state = subject.state || "updated"; return { text: state + ": " + (subject.title || "payment") + (amount === null ? "" : " — " + amount.toFixed(2) + " " + currency) + (subject.customer ? " (customer " + subject.customer + ")" : ""), }; } ``` ### GitHub issue → Linear issue ```js function transform(event) { const subject = event.subject || {}; const actor = event.actor || {}; return { action: event.action || "create", data: { title: subject.title || "Untitled issue", description: (subject.body || "") + "\n\n" + (subject.url || ""), teamKey: event.repo || "ENG", labels: subject.labels || [], creator: actor.login || "unknown", }, }; } ``` ### Flatten nested JSON ```js function transform(event) { const out = {}; function walk(value, prefix) { if (value && typeof value === "object") { for (const key of Object.keys(value)) { walk(value[key], prefix ? prefix + "." + key : key); } return; } out[prefix] = value; } walk(event, ""); return out; } ``` ### Remove PII fields ```js function transform(event) { const blocked = /^(email|e-mail|phone|mobile|name|fullName|firstName|lastName|address)$/i; function clean(value) { if (Array.isArray(value)) return value.map(clean); if (value && typeof value === "object") { const out = {}; for (const key of Object.keys(value)) { if (!blocked.test(key)) out[key] = clean(value[key]); } return out; } return value; } return clean(event); } ``` ### Pick a field subset ```js function transform(event) { const PATHS = ["id", "type", "source", "subject.title", "subject.url", "actor.login"]; const out = {}; for (const path of PATHS) { let value = event; for (const part of path.split(".")) { value = value == null ? undefined : value[part]; } if (value !== undefined) out[path] = value; } return out; } ``` ### Rename fields, route by type, truncate strings The library also ships rename, route-by-type, truncate, labels-as-text, minor-units-to-decimal and skip-test-events examples. They follow the same shape: read `event`, return a new object, never mutate shared state. ## Debugging - The destination builder's **Transform** tab runs the script against the built-in sample event or any stored event, and shows the transform input, output, skip reason or error code. - After saving, the delivery log records the transform outcome per attempt. A failed transform shows `TRANSFORM_SCRIPT_ERROR` (or the limit code) and the first line of the exception. - Save-time validation only compiles the script; runtime errors depend on the event shape. Guard optional fields with `??` or `||` defaults. - Transforms are gated by the deployment's `JS_TRANSFORM_ENABLED` flag. When it is off, saving a transform returns `VALIDATION_ERROR`. ## Related - [Payload templates](/templates/) — the declarative renderer the transform feeds. - [Destinations](/destinations/) — where the transform field lives. - [Limits](/limits/) — CPU, memory, output and script-size ceilings. - [Retries and idempotency](/retries/) — replaying a failed delivery after fixing a script. --- # Verify signatures Outbound deliveries can be signed with the workspace **signing secret** (Settings → Security). Each destination chooses one of two formats: | Format | Default for | Headers | | ------------------- | --------------------- | ------------------------------------------------------------ | | `standard-webhooks` | New destinations | `webhook-id`, `webhook-timestamp`, `webhook-signature` | | `hooks` | Existing destinations | `x-hooks-timestamp`, `x-hooks-delivery`, `x-hooks-signature` | Change the format per destination in the console (Auth tab → **Workspace signature format**) or with `PATCH /v1/destinations/{id}` and `{"signingFormat": "hooks"}`. Destinations that set their own signature header are never signed. ## Standard Webhooks (recommended) Hooks follows the [Standard Webhooks specification](https://github.com/standard-webhooks/standard-webhooks), the same scheme used by Svix. The signature is: ```text v1,..")> ``` - `webhook-id` — the delivery ID, stable across retries. - `webhook-timestamp` — Unix seconds. Reject requests older than five minutes. - `webhook-signature` — one or more space-separated `v1,` signatures. During secret rotation Hooks sends both the new and the previous signature; accept a request when any signature matches. The signing secret starts with `whsec_`; the remainder is base64. Use the official library so secret decoding and constant-time comparison match the spec. ```js // npm install standardwebhooks import { Webhook } from "standardwebhooks"; const webhook = new Webhook(process.env.HOOKS_SIGNING_SECRET); export function verify(rawBody, headers) { // Throws WebhookVerificationError on a bad signature or stale timestamp. return webhook.verify(rawBody, headers); } ``` ```python # pip install standardwebhooks from standardwebhooks import Webhook webhook = Webhook(os.environ["HOOKS_SIGNING_SECRET"]) def verify(raw_body: bytes, headers: dict[str, str]): # Raises WebhookVerificationError on a bad signature or stale timestamp. return webhook.verify(raw_body, headers) ``` Pass the raw request body bytes. Re-serializing JSON can change whitespace or key order and break the signature. ## Legacy `hooks` format Existing destinations keep the original headers: - `x-hooks-timestamp` — Unix seconds. - `x-hooks-delivery` — the delivery ID. - `x-hooks-signature` — lowercase hex HMAC-SHA256 of `..`, using the workspace secret string as the key. ```js const crypto = require("node:crypto"); function verify(rawBody, headers, secret) { const timestamp = headers["x-hooks-timestamp"]; const deliveryId = headers["x-hooks-delivery"]; const expected = crypto .createHmac("sha256", secret) .update(`${timestamp}.${deliveryId}.${rawBody}`) .digest("hex"); const received = Buffer.from(headers["x-hooks-signature"] ?? "", "hex"); return ( received.length === expected.length / 2 && crypto.timingSafeEqual(received, Buffer.from(expected, "hex")) ); } ``` Reject timestamps more than five minutes old to limit replay attacks. ## Rotating the workspace secret 1. **Rotate** in Settings → Security. Standard Webhooks destinations now receive two `v1,` signatures: the new secret first, the previous secret after it. Legacy destinations receive only the new signature. 2. **Deploy the new secret** to your verifiers. Accepting both signatures means no deliveries fail during the transition. 3. **Finish rotation** in Settings → Security (or `POST /v1/project/secret/rotate/complete`). The previous signature stops immediately; make sure every verifier knows the new secret first. The secret is non-sensitive to display but write-only in the API: reads return it only to the workspace owner, and audit logs never record it. ## Generic inbound HMAC mode A generic endpoint with verification mode `hmac` requires three headers on every request: | Header | Content | | ------------------- | --------------------------------------------------------------------------------------------------- | | `x-hooks-timestamp` | Unix seconds, when the sender signed the request. | | `x-hooks-delivery` | A unique delivery ID, used to deduplicate retries. | | `x-hooks-signature` | Lowercase hex HMAC-SHA256 of `..`, keyed with the endpoint secret. | The header names and formula match the legacy `hooks` outbound format above, so the same verify function works in both directions. Requests whose timestamp is older than five minutes are rejected, as are tampered bodies and wrong secrets — all with `401`. ```bash # Replace the endpoint URL and secret with your own values. URL="https://api.hooks.events/in/whk_9f3k1a" SECRET="" BODY='{"type":"order.created","data":{"id":"ord_1042"}}' T=$(date +%s) ID=$(uuidgen | tr 'A-Z' 'a-z') SIG=$(printf '%s.%s.%s' "$T" "$ID" "$BODY" \ | openssl dgst -sha256 -hmac "$SECRET" -hex \ | awk '{print $NF}') curl -X POST "$URL" \ -H "Content-Type: application/json" \ -H "x-hooks-timestamp: $T" \ -H "x-hooks-delivery: $ID" \ -H "x-hooks-signature: $SIG" \ -d "$BODY" ``` Set the mode when creating the endpoint (inbound auth: HMAC) or later with `PATCH /v1/endpoints/{id}` and `{"verificationMode": "hmac"}`. The [quickstart](./quickstart.md) walks through the first event. ## Provider-specific inbound schemes When an endpoint uses a known provider, Hooks verifies the provider's own signature before accepting the event: | Provider | Header | Scheme | | -------- | --------------------- | ------------------------------------------------------------------------------------ | | `github` | `X-Hub-Signature-256` | `sha256=`. | | `stripe` | `Stripe-Signature` | `t=,v1=.">`, 5-minute tolerance, multiple `v1` accepted. | | `slack` | `X-Slack-Signature` | `v0=:">`, 5-minute tolerance. | | `linear` | `Linear-Signature` | Hex HMAC of the raw body plus a body `webhookTimestamp` within 60 seconds. | Provider signatures are checked against the endpoint secret you configured in the console. Standard Webhooks sends the same scheme, so the `standard-webhooks` source adapter accepts it with `webhook-*` headers. Generic endpoints can instead use a shared API key in a header or query parameter, or Basic Auth. See [inbound authentication](./receive-events.md#inbound-authentication). > Never compare signatures with `==`. Use a constant-time function and reject requests whose timestamp is more than five minutes old. --- # Secrets, variables & environments Store credentials as **secrets** and non-sensitive configuration as **variables**. Both are resolved per environment, so the same endpoint or task can target production in one binding and staging in another. ## Model - A **secret** is encrypted at rest, write-only, and referenced by name. There is no API that returns its value. - A **variable** is plaintext by design and returned by the API. Names that look like credentials (`TOKEN`, `KEY`, `PASSWORD`, …) get a `warning` on create; move those values to secrets. - An **environment** is a named scope inside a workspace. Every workspace starts with the default `production` environment (max 10 environments). A secret or variable row with `environmentId: null` is the project-level default; a row bound to an environment overrides it. ## Reference syntax ```json { "headers": { "x-api-key": "{{secret.API_TOKEN}}" }, "auth": { "mode": "bearer", "token": "{{secret.API_TOKEN}}" } } ``` - `{{secret.NAME}}` — resolves an encrypted secret. Names match `^[A-Z][A-Z0-9_]{0,63}$`; lowercase in a secret reference is not a secret (it belongs to the payload template engine). - `{{var.NAME}}` — resolves a plaintext variable with the same name rules. Where each is available: | Context | `{{secret.NAME}}` | `{{var.NAME}}` | | ---------------------------- | ----------------------------------------------- | -------------- | | Destination URL | No (URLs are recorded; use a variable for host) | Yes | | Destination headers / query | Yes | Yes | | Destination auth | Yes | Yes | | Destination adapter config | Yes | Yes | | Destination body template | No — bodies never depend on stored credentials | Yes | | Task step `with` (any field) | Yes | Yes | Both resolve before the outbound request is built. A missing reference fails the delivery with `OUTBOUND_REQUEST_BLOCKED` (`Secret resolution failed: Missing secret: NAME` or `Variable resolution failed: Missing variable: NAME`); a literal `{{secret.X}}` is never sent. ## Resolution order Resolution happens in two steps: 1. **Choose the environment.** - Deliveries: a one-off test event (`environmentId` on `test-events` / preview) wins over the endpoint's `environmentId` binding; no binding means the default environment. - Tasks: a run-level `environmentId` override wins over the task's binding; no binding means the default environment. - Replays and retries run through the same pipeline, so they use the endpoint's **current** binding. - If a bound environment was deleted, delivery falls back to the default rather than failing on stale metadata. 2. **Resolve each name inside that environment.** An environment-scoped row wins over the project-level row of the same name. If the chosen environment has no override, the project-level value applies. Example: with `API_TOKEN=prod-…` unbound and `API_TOKEN=staging-…` bound to `staging`, an endpoint bound to `staging` resolves `staging-…`; the same endpoint moved back to the default resolves `prod-…`. ## Ending a workspace Environment bindings live on the endpoint row (`environmentId`, null = default) and on the task row. Use `PATCH /v1/endpoints/{id}` or `PATCH /v1/tasks/{name}` with `environmentId` to change them. `GET /v1/environments` shows binding counts, and `GET /v1/environments/{id}/resolved` lists which secret names come from the environment versus the project default (secret values are never included). Only workspace owners and admins may create, replace or delete secrets and variables; members get `403 AUTHORIZATION_DENIED`. Reads use the `endpoints:read` scope, writes the `endpoints:write` scope. Audit entries record the action, actor and resource id — never a value. ## Secret rotation Each endpoint also has its own signing secret. Treat it like a password and rotate it without downtime: 1. **Add the new secret** to your verifier and accept both old and new signatures. 2. **Rotate in Hooks** from the endpoint's security settings, or call `POST /v1/endpoints/{id}/rotate-secret`. 3. **Wait for in-flight retries** to finish, then remove the old secret from your verifier. Secrets are encrypted at rest and never displayed in full after creation. If a secret leaks, rotate immediately and review delivery logs for unexpected destinations or replay attempts. --- Failed deliveries retry automatically with exponential backoff. Retries use the same delivery ID, so your destination can safely deduplicate them. ## Default retry schedule Each destination can override the policy field by field; agent targets ship different defaults. | Target | Max attempts | Initial delay | Max delay | Backoff | | -------------------------------------------- | ------------ | ------------- | --------- | ------------------------ | | `http` (generic), `slack` | 5 | 2s | 300s | exponential, ±20% jitter | | `grokbot`, `t3code`, `paseo` (agent targets) | 3 | 15s | 120s | exponential, ±20% jitter | For the generic HTTP default, attempts run at roughly: | Attempt | Timing | | ------- | ------------------------------------------------ | | 1 | Immediately after fan-out. | | 2 | About 2 seconds later, after a timeout or `5xx`. | | 3 | About 4 seconds after attempt 2. | | 4 | About 8 seconds after attempt 3. | | 5 | About 16 seconds after attempt 4, then `dead`. | Delays double each attempt and are capped at the policy's max delay (300s by default). Jitter is ±20%, so these are approximate. `Retry-After` is honored for `429` and `503` responses and capped at 15 minutes. A destination `retryPolicy` can change `maxAttempts` (1–10), backoff, initial delay and max delay within the ranges on [Limits](/limits/). When a retryable failure runs out of attempts the delivery becomes `dead` (a dead letter); a permanent failure (`4xx` other than `408`, `425` and `429`) becomes `failed` immediately. Both are terminal, both can be retried manually, and a manual retry grants one extra attempt. Dead-letter email is off by default; enable it under **Settings → Workspace → Dead-letter email**. ## Deduplicate at the destination Store `X-Hooks-Delivery` in a unique index before processing. If the same ID arrives again, return `200` without repeating side effects. A `2xx` response stops retries immediately. Rate limits and timeouts also trigger retries. Return a `4xx` only when retrying cannot help — for example, a malformed payload or an unknown account. ## Manual retry and replay - `POST /v1/deliveries/{id}/retry` re-queues a failed or stuck delivery. - `POST /v1/events/{id}/replay` replays an event to its destinations. - `POST /v1/deliveries/{id}/cancel` cancels a queued delivery. - `POST /v1/deliveries/bulk-cancel` cancels every pending, queued or retrying delivery that matches a filter. ## Bulk cancel queued deliveries When a destination is misconfigured, queued deliveries pile up. Bulk cancel clears them without touching deliveries that already succeeded or failed. ```bash # Preview: count matches, create nothing curl -X POST "https://api.hooks.events/v1/deliveries/bulk-cancel" \ -H "Authorization: Bearer $HOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"filters":{"destinationId":"dst_123","status":"retry_wait"},"dryRun":true}' # Start the job curl -X POST "https://api.hooks.events/v1/deliveries/bulk-cancel" \ -H "Authorization: Bearer $HOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"filters":{"destinationId":"dst_123"}}' ``` Filters accept `destinationId`, `endpointId`, `status` (one of `pending`, `queued`, `retry_wait`), `since` and `until` (ISO 8601, applied to the delivery creation time). With no `status`, every cancellable status matches. Only those three statuses can ever be cancelled; `delivering`, `succeeded`, `failed` and `dead` deliveries are left alone. The response is a job with `total` and `cancelled`. Read progress with `GET /v1/deliveries/bulk-cancel/{id}`; the job reaches `completed` when nothing matching is left. `POST /v1/deliveries/bulk-cancel/{id}/cancel` stops a running job — batches already in flight finish, later batches are dropped. The console exposes the same flow through the **Cancel queued** button on the Deliveries page, which scopes the job to the filters currently selected there. Only replay events when the destination state is known to be safe; a replay creates new delivery attempts against the same destinations. --- # Rate limits and request quota Two independent limits protect the platform and keep delivery latency predictable. For body size, retention, retry and timeout ceilings, see [limits](/limits/). ## Per-IP request limits These limit how fast a single caller can send requests. They apply to the caller's IP prefix (or API key prefix for `/v1/*`), reset on a rolling window, and protect the service from floods. They are not tied to your plan. | Operation | Limit | Window | | ----------------------------------------- | -------------- | ---------- | | Ingest events (`/in/*`) | 1,000 requests | 60 seconds | | Read and write API (`/v1/*`) | 600 requests | 60 seconds | | Manual retries (`/v1/deliveries/*/retry`) | 60 requests | 60 seconds | Every API response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset`. When a per-IP limit is exceeded, the API returns `429` with a `Retry-After` header. ## Workspace request quota The quota is shared by every endpoint in a workspace and counts inbound `POST /in/:publicId` requests that are accepted and stored. | Plan | Requests | Resets | | ---- | ------------------------ | -------------------------------- | | Free | 1,000 | Never (lifetime grant) | | Pro | 10,000 per prepaid block | Never; buy more blocks to top up | What counts: | Outcome | Billed | | ----------------------------------------------- | --------- | | Accepted and stored | 1 request | | Filtered by a source filter or destination rule | 0 | | Duplicate delivery (same source delivery ID) | 0 | | Invalid signature | 0 | | Rejected by a rate limit or the quota itself | 0 | | Delivery retries after acceptance | 0 | | Manual replay of an accepted event | 0 | | Each destination after the first three | +0.25 | | Each 64 KiB of payload after the first 64 KiB | +1 | Surcharge units are fractional while in flight and accumulate against the same balance; a period's usage is rounded to whole requests when it is persisted. The pricing page's replay allowance (10% of accepted volume free, then +0.5 per replay) is published accounting: the runtime does not currently block or bill replays, and replays never consume workspace quota. `/t/*` (anonymous try playground) and `/inspect/*` use the per-IP limits only and never consume workspace quota. ### When the quota is exhausted Inbound requests return `429` and are not stored: ```json { "error": "quota_exceeded", "plan": "free", "upgrade_url": "https://hooks.events/settings?tab=billing", "message": "Free plan request limit reached. Upgrade to Pro to keep receiving events." } ``` The response carries `X-Quota-Limit` and `X-Quota-Remaining`. An exhausted prepaid balance keeps the same shape with `plan: "pro"` and `message: "Prepaid request quota reached. Buy more blocks to keep receiving events."`. Neither the Free grant nor prepaid blocks reset, so the response has no `Retry-After`: buy more blocks to lift the limit immediately. The denied request is rejected before it is stored, so it cannot be replayed later — recovery is resending (the source's own retries, if it is still inside its retry window) rather than waiting. Current usage is available from `GET /v1/billing/usage`; the console reads the same values on the billing page. Respect `Retry-After` instead of retrying immediately. Sources that retry on `429` keep events flowing once the window resets; events rejected with `429` are not stored. --- # Limits This page lists the limits the current server enforces. Values come from `packages/api/src/plans.ts`, the ingest and delivery services, and the transform runtime; pricing copy reads the same plan constants. ## Platform hard limits These limits apply to every workspace. Most are configurable per destination within the stated range. | Area | Limit | When exceeded | | ----------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | | Inbound request body | 1 MiB platform ceiling; Free 64 KiB, Pro and Scale 1 MiB effective | `413 payload_too_large`; nothing is stored | | Per-endpoint inbound rate | Optional `rateLimitPerMinute` (1–100,000); action `store` or `drop` | `429 RATE_LIMIT_EXCEEDED` with `Retry-After`; `store` keeps a `rate_limited` event for triage | | API request rate | 600/min per API key prefix (or IP for sessions) | `429` with `Retry-After` | | Ingest request rate | 1,000/min per IP + ASN | `429` with `Retry-After`; event not stored | | Manual retry rate | 60/min per caller | `429` with `Retry-After` | | MCP request rate | 600/min per API key prefix | `429` with `Retry-After` | | Inspector rate | 120/min for `/inspect/*`, 240/min for `/t/*` | `429` with `Retry-After` | | Sign-up / auth rate | 5/hour for sign-up (IP + ASN), 30/min for other auth routes | `429` with `Retry-After` | | Destination timeout | 100 ms–30 s; default 10 s | Attempt fails with a timeout error and retries if attempts remain | | Retry attempts | 1–10; default 5 (agent targets default 3) | Last failure becomes `dead` (retryable failure) or `failed` (permanent failure) | | Retry delay | 1–60 s initial; default 2 s (agent targets 15 s); max 5–3,600 s | Delay is capped at the max; jitter defaults to ±20% | | Outbound rate per destination | 600/min and 10 concurrent; agent targets 30/min and 3 | Delivery is deferred to a later window, not dropped | | JS transform script | 20,000 characters | `TRANSFORM_INVALID_SCRIPT`; delivery fails permanently | | JS transform runtime | 50 ms CPU, 16 MiB heap, 256 KiB output | `TRANSFORM_TIMEOUT`, `TRANSFORM_MEMORY_LIMIT` or `TRANSFORM_OUTPUT_TOO_LARGE` | | Captured request / response | Request 16 KiB; response 64 KiB | Longer bodies are truncated in the attempt log, never rejected | | List pagination | 100 rows max; REST default 20, MCP default 50 | `limit` above 100 returns `400 VALIDATION_ERROR` | | Event search | `q` 200 characters; `filter` 500 characters, 8 path levels | `400 VALIDATION_ERROR`; only inline payloads are searched | | Uploads (task files) | 5 MiB per file | `413 PAYLOAD_TOO_LARGE` | | Temporary inspector | 256 KiB per request, 50 requests, 24-hour session | `413`, `INSPECT_DESTINATION_LIMIT`, or `INSPECT_SESSION_EXPIRED` | Retry policy precedence: destination `retryPolicy` overrides the target adapter defaults, which override the platform defaults. Retries cover network errors, timeouts, `408`, `425`, `429` and `5xx`; other `4xx` responses fail permanently. When a retryable failure runs out of attempts the delivery is `dead`, so it can still be retried or replayed; a permanent failure is `failed`. ## Limits by plan | Limit | Free | Pro | Scale | | ---------------------------- | --------------------------- | ------------------------ | --------------- | | Accepted requests | 1,000 lifetime per identity | 10,000 per prepaid block | Contract volume | | Event retention | 7 days | 30 days | 60 days | | Endpoints | 3 | Unlimited | Unlimited | | Destinations per endpoint | 2 | Unlimited | Unlimited | | Bookmarks | 20 | Unlimited | Unlimited | | Members including owner | 1 | 5 | 25 | | Max inbound body (effective) | 64 KiB | 1 MiB | 1 MiB¹ | ¹ The plan definition allows 5 MiB on Scale, but the Worker currently enforces a 1 MiB ingress ceiling for every plan. Larger Scale bodies need the platform ceiling raised in a deployment. The request quota is shared by all endpoints in a workspace and counts only accepted inbound events. Filtered, duplicate, rejected and retried requests are free. See [rate limits](/rate-limits/) for the billable-unit table, including extra destinations and extra payload blocks. ## What happens at the boundary ### Oversized bodies The body is rejected before it is stored: ```json { "error": "payload_too_large", "plan": "free", "limit_bytes": 65536, "message": "Free requests are limited to 65536 bytes. Upgrade to Pro for up to 1048576 bytes.", "upgrade_url": "https://hooks.events/settings?tab=billing" } ``` The status is `413`; no event, delivery or billable request is created. Free responses include an upgrade link; paid workspaces receive `Body exceeds bytes.` ### Request quota exhausted Inbound requests return `429` with error `quota_exceeded` and are not stored. There is no `Retry-After`, because neither the Free lifetime grant nor prepaid blocks reset; buy more blocks to restore service. The response carries `X-Quota-Limit` and `X-Quota-Remaining`. An exhausted prepaid balance uses the same body with `plan: "pro"` and `message: "Prepaid request quota reached. Buy more blocks to keep receiving events."`. ### Per-IP rate limits Rate-limit responses use `429 RATE_LIMIT_EXCEEDED`, carry `Retry-After`, and include `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` on every response. Events rejected this way are not stored. See [rate limits](/rate-limits/) for the caller key and window details. ### Plan limits Plan limits are checked when resources are created, not on read. Exceeding one returns `409 PLAN_LIMIT_EXCEEDED` with the limit and resource in the message. A workspace that downgrades keeps its existing endpoints, destinations and members but cannot add more until it is back under the limit. ### Retention Events, deliveries, attempts and stored payloads are deleted after the plan's retention window. Filtered and duplicate events are kept for 7 days regardless of plan, because they carry no delivery history. Cleanup runs on the one-minute cron; after a row ages out it cannot be recovered by replay. ## Recovering from a prepaid quota exhaustion A quota-denied request is rejected before it is stored, so there is no event to replay later — recovery is not "wait and replay"; the sender must resend. Two cases: - **The source is still inside its retry window** (most providers retry `429`/`5xx` for up to 24–72 hours): buy blocks and the source's own retries are accepted normally. - **The retry window has passed**: the source gave up, so replay the source's history yourself (e.g. re-dispatch from the provider's dashboard or API) — Hooks never received those requests and cannot reconstruct them. Accepted events and their deliveries are unaffected: they keep retrying, and replays of accepted events stay available within retention. See [rate limits](/rate-limits/) for the exhaustion response shape. ## Service availability Hooks does not publish an uptime percentage or a self-serve SLA. The [status page](https://hooks.events/status) lists the components we would monitor, the planned probe method, frequency, observation window and statistical basis, and states explicitly when no probe data exists. Per-workspace delivery success rate and latency are measured and available in the console or from `GET /v1/metrics` for up to 90 days. The [terms](https://hooks.events/legal) provide the service as-is; any service-level commitment must be agreed in a separate written contract. ## Related - [Rate limits](/rate-limits/) — caller keys, windows and headers. - [Rate limits](/rate-limits/) — what counts as a request and how prepaid blocks work. - [Retries and idempotency](/retries/) — retry schedule and delivery semantics. - [Destinations](/destinations/) — per-destination timeout, retry policy and outbound limits. --- # REST API The API uses predictable resource URLs, JSON bodies, and bearer authentication. All requests must use HTTPS. - Base URL: `https://api.hooks.events/v1` - Authentication: `Authorization: Bearer hks_...` - Scopes: `endpoints:read`, `endpoints:write`, `deliveries:read`, `deliveries:retry`, `history:purge`, `metrics:read`, `alerts:read`, `alerts:write`, `mcp:write`. - Session-authenticated requests can select a workspace with `X-Workspace-Id: `. Reads fall back to the caller's own workspace when the id no longer belongs to them (stale `localStorage`); mutating requests return `403 AUTHORIZATION_DENIED` instead of silently writing elsewhere. - Mutating requests with a body must send `Content-Type: application/json`. ## Routes The table below is generated from `GET /openapi.json`; do not edit it by hand. The same document is the OpenAPI 3.1 source for the hosted API reference. | Method | Path | Purpose | | ----------------------- | ----------------------------------------------- | ------------------------------------------------------------------------- | | GET | `/v1/whoami` | Read the authenticated user and workspace | | GET | `/v1/audit-log` | List configuration audit entries | | GET | `/v1/capabilities` | Read deployment capabilities | | GET, POST | `/v1/applications` | List applications | | GET, PATCH, DELETE | `/v1/applications/{id}` | Read one application | | GET | `/v1/applications/{id}/secret` | Reveal the application signing secret | | POST | `/v1/applications/{id}/secret/rotate` | Rotate the application signing secret | | GET, POST | `/v1/applications/{id}/portal-tokens` | List portal tokens | | DELETE | `/v1/applications/{id}/portal-tokens/{tokenId}` | Revoke a portal token | | GET, POST | `/v1/applications/{id}/messages` | List messages sent to an application | | GET, POST | `/v1/endpoints` | List endpoints | | GET, PATCH, DELETE | `/v1/endpoints/{id}` | Read one endpoint | | POST | `/v1/endpoints/{id}/rotate-secret` | Start signing-secret rotation | | POST | `/v1/endpoints/{id}/rotate-secret/complete` | Complete signing-secret rotation | | POST | `/v1/endpoints/{id}/events` | Publish an event over the API | | POST | `/v1/endpoints/{id}/test-events` | Queue a test event | | GET, POST | `/v1/endpoints/{id}/destinations` | List an endpoint's destinations | | GET | `/v1/targets` | List target adapters | | GET, PATCH, DELETE | `/v1/destinations/{id}` | Read one destination | | POST | `/v1/destinations/{id}/test` | Send a test delivery to a destination | | POST | `/v1/destinations/{id}/test-connection` | Send one real request to a saved destination without recording a delivery | | POST | `/v1/destinations/{id}/test-task` | Render a destination request without sending it | | POST | `/v1/destinations/preview` | Preview a rendered destination request | | POST | `/v1/destinations/filter-preview` | Test destination filters against a payload | | GET | `/v1/issues` | List aggregated destination issues | | GET, PATCH | `/v1/issues/{id}` | Read an aggregated destination issue | | POST | `/v1/issues/{id}/retry` | Replay up to 100 failed deliveries associated with an issue | | GET, DELETE | `/v1/events` | List events | | GET | `/v1/events/{id}` | Read one event | | GET | `/v1/events/{id}/payload` | Read the stored raw payload | | POST | `/v1/events/{id}/replay` | Replay an event to its destinations | | GET, POST | `/v1/bookmarks` | List saved event payloads | | GET | `/v1/bookmarks/destinations` | List destinations a bookmark can be replayed to | | PATCH, DELETE | `/v1/bookmarks/{id}` | Rename a bookmark | | POST | `/v1/bookmarks/{id}/replay` | Replay a bookmark to one destination | | GET, DELETE | `/v1/deliveries` | List delivery attempts | | GET | `/v1/deliveries/{id}` | Read one delivery | | GET | `/v1/deliveries/{id}/attempts` | List a delivery's attempts | | POST | `/v1/deliveries/{id}/retry` | Retry a delivery | | POST | `/v1/deliveries/{id}/cancel` | Cancel a queued delivery | | POST | `/v1/deliveries/bulk-cancel` | Preview or start a bulk cancel of pending deliveries | | GET | `/v1/deliveries/bulk-cancel/{id}` | Read a bulk cancel job | | POST | `/v1/deliveries/bulk-cancel/{id}/cancel` | Cancel a running bulk cancel job | | POST | `/v1/replays` | Start a bulk replay | | GET | `/v1/replays/{id}` | Read a replay job | | POST | `/v1/replays/{id}/{action}` | Pause, resume or cancel a replay job | | GET | `/v1/runs/{runId}` | Read an agent run linked to a delivery | | GET, POST | `/v1/api-keys` | List API keys | | DELETE | `/v1/api-keys/{id}` | Revoke an API key | | GET, POST | `/v1/workspaces` | List workspaces | | DELETE | `/v1/workspaces/{id}` | Delete a workspace | | GET, POST | `/v1/environments` | List environments | | GET | `/v1/environments/{id}/resolved` | Read effective secrets and variables for an environment | | DELETE | `/v1/environments/{id}` | Delete an environment | | GET, POST | `/v1/secrets` | List secret metadata | | GET, PATCH, DELETE | `/v1/secrets/{id}` | Read secret metadata | | POST | `/v1/secrets/migrate` | Migrate project secrets into an environment | | GET, POST | `/v1/variables` | List variables | | PATCH, DELETE | `/v1/variables/{id}` | Update a variable | | GET, PATCH | `/v1/project` | Read the current workspace | | GET | `/v1/project/secret` | Read project secret metadata | | POST | `/v1/project/secret/rotate` | Rotate the project secret | | POST | `/v1/project/secret/rotate/complete` | Finish project secret rotation | | GET | `/v1/members` | List workspace members | | PATCH, DELETE | `/v1/members/{userId}` | Change a member's role | | POST | `/v1/invitations` | Invite a teammate | | DELETE | `/v1/invitations/{id}` | Revoke an invitation | | POST | `/v1/invitations/accept` | Accept an invitation | | GET, POST | `/v1/event-types` | List registered event types | | GET, PATCH | `/v1/event-types/{id}` | Read one registered event type | | GET, POST | `/v1/transformations` | List shared transformations | | POST | `/v1/transformations/run` | Trial-run a transformation | | GET, PATCH, DELETE | `/v1/transformations/{id}` | Read one shared transformation | | GET, POST | `/v1/templates` | List built-in and project templates | | GET, PATCH, DELETE | `/v1/templates/{id}` | Read one source→target template | | POST | `/v1/templates/{id}/apply` | Apply a template | | GET | `/v1/stats` | Read workspace delivery statistics | | GET | `/v1/metrics` | Read delivery metrics | | GET | `/v1/funnel/summary` | Read the activation funnel summary | | GET | `/v1/metrics/prometheus` | Scrape metrics in Prometheus text format | | GET | `/v1/billing/usage` | Read plan, prepaid balance and remaining allowance | | POST | `/v1/billing/checkout` | Open a Stripe Checkout session | | POST | `/v1/billing/portal` | Open the Stripe Customer Portal | | GET, POST | `/v1/tasks` | List automation tasks | | GET | `/v1/tasks/summary` | Read task summary counts | | GET | `/v1/tasks/templates` | List task templates | | GET | `/v1/tasks/catalog` | List source and target catalog entries | | POST | `/v1/tasks/dry-run` | Dry-run a task definition | | POST | `/v1/tasks/validate` | Validate a task definition | | GET, PATCH, PUT, DELETE | `/v1/tasks/{name}` | Read one automation task | | GET, POST | `/v1/tasks/runs` | List task runs | | GET | `/v1/tasks/runs/{runId}` | Read a task run | | POST | `/v1/tasks/runs/{runId}/cancel` | Cancel a task run | | POST | `/v1/tasks/runs/{runId}/complete` | Mark a task run complete | | POST | `/v1/tasks/runs/{runId}/rerun` | Rerun a task run | | GET | `/v1/tasks/{engineId}/runs` | List runs for an engine-owned task | | GET | `/v1/tasks/{engineId}/runs/{runId}` | Read an engine-owned task run | | POST | `/v1/tasks/{engineId}/runs/{runId}/cancel` | Cancel an engine-owned task run | | GET, POST | `/v1/alerts/rules` | List alert rules | | PATCH, DELETE | `/v1/alerts/rules/{id}` | Update an alert rule | | GET | `/v1/alerts/events` | List recorded alerts | | GET, POST | `/v1/cli/tokens` | List CLI tokens | | DELETE | `/v1/cli/tokens/{id}` | Revoke a CLI token | | GET | `/v1/cli/events` | Poll events for the CLI relay | | GET | `/v1/cli/events/{id}` | Read one event for the CLI relay | | GET | `/v1/cli/listen` | Open the CLI relay stream | | POST | `/v1/cli/deliveries` | Report a relayed delivery result | | POST | `/v1/uploads` | Store an attachment | List endpoints are paginated with `?limit=20&cursor=...`. The default page size is 20 and the maximum is 100; pass `nextCursor` back as `cursor` to fetch the next page. ## Searching events `GET /v1/events` accepts two content filters on top of `endpointId`, `status`, and cursor pagination: - `q` matches a substring in the inline payload or request headers (max 200 characters). - `filter` matches a field path: `body.=` or `headers.=`, up to 8 levels deep. Values compare as text, so `body.amount=100` matches both `100` and `"100"`. Quote values containing spaces: `headers.x-label="needs review"`. ```bash curl -H "Authorization: Bearer $HOOKS_API_KEY" \ "https://api.hooks.events/v1/events?q=ORD-1042&limit=20" curl -H "Authorization: Bearer $HOOKS_API_KEY" \ "https://api.hooks.events/v1/events?filter=body.data.object.id=ch_123" ``` Both options scan stored JSON with SQLite `LIKE`/`json_extract`, so keep the result `limit` small and combine them with endpoint/status filters. Search only covers events whose payload is still stored inline; payloads moved to object storage by retention cannot be matched. A malformed field path returns `400 VALIDATION_ERROR`. ## Authentication and rate limits - API keys carry scopes. A key without the route's scope gets `403 AUTHORIZATION_DENIED`. - `/v1/*` allows 600 requests per minute per credential. Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`; over the limit you get `429 RATE_LIMIT_EXCEEDED` with `Retry-After`. - Inbound `/in/{publicId}` requests are limited per endpoint and per workspace. A Free workspace that exhausts its lifetime grant gets `429` with `x-quota-limit` and an `upgrade_url`; `/t/*` and `/inspect/*` never consume quota. ## Machine-readable contract `GET https://api.hooks.events/openapi.json` returns the OpenAPI 3.1 document that generates the table above. The sandbox callback endpoints under `/callbacks/tasks/*` are token-authenticated and intentionally excluded: they are called by run sandboxes, not by API clients. ## Environments and scoped values Every workspace starts with one default environment, `production`. Endpoints and tasks accept `environmentId` to bind to another environment; `null` or omitted means the default. Environment-scoped secrets and variables override project-level rows of the same name. - A test event (`POST /v1/endpoints/{id}/test-events`), preview, or task run may pass a one-off `environmentId`; it overrides the endpoint/task binding for that request. - Deliveries and task runs expose `environmentId`; task-run views also include `environmentName`. - `GET /v1/environments/{id}/resolved` returns `{ secrets: [{ name, source, lastUsedAt }], variables: [{ name, value, source }] }`, where `source` is `environment` or `default`. Secret values and ciphertext are never returned. - Variables are plaintext by design. A credential-looking variable name gets a `warning` on create; store credentials as secrets instead. ## Example ```bash curl "https://api.hooks.events/v1/endpoints" \ -H "Authorization: Bearer $HOOKS_API_KEY" ``` Create an API key in **Settings → API keys**. Keys are scoped and can be revoked at any time. --- # MCP server Hooks hosts a [Model Context Protocol](https://modelcontextprotocol.io) server so an AI assistant can inspect a workspace without copying REST calls by hand. The endpoint is a stateless Streamable HTTP server at: ```text https://api.hooks.events/mcp ``` Authentication uses the same Bearer API key as the REST API. The key's scopes decide which tools are visible and what each tool can read or change. ## Connect a client Create an API key in **Settings → API keys** with at least `endpoints:read` and `deliveries:read`. Keep it in an environment variable or the client's secret store; never paste it into a shared config file. ### Claude Code ```bash claude mcp add --transport http hooks https://api.hooks.events/mcp \ --header "Authorization: Bearer $HOOKS_API_KEY" ``` ### Cursor Add the server to `~/.cursor/mcp.json`: ```json { "mcpServers": { "hooks": { "url": "https://api.hooks.events/mcp", "headers": { "Authorization": "Bearer ${env:HOOKS_API_KEY}" } } } } ``` ### Generic MCP client Any client that supports Streamable HTTP can use the same URL and header: ```json { "mcpServers": { "hooks": { "type": "http", "url": "https://api.hooks.events/mcp", "headers": { "Authorization": "Bearer hks_..." } } } } ``` The server has no OAuth flow and keeps no session state, so no `Mcp-Session-Id` is issued. `POST` carries every JSON-RPC message; `GET` and `DELETE` return `405`. ## Read tools Read tools are always available and require the same scopes as the equivalent REST route. | Tool | Scope | Purpose | | ----------------- | ----------------- | ----------------------------------------------------------------- | | `list_events` | `endpoints:read` | List events, filtered by endpoint, routing status, text or field. | | `search_events` | `endpoints:read` | Free-text and `body.=` / `headers.=`. | | `get_event` | `endpoints:read` | Read one event; optionally include the raw payload. | | `list_deliveries` | `deliveries:read` | List deliveries by status, endpoint, destination or replay job. | | `get_delivery` | `deliveries:read` | Read one delivery and every recorded attempt. | | `list_issues` | `deliveries:read` | List aggregated destination failures. | | `get_issue` | `deliveries:read` | Read one aggregated issue. | | `list_endpoints` | `endpoints:read` | List non-archived (or filtered) endpoints. | | `get_endpoint` | `endpoints:read` | Read one endpoint, its source config and hooks. | | `get_metrics` | `metrics:read` | Totals, status breakdown, latency percentiles and buckets. | Every query is scoped to the API key's workspace. Cross-workspace ids return a tool error instead of data. ### Search examples Ask the assistant to run, or call directly: ```json { "name": "search_events", "arguments": { "filter": "body.order.id=1042" } } ``` ```json { "name": "search_events", "arguments": { "q": "checkout failed" } } ``` Search only covers inline payloads (up to 256 KiB). Payloads moved to object storage are not full-text indexed. ## Write tools Write tools are **off by default**. To enable them, create an API key that also carries `mcp:write`, plus the scope each tool needs: | Tool | Scopes | Purpose | | ----------------- | ------------------------------- | ---------------------------------------- | | `retry_delivery` | `deliveries:retry`, `mcp:write` | Requeue one delivery. | | `replay_event` | `deliveries:retry`, `mcp:write` | Re-derive deliveries for one event. | | `create_endpoint` | `endpoints:write`, `mcp:write` | Create an endpoint without destinations. | | `update_endpoint` | `endpoints:write`, `mcp:write` | Rename, pause, or change signing config. | Without `mcp:write`, write tools are omitted from `tools/list` and calls to them fail. Destinations and secrets are still managed through the REST API or console. ## Protocol details - Supported revisions: `2025-06-18`, `2025-03-26`, `2024-11-05`. - Transports: Streamable HTTP, `POST /mcp` with `Content-Type: application/json`. - Notifications (for example `notifications/initialized`) return `202` with an empty body. - JSON-RPC batches are rejected with `-32600`; send one message per request. - Tool failures return an MCP result with `isError: true` and a `CODE: message` text block. Protocol-level problems use standard JSON-RPC errors (`-32601` unknown method, `-32602` unknown tool or invalid params). ## Limits - MCP calls share the REST API rate limit: 600 requests per minute per key. - List tools return at most 100 rows per call and accept an opaque `cursor` for the next page. - `get_metrics` accepts the same 90-day, 2000-bucket limits as `GET /v1/metrics`. --- # Error handling Errors return a JSON body with a stable code, a human-readable message, and a request ID for support. Never parse the message; branch on the code. ```json { "error": { "code": "SIGNATURE_INVALID", "message": "The request signature did not match the endpoint secret.", "requestId": "req_8f2c9a" } } ``` ## Codes | Status | Code | Meaning | | ------ | -------------------------- | -------------------------------------------------------------------- | | 400 | `VALIDATION_ERROR` | The body or query parameters are malformed. | | 400 | `OUTBOUND_REQUEST_BLOCKED` | The destination URL is not allowed (for example, a private address). | | 400 | `REDIRECT_BLOCKED` | The destination redirected somewhere unsafe. | | 401 | `AUTHENTICATION_FAILED` | Missing or invalid API key or session. | | 401 | `SIGNATURE_INVALID` | The request signature did not match the endpoint secret. | | 403 | `AUTHORIZATION_DENIED` | The key lacks the required scope or workspace access. | | 404 | `ENDPOINT_NOT_FOUND` | The endpoint does not exist or was deleted. | | 404 | `DELIVERY_NOT_FOUND` | The delivery does not exist. | | 409 | `IDEMPOTENCY_CONFLICT` | The idempotency key was reused with a different request. | | 409 | `SLUG_TAKEN` | The workspace slug is already in use. | | 409 | `LAST_WORKSPACE` | A workspace cannot be deleted while it is the last one. | | 409 | `DELIVERY_NOT_RETRYABLE` | The delivery is in a state that cannot be retried. | | 409 | `DELIVERY_NOT_CANCELLABLE` | The delivery is already finished or in flight. | | 409 | `PLAN_LIMIT_EXCEEDED` | Creating this endpoint, destination, or member exceeds the plan. | | 410 | `ENDPOINT_DISABLED` | The endpoint is paused or archived. | | 413 | `PAYLOAD_TOO_LARGE` | The request body exceeds the endpoint limit. | | 429 | `RATE_LIMIT_EXCEEDED` | Too many requests. Honor `Retry-After`. | | 429 | `quota_exceeded` | The workspace used its plan quota on `/in/*`. See below. | | 500 | `INTERNAL_ERROR` | Unexpected server error; include the request ID when reporting. | | 500 | `DELIVERY_STUCK` | A delivery did not make progress and needs a manual retry. | | 500 | `OUTBOX_EXHAUSTED` | Fan-out retries were exhausted. | ## Ingest responses Ingest requests (`/in/*`) use the same envelope for rejections. A `202` means the event was stored; a `4xx` means it was rejected and no event exists. The plan quota uses a dedicated `429` body. It is not wrapped in `error.code`, so branch on the top-level `error` string: ```json { "error": "quota_exceeded", "plan": "free", "upgrade_url": "https://hooks.events/settings?tab=billing", "message": "Free plan request limit reached. Upgrade to Pro to keep receiving events." } ``` An exhausted prepaid balance returns the same shape with `plan: "pro"` and a different message: ```json { "error": "quota_exceeded", "plan": "pro", "upgrade_url": "https://hooks.events/settings?tab=billing", "message": "Prepaid request quota reached. Buy more blocks to keep receiving events." } ``` `X-Quota-Limit` and `X-Quota-Remaining` describe the allowance. Neither the Free lifetime credit nor prepaid blocks reset, so neither response has a `Retry-After`. A quota-denied request is not stored, so it cannot be replayed later — resend it once the workspace has headroom (or let the source's own retries do it). The per-IP `429` (`RATE_LIMIT_EXCEEDED`) is separate and does carry `Retry-After`. See [Rate limits](./rate-limits) for billing rules. --- # For AI agents Coding agents and automation should read the machine-readable summary instead of scraping the HTML docs. It lists base URLs, authentication headers, route paths, and error codes in plain text. - Machine-readable summary: [`/llms.txt`](https://hooks.events/llms.txt) - Full documentation in one file: [`/llms-full.txt`](https://hooks.events/llms-full.txt) ## Recommended flow 1. Fetch `/llms.txt`, then read the REST API section. 2. Create a dedicated API key per agent in **Settings → API keys**, and load it from an environment variable. 3. Create an endpoint, queue a test event, then poll deliveries until they succeed or fail. ```bash curl -X POST "https://api.hooks.events/v1/endpoints" \ -H "Authorization: Bearer $HOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "agent-test", "provider": "generic", "verificationMode": "hmac", "destinations": [{ "url": "https://example.com/hooks" }] }' # Queue a test event, then poll deliveries curl -X POST "https://api.hooks.events/v1/endpoints/$ENDPOINT_ID/test-events" \ -H "Authorization: Bearer $HOOKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"eventType":"agent.check"}' ``` ## MCP server Agents that speak the Model Context Protocol can skip the REST calls. Connect to `https://api.hooks.events/mcp` over Streamable HTTP with the same Bearer API key: ```bash claude mcp add --transport http hooks https://api.hooks.events/mcp \ --header "Authorization: Bearer $HOOKS_API_KEY" ``` Read tools cover events, search, deliveries, issues, endpoints and metrics. Write tools (retry delivery, replay event, create/update endpoint) stay hidden unless the key has the `mcp:write` scope. See [MCP server](./mcp.md) for the tool table and Cursor config. ## Guardrails - Never print API keys, signing secrets, or raw `Authorization` headers in logs, commits, or chat. - Prefer test events over replaying production events. - Treat the ingestion URL as a secret: anyone with it can create events. - Respect `429` responses and the `Retry-After` header instead of retrying immediately. --- Stuck on a signature, a retry, or an integration? Send the event ID and we can trace the exact delivery path. - **Email support** — replies within one business day. - **Status page** — what we monitor, what we do not publish, and how to report an incident: https://hooks.events/status - **Report a vulnerability** — encrypted reports welcome. - **Legal & privacy** — terms, data handling, and retention details: https://hooks.events/legal Include the `X-Hooks-Event` header value (or the event ID from the console) in any support request. Never include signing secrets or API keys in a report.