AlmondTill/G3N API

On this page

createWebhookSubscription

mutation · in the family System and integration setup

What it does

Register a webhook — your endpoint gets signed POSTs when the events you pick happen.

Register an outbound webhook: OWNER-gated ENGINE-side (the caller's Account must hold group ownership LIVE); the target URL passes the egress law; every event name must be in the DERIVED deliverable universe; at most 10 ACTIVE subscriptions per group (the bounded fan-out law). Returns the subscription + the signing secret ONCE. Template class (integration config — hand-derived v71).

What happens

The signing secret shows ONCE at creation and never again; verify every delivery with it.

Careful

OWNER-gated. https endpoints only; at most 10 active subscriptions per group; repeated delivery failures auto-suspend the subscription.

Who may call it

Capability area: System and integration setup — Registers, connections and the settings your systems run on.

Arguments

NameTypeRequiredNotes
inputCreateWebhookSubscriptionInput CreateWebhookSubscriptionInput!yesNo further notes.

Returns

WebhookSubscriptionMint WebhookSubscriptionMint! — The createWebhookSubscription result — the subscription + its signing secret, returned ONCE (plaintext in the non-streamed credential store; verify every delivery with it).

Example request

mutation ExampleCreateWebhookSubscription($input: CreateWebhookSubscriptionInput!) {
  createWebhookSubscription(input: $input) {
    secret
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "targetUrl": "https://example.com/hook",
    "eventTypes": [
      "<event types>"
    ]
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

{
  "data": {
    "createWebhookSubscription": {
      "secret": "<your key secret>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in