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).
Before you call
A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).
Capability area: System and integration setup — Registers, connections and the settings your systems run on.
Roles that may call it:
- Owner
- System Administrator
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.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | CreateWebhookSubscriptionInput CreateWebhookSubscriptionInput! | yes | Create-input for createWebhookSubscription. |
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
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)