// developers · events
Be told, instead of polling.
45 event types; 19 publish today, 22 more are built and switched off. Deliveries are CloudEvents 1.0 envelopes, signed with the same ES256 key the access tokens use, so you verify them with a public key and no shared secret.
// subscribe
One call per endpoint.
curl -X POST https://app.magistry.io/api/v1/subscriptions \
-H "Authorization: Bearer mag_sk_live_…" \
-H "Content-Type: application/json" \
-d '{ "url": "https://your-app.example/hooks/magistry",
"event_types": ["order.*", "approval.decided"],
"description": "Order sync" }'event_types takes exact types or a trailing *; leave it out to receive every type. Creating a subscription needs automation:write, plus the read scope of each type it filters, because a webhook is a read. It is refused when the URL is not https or resolves to a private address, when a filter matches no type in the catalogue, and past 20 subscriptions per store. A filter on a type that does not publish yet is saved, with a no_publisher_yet warning in the response.
Finance events belong to a set of books rather than a store, so they are subscribed per entity at POST /api/v1/finance/subscriptions with an entity_id. Missed ones can be replayed from the finance change feed, which keeps 730 days.
// catalogue
45 event types.
Store events (34)
order.createdbuilt, switched offA new order was recorded for the store, from any sales channel.
Subject: The order id. · Scope: orders:read
order.updatedbuilt, switched offA contract field of an order changed: total, currency, line-item count, payment or fulfilment status, cancellation or deletion.
Subject: The order id. · Scope: orders:read
order.cancelledbuilt, switched offAn order was cancelled.
Subject: The order id. · Scope: orders:read
order.fulfilledbuilt, switched offAn order became fully fulfilled.
Subject: The order id. · Scope: orders:read
order.refundedbuilt, switched offA refund was recorded against an order, by Magistry or by a person.
Subject: The order id. · Scope: orders:read
product.price_changedbuilt, switched offA variant price or reference price changed on the storefront.
Subject: The variant id. · Scope: catalog:read
product.createdbuilt, switched offA product was added to the catalogue, from any channel.
Subject: The product id. · Scope: catalog:read
product.updatedbuilt, switched offA product title, status, handle, vendor or product type changed.
Subject: The product id. · Scope: catalog:read
product.stock_changedbuilt, switched offA variant went out of stock or came back in stock. Sent on the crossing, never per unit.
Subject: The variant id. · Scope: catalog:read
cs.thread_escalateddefined, not publishing yetA customer-service thread was escalated to a person.
Subject: The thread id. · Scope: cs:read
cs.thread_openedbuilt, switched offA customer started a conversation: the first inbound message of a customer thread arrived. Imported history, spam and non-customer mail are not openings.
Subject: The thread id. · Scope: cs:read
cs.human_requestedbuilt, switched offThe customer asked for a person. Sent each time the request is made again after a release, including on desks with no person to take it.
Subject: The thread id. · Scope: cs:read
cs.thread_resolvedbuilt, switched offA customer thread was closed. Sent again if it is reopened and closed; moving it to spam or trash is not a resolution.
Subject: The thread id. · Scope: cs:read
decision.proposedbuilt, switched offMagistry recorded a decision it proposes to take for the store.
Subject: The decision id. · Scope: automation:read
decision.approvedbuilt, switched offA decision was approved, by a merchant user or by a policy the merchant set.
Subject: The decision id. · Scope: automation:read
decision.executedbuilt, switched offA decision was applied to the system it acts on.
Subject: The decision id. · Scope: automation:read
decision.revertedbuilt, switched offAn applied decision was undone.
Subject: The decision id. · Scope: automation:read
decision.expiredbuilt, switched offA proposed decision lapsed before it was approved or applied. It will not be taken.
Subject: The decision id. · Scope: automation:read
decision.blockedbuilt, switched offA decision was stopped by a guard, a policy or a missing precondition, at proposal or later. It will not be taken as proposed.
Subject: The decision id. · Scope: automation:read
decision.supersededbuilt, switched offA decision was replaced by a newer one. It will not be taken.
Subject: The decision id. · Scope: automation:read
campaign.status_changeddefined, not publishing yetAn ad campaign was paused, resumed, or had its budget changed.
Subject: The campaign id. · Scope: ads:read
compliance.finding_openeddefined, not publishing yetA compliance audit opened a finding against the store.
Subject: The finding id. · Scope: automation:read
approval.requestedpublishingA connected app asked the merchant to approve something.
Subject: The approval id. · Scope: automation:read
approval.decidedpublishingA person approved or rejected an app's approval request.
Subject: The approval id. · Scope: automation:read
approval.expiredpublishingAn approval request reached its deadline with no decision, and is closed as not approved.
Subject: The approval id. · Scope: automation:read
webhook.testedpublishingA test sent to one endpoint on request (webhook_test); nothing happened in the store.
Subject: The subscription id the test was sent to. · Scope: automation:read
operation.succeededpublishingA long-running operation (a render, an AI design edit, a proposed write) finished and has a result.
Subject: The operation id (op_…). · Scope: automation:read
operation.failedpublishingA long-running operation ended without a result; `error.code` says why.
Subject: The operation id (op_…). · Scope: automation:read
operation.cancelledpublishingA long-running operation was cancelled, rejected or superseded before it ran.
Subject: The operation id (op_…). · Scope: automation:read
operation.expiredpublishingA long-running operation, usually a write waiting for approval, reached its deadline with nobody acting on it.
Subject: The operation id (op_…). · Scope: automation:read
intent.field_overwritten_externallypublishingA field Magistry set (a variant price, a campaign status, budget or bidding, a theme file) was changed afterwards by someone else. Sent once per overwrite, when it is first read back.
Subject: The declaration (intent) id. · Scope: automation:read
research.run_completedbuilt, switched offA product research run finished, with its products found or the reason it stopped. Sent once per run; a run interrupted by a deploy and continued is still one run.
Subject: The research run id. · Scope: research:read
research.candidate_onboardedbuilt, switched offA research candidate became a Shopify DRAFT product in the store. Sent once per candidate and product; the product is never published by this step.
Subject: The research candidate id. · Scope: research:read
account.auditbuilt, switched offA line was written to the workspace audit log: a member, invite, role, API key, app grant or policy changed. Sent to the merchant's own subscriptions (dashboard or API key), never to a connected app; a workspace-wide line is sent to every store of the workspace.
Subject: The audit line id. · Scope: admin:read
Finance entity events (11)
fin.entry.postedpublishingA journal entry was posted. Entries of a bulk import are announced once, by the import, and read through the API.
Subject: The entry id. · Scope: finance:read
fin.entry.reversedpublishingA journal entry was reversed by a new entry. The original stays; this is its tombstone.
Subject: The reversal entry id. · Scope: finance:read
fin.period.closedpublishingA period was closed: nothing more is posted into it until it is reopened.
Subject: The period id. · Scope: finance:read
fin.period.reopenedpublishingA closed period was reopened.
Subject: The period id. · Scope: finance:read
fin.bank.importedpublishingA bank statement was imported: how many rows arrived, how many were new and how many were duplicates.
Subject: The import id. · Scope: finance:read
fin.bank_transaction.dismissedpublishingA bank row was dismissed as not_a_transaction or as a duplicate_of another row; any booking of it was reversed.
Subject: The bank transaction id. · Scope: finance:read
fin.bank_transaction.undismissedpublishingA dismissal was undone: the bank row counts again.
Subject: The bank transaction id. · Scope: finance:read
fin.bank_account.createdpublishingA bank, card, cash or PSP account was added to the books, with the ledger account it books on.
Subject: The bank account id. · Scope: finance:read
fin.bank_account.updatedpublishingA bank account's details changed; `fields` names which.
Subject: The bank account id. · Scope: finance:read
fin.bank.consent_expiringdefined, not publishing yetA bank connection's consent ends soon; the bank feed stops unless the owner renews it.
Subject: The bank connection id. · Scope: finance:read
fin.einvoice.status_changedpublishingAn e-invoice moved to a new Peppol status; `previous_status` says where it came from.
Subject: The e-invoice message id. · Scope: finance:read
curl https://app.magistry.io/api/v1/asyncapi.json// verify
Check the signature before you trust the body.
Standard Webhooks, asymmetric
Each delivery carries webhook-id, webhook-timestamp and webhook-signature: v1a,<signature>: an ES256 signature, raw r‖s in base64url, over {id}.{timestamp}.{body}.
webhook-key-id names the key in /.well-known/jwks.json to verify with, so a key rotation needs no change on your side. A library that already speaks Standard Webhooks verifies these without Magistry-specific code.
Delivery
- Guarantee
- At least once; dedupe on webhook-id
- Attempts
- 6, with jittered backoff
- Timeout
- 10 seconds
- Answer 410
- Unsubscribes the endpoint
- Disabled after
- 20 consecutive failures
import { createPublicKey, verify } from "node:crypto";
const { keys } = await (await fetch("https://app.magistry.io/.well-known/jwks.json")).json();
// rawBody: the request body exactly as received, before any JSON parsing.
export function isFromMagistry(headers, rawBody) {
const id = headers["webhook-id"];
const ts = headers["webhook-timestamp"];
const [scheme, sig] = String(headers["webhook-signature"]).split(",");
if (scheme !== "v1a") return false;
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // your replay window
const jwk = keys.find((k) => k.kid === headers["webhook-key-id"]);
if (!jwk) return false;
return verify(
"sha256",
Buffer.from(`${id}.${ts}.${rawBody}`),
{ key: createPublicKey({ key: jwk, format: "jwk" }), dsaEncoding: "ieee-p1363" },
Buffer.from(sig, "base64url"),
);
}Build on the same tools the product uses.
Create a sandbox key on demo data, or start free and connect a real store.
MCP + REST · OAuth 2.1 or API keys · every call audited
