sl.webhooks
Create webhooks, read their deliveries and replay history. The same data the Webhooks API serves over HTTP.
| list() | { data: WebhookSummary[] } | List your webhooks. |
| get(id) | WebhookDetail | Get one webhook's full configuration. |
| create(input) | CreateWebhookResponse | Create a webhook that POSTs chain events to your URL. |
| update(id, patch) | WebhookDetail | Change a webhook's name, URL, format, auth, or delivery limits. |
| pause(id) | WebhookDetail | Stop deliveries without deleting the webhook. |
| resume(id) | WebhookDetail | Start delivering again after a pause. |
| delete(id) | { ok: true } | Delete a webhook. |
| rotateSecret(id) | RotateSecretResponse | Issue a new signing secret. |
| test(id) | WebhookTestResult | Send a one-off test delivery to a webhook's URL. |
| deliveries(id, window) | { total: number; data: DeliveryRow[… | The last 100 delivery attempts, newest first. |
| activity(id, opts) | WebhookActivity | Get a webhook's hourly delivery counts for the last 7 days. |
| delivery(id, deliveryId) | WebhookDeliveryDetail | Get one delivery attempt with its payload and response. |
| replay(id, range) | ReplayResult | Re-deliver historical events over an existing webhook. |
| dead(id) | { data: DeadRow[] } | List the events a webhook gave up delivering. |
| requeue(id, outboxId) | { ok: true } | Push one dead-lettered event back onto the delivery queue. |
List your webhooks.
Each summary has the status, format, URL, last delivery and last success, and the circuit breaker state (circuitFailures, circuitOpenedAt).
Get one webhook's full configuration.
Adds the triggers, the receiver's auth (redacted to header names and whether a secret is set), the retry and timeout limits, lastError, and a warning when this instance's trigger evaluator is not running.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Returns Promise<WebhookDetail>
triggers- Chain-trigger filters.
auth- WebhookAuth
maxRetries- number
timeoutMs- number
concurrency- number
lastError- string | null
receiverCertExpiresAt- When the receiver's TLS certificate expires, from the periodic probe. Null for http receivers, refused or unreachable hosts, and webhooks not probed yet.
warning- Set when this instance's chain-trigger evaluator isn't running (
SUBGRAPH_SOURCE!=streams-index) — the webhook will never fire until that's fixed. Null otherwise. Surfaced on create (so it's seen immediately) and on every read (sosecondlayer webhooks doctorreports it for a webhook created before the mismatch, or on an instance whose config changed since). id- string
name- string
status- WebhookStatus
kind- WebhookKind
format- WebhookFormat
url- string
lastDeliveryAt- string | null
lastSuccessAt- string | null
circuitOpenedAt- When the circuit breaker paused this webhook (20 straight failures); cleared on resume. Present on the list summary (not detail-only) so a numbers-only insight can be shown per row without a per-row fetch.
circuitFailures- Consecutive failed deliveries (reset to 0 on a success). On the summary so the list can show a failing receiver per row without a per-row fetch.
managedBy- Owning product, derived from the name prefix (
MANAGED_NAME_PREFIXES). When non-null the API refuses to rename the webhook. createdAt- string
updatedAt- string
Create a webhook that POSTs chain events to your URL.
Takes a name, a url, and triggers built with trigger.*; each trigger is validated before anything is provisioned, and an invalid one is a 400. The signing secret comes back once in signingSecret, so store it. A webhook starts at the chain tip and never backfills: use replay for history. Hosted accounts cap maxRetries at 7 and timeoutMs at 30000.
Parameters
hover a row to find it in the codeRequired
namerequiredstring | |
triggersrequiredChainTrigger[] | |
urlrequiredstring |
Options
formatWebhookFormat | |
authConfigRecord<string, unknown> | |
maxRetriesnumber | |
timeoutMsnumber | |
concurrencynumber |
Returns Promise<CreateWebhookResponse>
webhook- WebhookDetail
signingSecret- Plaintext signing secret — surfaced ONCE. Store it server-side.
Change a webhook's name, URL, format, auth, or delivery limits.
Send only the fields to change: name, url, format, authConfig, maxRetries, timeoutMs, concurrency. Triggers are not part of an update. Resolves to the updated webhook.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Options
patch.namestring | |
patch.urlstring | |
patch.formatWebhookFormat | |
patch.authConfigRecord<string, unknown> | |
patch.maxRetriesnumber | |
patch.timeoutMsnumber | |
patch.concurrencynumber |
Returns Promise<WebhookDetail>
triggers- Chain-trigger filters.
auth- WebhookAuth
maxRetries- number
timeoutMs- number
concurrency- number
lastError- string | null
receiverCertExpiresAt- When the receiver's TLS certificate expires, from the periodic probe. Null for http receivers, refused or unreachable hosts, and webhooks not probed yet.
warning- Set when this instance's chain-trigger evaluator isn't running (
SUBGRAPH_SOURCE!=streams-index) — the webhook will never fire until that's fixed. Null otherwise. Surfaced on create (so it's seen immediately) and on every read (sosecondlayer webhooks doctorreports it for a webhook created before the mismatch, or on an instance whose config changed since). id- string
name- string
status- WebhookStatus
kind- WebhookKind
format- WebhookFormat
url- string
lastDeliveryAt- string | null
lastSuccessAt- string | null
circuitOpenedAt- When the circuit breaker paused this webhook (20 straight failures); cleared on resume. Present on the list summary (not detail-only) so a numbers-only insight can be shown per row without a per-row fetch.
circuitFailures- Consecutive failed deliveries (reset to 0 on a success). On the summary so the list can show a failing receiver per row without a per-row fetch.
managedBy- Owning product, derived from the name prefix (
MANAGED_NAME_PREFIXES). When non-null the API refuses to rename the webhook. createdAt- string
updatedAt- string
Stop deliveries without deleting the webhook.
Resolves to the updated webhook. resume turns it back on.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Returns Promise<WebhookDetail>
triggers- Chain-trigger filters.
auth- WebhookAuth
maxRetries- number
timeoutMs- number
concurrency- number
lastError- string | null
receiverCertExpiresAt- When the receiver's TLS certificate expires, from the periodic probe. Null for http receivers, refused or unreachable hosts, and webhooks not probed yet.
warning- Set when this instance's chain-trigger evaluator isn't running (
SUBGRAPH_SOURCE!=streams-index) — the webhook will never fire until that's fixed. Null otherwise. Surfaced on create (so it's seen immediately) and on every read (sosecondlayer webhooks doctorreports it for a webhook created before the mismatch, or on an instance whose config changed since). id- string
name- string
status- WebhookStatus
kind- WebhookKind
format- WebhookFormat
url- string
lastDeliveryAt- string | null
lastSuccessAt- string | null
circuitOpenedAt- When the circuit breaker paused this webhook (20 straight failures); cleared on resume. Present on the list summary (not detail-only) so a numbers-only insight can be shown per row without a per-row fetch.
circuitFailures- Consecutive failed deliveries (reset to 0 on a success). On the summary so the list can show a failing receiver per row without a per-row fetch.
managedBy- Owning product, derived from the name prefix (
MANAGED_NAME_PREFIXES). When non-null the API refuses to rename the webhook. createdAt- string
updatedAt- string
Start delivering again after a pause.
Also clears a circuit-breaker pause, which happens after 20 straight failed deliveries. Resolves to the updated webhook.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Returns Promise<WebhookDetail>
triggers- Chain-trigger filters.
auth- WebhookAuth
maxRetries- number
timeoutMs- number
concurrency- number
lastError- string | null
receiverCertExpiresAt- When the receiver's TLS certificate expires, from the periodic probe. Null for http receivers, refused or unreachable hosts, and webhooks not probed yet.
warning- Set when this instance's chain-trigger evaluator isn't running (
SUBGRAPH_SOURCE!=streams-index) — the webhook will never fire until that's fixed. Null otherwise. Surfaced on create (so it's seen immediately) and on every read (sosecondlayer webhooks doctorreports it for a webhook created before the mismatch, or on an instance whose config changed since). id- string
name- string
status- WebhookStatus
kind- WebhookKind
format- WebhookFormat
url- string
lastDeliveryAt- string | null
lastSuccessAt- string | null
circuitOpenedAt- When the circuit breaker paused this webhook (20 straight failures); cleared on resume. Present on the list summary (not detail-only) so a numbers-only insight can be shown per row without a per-row fetch.
circuitFailures- Consecutive failed deliveries (reset to 0 on a success). On the summary so the list can show a failing receiver per row without a per-row fetch.
managedBy- Owning product, derived from the name prefix (
MANAGED_NAME_PREFIXES). When non-null the API refuses to rename the webhook. createdAt- string
updatedAt- string
Delete a webhook.
Resolves to { ok: true }. Throws a 404 when the webhook does not exist.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Issue a new signing secret.
The new secret comes back once in signingSecret. Update the receiver that calls verifyWebhookSignature with it: deliveries are signed with the new secret from now on.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Returns Promise<RotateSecretResponse>
webhook- WebhookDetail
signingSecret- string
Send a one-off test delivery to a webhook's URL.
Built for the webhook's format and SSRF-guarded. Logged as a delivery row, visible via deliveries.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Returns Promise<WebhookTestResult>
ok- boolean
statusCode- number | null
error- string | null
durationMs- number
deliveryId- string
The last 100 delivery attempts, newest first. The server caps the result; there is nothing to page. Pass window (ISO timestamps, at most 31 days wide) to read only the attempts dispatched in [from, to), for example one hour of the heat strip; total then counts that window.
Parameters
hover a row to find it in the codeRequired
idrequiredstring | |
window.fromrequiredstring | |
window.torequiredstring |
sl.webhooks.activity(id, opts)
Get a webhook's hourly delivery counts for the last 7 days.
Each hour has delivered, waiting, and gave-up counts, plus the current queue depth, failed attempts per hour, and the usual band. Pass { days: 30 } to also get 30 daily totals. This is the events chart on the detail page.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
Options
opts.days30 |
Returns Promise<WebhookActivity>
hours- 168 hours, oldest first.
waiting- Pending rows right now, no time bound.
nextAttemptAt- string | null
lastSuccessAt- string | null
byEventType- 7-day counts per
event_type(same 168-hour window ashours), e.g.chain.stx_transfer.apply— the config card's per-trigger volume. usualByHourOfDay- Typical delivered attempts for each UTC hour of day (p10 and p90 of the last 28 days, from
webhook_deliveries). Null at low volume, where "usual" is not meaningful. days- Present with
?days=30: 30 UTC days, oldest first, fromwebhook_deliveries(2xx is delivered, everything else failed).
sl.webhooks.delivery(id, deliveryId)
Get one delivery attempt with its payload and response.
Includes the outbox context (payload, response headers). This is the delivery card on the detail page.
Parameters
hover a row to find it in the codeRequired
idrequiredstring | |
deliveryIdrequiredstring |
Returns Promise<WebhookDeliveryDetail>
id- string
attempt- number
statusCode- number | null
durationMs- number | null
dispatchedAt- string
errorMessage- string | null
responseBody- string | null
responseHeaders- Record<string, string> | null
outboxId- string | null
outboxStatus- The outbox row's own status —
nullonce it's gone (compacted after delivery, or never had one, e.g. a test delivery). Only"dead"means a resend is possible: it's the one statusPOST /:id/dead/:outboxId/ requeueaccepts. eventType- string | null
txId- string | null
blockHeight- number | null
blockTime- string | null
eventIndex- The row's position within its block/tx, from the outbox's
row_pk(event_indexfor a chain-trigger row). Null whenrow_pkcarries none — a settlement or reorg outbox row, or no outbox row at all. payload- unknown
Re-deliver historical events over an existing webhook.
Pass fromBlock and toBlock; the range is capped at 100,000 blocks. A replay is historical only and never moves the live cursor. It is idempotent: the same range twice is a no-op, so pass any string as force to re-deliver it. Replays carry is_replay and use the standard chain.{type}.apply envelope. Resolves to replayId, enqueuedCount, and scannedCount. A second replay while one is running is a 409. sbtc_withdrawal_swept_confirmed is forward-only and never replayed. Hosted accounts get 5 replays an hour.
Parameters
hover a row to find it in the codeRequired
idrequiredstring | |
range.fromBlockrequirednumber | |
range.toBlockrequirednumber |
Options
range.forcestring |
Returns Promise<ReplayResult>
replayId- string
enqueuedCount- number
scannedCount- number
List the events a webhook gave up delivering.
Returns up to 100 dead-lettered events, newest failure first. Each row's id is what requeue takes.
Parameters
hover a row to find it in the codeRequired
idrequiredstring |
sl.webhooks.requeue(id, outboxId)
Push one dead-lettered event back onto the delivery queue. outboxId is the id of a row from dead.
Parameters
hover a row to find it in the codeRequired
idrequiredstring | |
outboxIdrequiredstring |
ChainTriggerSubgraphFilter union.ChainTriggerAmountCreateWebhookRequestCreateWebhookResponseDeadRowDeliveryRowReplayResultRotateSecretResponseTraitScopedtraitUpdateWebhookRequestWebhookActivityWebhookActivityDayGET /:id/activity?days=30).WebhookActivityHourwebhook_outbox activity (GET /:id/activity), zero-filled so the events chart always has 168 bars.WebhookAuthWebhookDeliveryDetailWebhookDetailWebhookSummaryWebhookTestResultPOST /:id/test).