Skip to content
Bloomcount API
Esc
navigateopen⌘Jpreview

Subscribe a URL to event deliveries

Registers a URL to receive event deliveries. The response carries a secret (whsec_...) — store it now, it is shown once and never returned again. Losing it means deleting the subscription and creating another.

The URL must be HTTPS, must not carry credentials, and must resolve to a public host: a URL that fails those checks is refused rather than silently never delivering.

Verifying deliveries. Every POST to your URL carries three headers:

  • X-Bloomcount-Signature — hex HMAC-SHA256 of the raw request body, keyed with your whsec_ secret.
  • X-Bloomcount-Event — the delivery type, matching one of the types you subscribed to.
  • X-Bloomcount-Timestamp — unix seconds at the moment of sending.

Recompute the HMAC over the body exactly as received, before any JSON parsing or re-serialising, and compare in constant time. Reject anything that doesn’t match.

Retries. A failed delivery is retried up to 3 times with 5s / 30s / 2min backoff, and each attempt times out after 10s. Deliveries are at-least-once, so make your handler idempotent — the event ID in the body is the natural key.

Errors

  • 422 url_must_be_https — the URL isn’t HTTPS.
  • 422 url_invalid — the URL doesn’t parse.
  • 422 url_host_not_allowed — a private, local or otherwise disallowed host.
  • 422 url_port_not_allowed — a non-standard port.
  • 422 url_credentials_not_allowed — the URL embeds a username or password.
  • 422 at_least_one_event_requiredevents is empty.
POST/api/v1/webhooks
Authorization
AuthorizationBearer token (bloomcount_...) · headerrequired
Request body
requiredapplication/json
urlstring<uri>required
HTTPS URL to receive deliveries.
eventsstring[]required
Which delivery types this subscription receives. Pass at least one. - `event.created` — fires when an event is first created. - `event.updated` — fires on every subsequent scalar field change. Item-level edits do not trigger it.
min items 1
Responses
201Subscribed
idstringrequired
Subscription ID.
secretstringrequired
HMAC secret. Shown once — store it.
401Missing or invalid API key, or revoked / expired.
errorstringrequired
403Authenticated, but the key lacks the required scope or the tenant has no API access.
errorstringrequired
422Request body or arguments failed validation.
errorstringrequired
429Per-minute rate limit (60/min) or per-month cap exceeded.
errorstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST "https://app.bloomcount.com/api/v1/webhooks" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://example.com/hooks/petals",
  "events": [
    "event.created",
    "event.updated"
  ]
}'
Response
{
  "id": "whsub_88h3k4l5m6n7p8q9r0s1t2u",
  "secret": "whsec_d0162ac5ec7be4f8018bb43ef9a2f7ffdf7fa2bde1dbc0b1"
}