Webhooks

Webhooks allow you to listen to triggers from Schematic to create alerts or keep external services up to date when data changes.

Supported webhook events

The table below lists every supported event and links to its payload type in the Node.js SDK. See Payload types below for links to other SDKs.

Company & User events

EventBody type
company.created, company.updated, company.deletedCompanyDetailResponseData
company.plan_changedPlanChangeResponseData — see Plan Changed Webhook
company.override.created, company.override.updated, company.override.deleted, company.override.expiredCompanyOverrideResponseData
user.created, user.updated, user.deletedUserDetailResponseData

Catalog events

EventBody type
feature.created, feature.updated, feature.deletedFeatureDetailResponseData
flag.created, flag.updated, flag.deletedFlagDetailResponseData
flag_rules.updated, rule.deletedRuleDetailResponseData
plan.created, plan.updated, plan.deletedPlanDetailResponseData
plan_version.deletedPlanVersionResponseData
plan.entitlement.created, plan.entitlement.updated, plan.entitlement.deletedPlanEntitlementResponseData

Billing events

EventBody type
subscription.trial.endedBillingSubscriptionView

Usage-based trigger events — see Entitlement & Credit Trigger Webhooks

EventBody type
entitlement.limit.reached, entitlement.limit.warning, entitlement.soft_limit.reached, entitlement.soft_limit.warning, entitlement.tier_limit.reached, entitlement.tier_limit.warningWebFeatureUsageWebhookOutput
credit.limit.reached, credit.limit.warning
auto.topup.hard.failureCreditsAutoTopupHardFailure
auto.topup.retry.exceededCreditsAutoTopupRetryFailure

Payload types

All webhook event payloads are strongly typed in each of our SDKs. The Node.js types are linked in the table above. The same type names are available in Go, C#, Java, and Python.

Webhook structure

Each webhook from Schematic is a POST request with a JSON body structured as follows.

1{
2 "action": "<webhook.name>",
3 "account_id": "acct_xxxxxxx",
4 "environment_id": "env_xxxxxxxx",
5 "object_type": "<object>",
6 "body": {},
7 // if applicable
8 "company_id": "comp_xxxxxxxx",
9 "feature_id": "feat_xxxxxxxx"
10}
FieldDescription
actionThe webhook event type, e.g. company.created
account_idThe account the event occurred in
environment_idThe environment within the account the event occurred in
object_typeThe type of object the event relates to
bodyPayload containing event-specific data; shape varies by event type
company_idPresent on company-scoped and entitlement trigger events
feature_idPresent on entitlement trigger events

The contents of body vary depending on the event. You can inspect real payloads using free services like Webhook-Test or the webhook log in the Schematic dashboard.

Signature verification

Every webhook request Schematic sends includes three headers for verifying authenticity:

HeaderDescription
X-Schematic-Webhook-SignatureHMAC-SHA256 signature of the request body, hex-encoded
X-Schematic-Webhook-Signature-VersionSignature version — currently v1
X-Schematic-Webhook-TimestampUnix timestamp of when the webhook was sent

The signature is computed as:

HMAC-SHA256(secret, rawBody + "+" + timestamp) → hex-encoded

where secret is the webhook secret shown in the Schematic dashboard when you create the webhook endpoint.

Each SDK ships a built-in helper to handle verification for you:

1import { verifyWebhookSignature } from "@schematichq/schematic-typescript-node";
2
3// Express example
4app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
5 try {
6 verifyWebhookSignature(req, process.env.SCHEMATIC_WEBHOOK_SECRET, req.body);
7 } catch (err) {
8 return res.status(400).send("Invalid signature");
9 }
10
11 const event = JSON.parse(req.body.toString());
12 // handle event...
13 res.sendStatus(200);
14});
Always use your framework’s raw body middleware when verifying signatures — parsed or re-serialized bodies will not match the original signature.

Developer Tooling

On the webhooks page in Schematic, you can find a log of all webhooks Schematic has sent for your account. We will only show events that have an associated webhook configured.

webhook-log