AlmondTill/G3N API

WebhookSubscription

object type

A WebhookSubscription — the documented non-GraphQL edge OUT (mirrors the inbound Stripe webhook edge): the merchant registers an https target URL + a filtered set event names, and the delivery lane POSTs hmac-signed thin payloads at-least-once with retries/backoff/DLQ. The payload names {id, event, occurredAt, construct{type,id}, revision, subscriptionId} — the receiver dedupes on id and reads the record through this same API with its ApiKey (no fat payloads, no parallel surface). Signing mirrors the Stripe scheme (almondtill-signature: t=<unix>,v1=<hex HMAC-SHA256 of <t>.<body> under the secret>); the secret shows once at create/rotate and lives in the non-streamed credential store, never on the record. Group-parented (parentId === rootId); born active; 20 consecutive delivery failures fire the automatic active → suspended flip; reactivate serves both inactive → active and suspended → active (fix the endpoint, then reactivate; missed events do NOT replay — re-sync via the API). Owner-gated end to end (the mintApiKey posture); NOT searchable (integration config — reached via the owner-gated list).

Fields

FieldTypeNotes
idID ID!The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it.
sysIdString String!The human-readable id, shaped like WH-… — stable for the record’s life.
typeString String!The kind of record — always WebhookSubscription here.
captionString String!The record’s display name — what people see it called.
statusString String!The record’s current state — one of active, inactive, suspended or doomed.
parentIdID ID!The parent = the org group; parentId === rootId always (the Affiliate class — deliveries span the whole group’s orgs).
rootIdID ID!The id of your organization group — every record of yours carries the same one.
createdAtString String!When the record was created, as a UTC timestamp.
updatedAtString String!When the record last changed, as a UTC timestamp.
revisionNumInt Int!How many times this record has been edited; the first save is 0.
revisionID ID!The id of the record’s current edit — send it back with a change so an edit made in the meantime is refused instead of overwritten.
refCaptionsRefCaption [RefCaption!]!The captions of the records this one refers to, composed for you — one row per referenced id; see RefCaption.
targetUrlString String!The https delivery endpoint (the egress law: https only, no credentials, no explicit port, no IP-literal/localhost/private-suffix hosts; ≤512 chars). Mutable via update — fixing the endpoint is the suspended-repair flow.
eventTypesString [String!]!The event-name filter set (1..64, deduped) — each name must be in the derived deliverable universe (transition success events + at.<domain>.<entity>.create.ok.v1 birth names over the whole construct catalog).
consecutiveFailuresInt Int!Consecutive delivery-attempt failures (the deliverer’s counter — reset by the first success after failures; never written on steady-state success). At 20 the automatic suspend fires.
lastFailureAtStringThe last failed delivery attempt’s instant (failure-path-only; stands as history after recovery until the next failure overwrites).
lastFailureCodeStringThe last failure’s short token — an HTTP status (http_500) or a fetch-error class (timeout, network); never a response body.
suspendedAtStringStamped by the automatic suspend flip; cleared by reactivate.
secretRotatedAtStringThe last signing-secret rotation’s instant; null until the first rotation.
pluginIdIDThe owning Plugin: this subscription is part of that plugin’s declared event feed; immutable at birth (a re-bind = a new subscription); an un-doomed bound subscription blocks the plugin’s doom.

Used by