services
12

Webhooks

a signed HTTPS POST per finalized transaction

Each finalized transaction touching a listed address arrives at your HTTPS url as a signed POST. Dev, Business and Pro plans only. A delivered event or test costs 1 credit; failed tries and management calls are free. Caps: rate limits. Manage webhooks on the dashboard's Webhooks tab (DELIVERIES: log and test) or the API at carbium.sh with the dashboard session, Authorization: Bearer <session token> as in account and billing, or an account API key; a service key is refused.

quick start

carbium://webhooks · quickstart.sh
# 1 create: the dashboard's API, with the session token or an account API key (never a service key)curl -s https://carbium.sh/v1/webhooks -H 'Authorization: Bearer <session token>' \  -H 'Content-Type: application/json' \  -d '{"key_id":<your key_id>,"url":"https://example.com/hook","addresses":["<base58 address>"]}'# -> {"webhook":{"webhook_id":7,"status":"active",...},"secret":"whsec_..."}# the secret is shown once: store it. No 2xx within 15 s: 8 tries over about 27 hours.# 2 test, once parts 3 and 4 answer on your url: one signed event with slot 0 and "test": true, tried oncecurl -s -X POST https://carbium.sh/v1/webhooks/7/test -H 'Authorization: Bearer <session token>'# -> {"event_id":"evt_test_...","outcome":"delivered","http_status":200,"reason":"","latency_ms":102,...}// 3 receive (node, no package; save parts 3 and 4 as receive.mjs): keep the RAW body, answer 200 at once, work afterimport { createServer } from "node:http";createServer((req, res) => {  const parts = [];  req.on("data", (c) => parts.push(c)).on("end", () => {    const raw = Buffer.concat(parts);    if (!verify(process.env.WHSEC, req.headers, raw)) return res.writeHead(401).end();    res.writeHead(200).end();    for (const tx of JSON.parse(raw)) console.log(tx.test ? "test" : tx.slot, tx.transaction?.signatures[0] ?? tx.signature);  });}).listen(8080); // behind your https name on 443// 4 verify: HMAC-SHA256 of id.timestamp.body under the secret's bytesimport { createHmac, timingSafeEqual } from "node:crypto";function verify(secret, h, raw) {  if (!secret) return false;  const id = h["webhook-id"], ts = h["webhook-timestamp"];  if (!id || !(Math.abs(Date.now() / 1000 - Number(ts)) <= 300)) return false; // 5 minutes  const key = Buffer.from(secret.slice("whsec_".length), "base64");  const want = Buffer.from("v1," + createHmac("sha256", key).update(id + "." + ts + ".").update(raw).digest("base64"));  return String(h["webhook-signature"] || "").split(" ").some((s) => { const got = Buffer.from(s);    return got.length === want.length && timingSafeEqual(got, want); });}

routes

webhooks/routes
routebodyanswer
GET /v1/webhooksnoneyour webhooks, oldest first, no address lists
POST /v1/webhooksthe create fields{webhook, secret}; secret shown once
GET /v1/webhooks/{id}nonethe webhook with its addresses
PATCH /v1/webhooks/{id}any create field, statusthe webhook
DELETE /v1/webhooks/{id}none{"deleted": true}
POST /v1/webhooks/{id}/rotatenone{secret, secret_hint, previous_valid_until}; new secret shown once; old one verifies one more day
GET /v1/webhooks/{id}/deliveriesnone; ?limit= (50, at most 200), ?before= (a line's cursor, or a Unix-ms time)the log, newest first: a line per try, drop and test; kept at least 7 days
POST /v1/webhooks/{id}/testnone{event_id, ts, outcome, http_status, reason, latency_ms, refusal}: one signed test event, tried once
create fields
key_idrequireda live API key; deliveries bill under it; revoking it pauses the webhook
urlrequiredhttps, port 443, public host name (no IP), no user, password or fragment, max 2,048 characters
addressesrequiredbase58, 1 to the plan's cap; program ids count; PATCH replaces the list. Refused: System, Token, Token-2022, Associated Token, ComputeBudget and Vote programs
nameoptionalmax 48 characters
tx_statusoptional"all" (the default), "success" or "failed"
auth_headeroptionalmax 512 visible ASCII characters, sent as each delivery's Authorization header; cleared by "" on PATCH or a new url without one
statusPATCH only"paused" or "active"; "active" also re-enables a disabled webhook
$400: unknown field or wrong type (named), or over 100,000 addresses on any plan. 401: no session or valid account API key. 403: Read only account API key on a change, or a caller address off the key's list. 404: webhook or key missing, revoked, deleted or another account's. 409: reason in words: Free plan, the plan's webhook or address cap, inactive account, or a test of this webhook in flight. 503: API, sender or delivery log did not answer; retry.

delivery

webhooks/delivery
partkindwhat
webhook-idheaderevent id, same on every try; dedupe on it
webhook-timestampheaderunix seconds; refuse if over 5 minutes off
webhook-signatureheader"v1," plus base64 HMAC-SHA256 of {webhook-id}.{webhook-timestamp}.{body}, keyed with the decoded base64 after whsec_; two, space-separated, for a day after rotation
authorizationheaderyour auth_header, when set
bodyJSON arrayone transaction in getTransaction's shape: slot, blockTime (null while unknown), indexWithinBlock, transaction, meta, version; as a Helius raw webhook
over 64 KBshort formpast 65,536 bytes: slot, blockTime, indexWithinBlock, signature, err, status, truncated: true; rest via getTransaction
$Vote transactions are never sent. Lookup-table addresses count. Success: a 2xx within 15 s, from name lookup to the answer's first line. No redirects. Each try: a new connection with headers host, content-type: application/json, content-length and those above; no User-Agent.

retries and switch-off

!A try with no 2xx within 15 s is retried after 5 s, 5 min, 30 min, 2 h, 5 h, 10 h and 10 h: 8 tries over about 27 hours, then dropped. At most 2 calls per webhook in flight. While every try fails, new events wait: 5 s after the first failed try, then 5 minutes between tries, until one succeeds. Events past your plan's deliveries per second, or while out of credits, queue without spending tries. Queue: 10,000 events or 64 MiB per webhook; past that, the oldest drop. At most 200 transactions per slot per webhook, the first in block order; the rest are skipped. A paused webhook keeps its queue and captures nothing new; a delete or the switch-off drops it. Delivery is at least once, unordered.
!Skipped without notice: transactions while delivery is down past its replay window (a few hundred slots), or the chain stops finalizing over 1,024 slots. Fetch them with getSignaturesForAddress and getTransaction.

statuses

webhooks/status
statusstatus_reasonwhat to do
activedelivering
pausednullyou paused it: PATCH status "active"
pausedkey_revoked, key_deleted, key_suspended, key_bannedPATCH a live key_id or lift the suspension; banned: contact support
pausedaccount_suspended, account_closed, account_bannedaccount inactive; banned: contact support
pausedover_plan_limitplan lowered: newest webhooks and lists past its caps pause. Delete one, shorten the list or move up a plan
disabledno success in 5 daysfix the receiver, then PATCH status "active"

delivery log and test event

webhooks/deliveries
fieldkindwhat
tsnumberUnix milliseconds (UTC)
event_idstringthe webhook-id sent; evt_test_ prefix on tests; empty on a drop with unknown id
slotnumbertransaction slot; 0 on a test
kindstring"delivery" or "test"
attemptnumbertry number, 1 to 8; on a drop, tries made, 0 to 8
outcomestring"delivered"; "failed" (a delivery retries); "dropped" (event lost); "refused" (test not sent)
http_statusnumberyour url's status; 0 if no answer
reasonstringfailed: timeout, connect, tls, http or refused (url not called: name unresolved or not public); empty if your url answered non-2xx. dropped: tries_spent, queue_full, disabled or switched_off. refused: the cause in words
latency_msnumbername lookup to first answer line; 0 on a drop, refusal or uncalled url
cursorstringsend the last line's as ?before= for older lines
$GET /v1/webhooks/{id}/deliveries: a line appears about a second after the event; a page shorter than the limit is the last; a missing webhook, or another account's, returns an empty list. For debugging, not billing; a line can be missing.
$POST /v1/webhooks/{id}/test: one try, up to 15 s. Body: a one-event list with slot 0, blockTime, indexWithinBlock 0, a signature of 64 ones, err null, status {"Ok": null} and test: true. Its webhook-id starts with evt_test_; skip it before getTransaction. A delivered test bills under the webhook's key; failed or refused, free. Tests reach paused and disabled webhooks and change neither status nor consecutive_failures, so test a receiver before you switch a webhook back on. Tests count against your plan's deliveries per second. Refused before sending: 200, outcome "refused", the cause in reason and its kind in refusal: credits, rate, plan, key (revoked, suspended or unknown), secret, host or refused.

troubleshooting

webhooks/faults
symptomcauseaction
paused, with a reasonsee the reasonremove the cause; resumes on its own
disabled5 days of failed tries, no 2xx; quiet or paused webhooks never disablefix the receiver, then PATCH status "active"
429 on a changeover 120 creates, edits, tests, rotations and deletes per account in 10 minuteswait up to 10 minutes, then send it again; reads are never throttled
409 on create or PATCHthe plan's webhook or address cap, named in the messagedelete one, shorten the list or move up a plan
signature does not verifybody parsed or re-encoded before the check, another webhook's secret, or clock over 5 minutes offverify the raw bytes with this webhook's secret
the same event twiceretry after a timeout or non-2xx answerdedupe on webhook-id; answer 200 before heavy work
nothing arrivingno matching finalized transaction yet, tx_status skips it, or your url redirects or answers after 15 ssend a test and read its log line; then check the addresses, tx_status and the last tries
»Not offered: parsed (enhanced) payloads, account-change webhooks, Discord delivery, batching, replay of past events. Agents find these calls in the SKILL.md.