Browse docs

Webhooks

Last updated

Instead of polling, subscribe a URL and we POST to it when something happens. Webhooks are available on paid API plans; the free tier returns 402.

Events

NameTypeDescription
unlock.upcomingeventAn unlock matching your filters is due within hours_before (formerly upcoming_unlock, which still works).
unlock.largeeventAny unlock worth $1M or more is due within hours_before.
lock.createdeventA new vesting or lock schedule was picked up.
lock.cancelledeventA sender cancelled a schedule early (Sablier).

Create a subscription

POST /webhooks
curl -X POST https://www.vestream.io/api/v1/webhooks \
  -H "Authorization: Bearer vstr_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/vestream-hook",
    "events": ["unlock.large", "lock.cancelled"],
    "hours_before": 24
  }'
NameTypeDescription
urlrequiredstringPublic HTTPS URL we POST to.
eventsrequiredstring[]Any of unlock.upcoming, unlock.large, lock.created, lock.cancelled.
hours_beforenumberHow far ahead to fire, 1 to 168 hours.
wallet_filter, protocol_filter, chain_filteroptionalNarrow which events fire this subscription (wallet = the recipient).

The response includes a signing secret (whsec_…) once. Store it: you need it to verify deliveries. GET /webhooks lists your subscriptions and DELETE /webhooks/{id} removes one.

Payload

POST to your URL
X-Vestream-Event: unlock.upcoming
X-Vestream-Signature: sha256=<hex>

{
  "event": "unlock.upcoming",
  "subscription": "…",
  "delivered_at": "2026-11-30T14:00:00.000Z",
  "data": {
    "group_key": "…",
    "protocol": "sablier",
    "chain_id": 1,
    "token_symbol": "VEST",
    "token_address": "0x…",
    "end_time": 1764547200,
    "amount": "…",
    "wallet_count": 1,
    "stream_count": 1,
    "first_recipient": "0x3f5c…8b2e"
  }
}

Verify the signature

Node.js
import crypto from "node:crypto";

function isFromVestream(rawBody, header, secret) {
  const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(header), Buffer.from(expected));
}

Note

Compute the HMAC over the raw request body, before any JSON parsing. Subscriptions that keep failing are disabled; re-create them once your endpoint is healthy.