Skip to main content
BitsWeave
Guides

Ingest anything with the Webhook broker

Install the generic Webhook broker, POST JSON to your per-install URL with a bearer secret — from curl, Zapier, or Make — then map events to records.

The Webhook broker is the generic inbound connector: any HTTP client that can POST JSON — a curl one-liner, Zapier, Make, a CI job, a bespoke script — can push events into BitsWeave. Each install gets its own URL and a bearer secret; payloads land as broker messages, show up on the context graph, and can be routed or mapped to records like any other broker's events.

Org admins

Installing a broker needs the admin role (broker:write). One install per broker per org.

Install

Start the install

Open /app/brokers/webhook and start the install — or over MCP, brokers_installations_startInstall with { "definitionId": "webhook" }. The install form has two optional fields:

  • Display name — a human-readable label for this installation.
  • Bearer secret — bring your own (at least 16 characters), or leave blank and a fresh 256-bit secret is generated for you.

Copy the secret — it's shown exactly once

Completing the install returns two things:

  • The webhook URL — shaped https://bitsweave.com/api/webhooks/<install-id>. Each install gets its own; you can re-read it later on the broker detail page.
  • The bearer secret — shown once, then stored encrypted server-side and never retrievable again. Copy it into your sender's Authorization header. If you lose it, uninstall and reinstall to mint a new one.

The contract

POST JSON to your install URL, authenticating with the secret as a bearer token:

POST /api/webhooks/<install-id>
Authorization: Bearer <secret>
Content-Type: application/json

The event type — the routing key each message is recorded under — resolves in order:

  1. the X-Webhook-Event request header, else
  2. an event string field on the JSON body, else
  3. the literal default event.

Responses:

StatusMeaning
200Stored — { "ok": true, "brokerMessageId": "…" }. An identical body replayed within an hour adds "deduplicated": true.
400The body isn't valid JSON.
401Missing or wrong bearer secret.
404Unknown install id in the URL.
413Body over the 1 MiB cap.

There is no payload schema — the broker accepts arbitrary JSON. Raw messages are retained for 7 days; the events they produce live on in the graph.

Recipe: curl

Replace the two placeholders and send:

BITSWEAVE_WEBHOOK_URL='https://bitsweave.com/api/webhooks/YOUR-INSTALL-ID'
BITSWEAVE_WEBHOOK_SECRET='YOUR-BEARER-SECRET'

curl -X POST "$BITSWEAVE_WEBHOOK_URL" \
  -H "Authorization: Bearer $BITSWEAVE_WEBHOOK_SECRET" \
  -H 'Content-Type: application/json' \
  -H 'X-Webhook-Event: deploy.finished' \
  -d '{"service": "storefront", "version": "1.42.0", "status": "success"}'

A 200 with {"ok":true,"brokerMessageId":"…"} means the event is stored and visible under the installation's messages.

Recipe: Zapier

Use the Webhooks by Zapier action with the Custom Request event:

  1. MethodPOST.
  2. URL — your install URL (https://bitsweave.com/api/webhooks/YOUR-INSTALL-ID).
  3. Data — the JSON body, mapping in fields from earlier Zap steps, e.g. {"event": "lead.created", "email": "{{email}}", "plan": "{{plan}}"}.
  4. Headers — add three rows:
    • AuthorizationBearer YOUR-BEARER-SECRET
    • Content-Typeapplication/json
    • X-Webhook-Eventlead.created (or rely on the event body field)

The simpler POST event works too: set Payload Type to json, put your fields under Data, and add the same Authorization and X-Webhook-Event headers.

Recipe: Make

Use the HTTP app's Make a request module:

  • URL — your install URL.
  • MethodPOST.
  • HeadersAuthorization: Bearer YOUR-BEARER-SECRET and optionally X-Webhook-Event: order.updated.
  • Body typeRaw; Content typeJSON (application/json).
  • Request content — the JSON payload, mapping in fields from earlier modules, e.g. {"event": "order.updated", "orderId": "{{orderId}}"}.

Map events to records

Once events flow in, you can project them into custom records instead of leaving them as raw messages. With schema inference enabled, BitsWeave observes a message schema per (broker, event type) — every JSON path it has seen. A broker→record mapper wires that message schema to a record schema, one field line per sourcePath → targetFieldKey:

  • In the UI, a record schema's detail page (/app/records/<schema-key>) lists its mappers; edit one at /app/records/mappers/<mapper-id> — toggle it and manage its field lines.
  • Over MCP, use brokers_recordMappings_create / _update / _list (they need record:write / record:read).

Creating an enabled mapper backfills history: existing messages for that event type are projected into records without waiting for the next webhook. From there, routing rules can also send the same events to an agent's inbox.

On this page