← All modules
platform

Webhooks

Live

Outgoing webhook delivery with signed payloads, retries, and delivery history.

event.type === "webhook" modules/webhooks
Overview

What Webhooks does

Webhooks stores outgoing destinations, signs every payload, and records each delivery attempt with response metadata. It gives modules a common delivery lane for Slack, CI, and customer-owned HTTP endpoints.

Retries are explicit records instead of invisible background work. Delivery history is searchable, secrets can rotate without losing old attempts, and operators have one place to inspect failed notifications.

Wire payload

Same shape, three syntaxes

The wire protocol is plain HTTP, plain JSON, HMAC-SHA256. The TypeScript tab uses the SDK; the cURL tab is the raw HTTP equivalent; the Python tab shows the preview SDK shape.

import { createCuittyClient } from "@cuitty/sdk";
import { webhooksPlugin } from "@cuitty/sdk/plugins/webhooks";

const cuitty = createCuittyClient({
  portalUrl: "https://app.cuitty.com",
  projectId: process.env.CUITTY_PROJECT_ID!,
  apiKey: process.env.CUITTY_API_KEY!,
});
cuitty.use(webhooksPlugin());
cuitty.start();

await cuitty.emit({
  type: "webhook",
  timestamp: new Date().toISOString(),
  data: {
    endpointId: "wh_01",
    eventType: "budget.exceeded",
    payload: { projectId: "proj_01", amountUsd: 420 },
  },
});
Storage

Database schema

Excerpt from modules/webhooks/schema.sql. One libSQL file per module — back it up with cp.

CREATE TABLE cuitty_webhooks.deliveries (
  id BIGSERIAL PRIMARY KEY,
  endpoint_id BIGINT NOT NULL,
  event_type TEXT NOT NULL,
  status TEXT NOT NULL,
  attempt INTEGER NOT NULL DEFAULT 1,
  response_status INTEGER,
  ts BIGINT NOT NULL
);

Related modules