On this page
Another system reads MSO Cloud data through the Platform API, receives signed webhooks when something changes, and pushes events back. The table below says which "event" you want; the sections after it list what an engineer on either side touches.
When to use#
Use it when your system is not a connector (it does not get polled) and needs organizations, members, entitlements or the shared social trend feed, or needs to be told that a membership, app or trend changed. If your system also signs users in, add the satellite checklist. To pull data into MSO Cloud on a schedule, write a connector.
"Event" names five unrelated mechanisms in the code (Event contracts):
| You want to | Mechanism | Contract |
|---|---|---|
| Receive changes as an external app | Platform webhooks | platform in packages/ |
Tell MSO Cloud something (content.) |
POST / |
content, scope platform:events. |
| Send a marketplace order or stock change into MSO Cloud | Marketplace webhook ingest | POST /; connector-specific HMAC |
| React inside the platform | Eventbus topics | TOPICS in packages/ (internal, not for apps) |
| Feed the ops screen | Realtime ops feed | packages/ (internal) |
Only the first two are an external contract. Both the ingest envelope (packages/platform-contract/src/event-envelope.ts) and the bus entry (EventEnvelope in packages/eventbus/src/bus.ts) are called an envelope and have different shapes.
The contract#
- The platform contract package (version 0.5.0,
packages/platform-contract/package.json):api.tsresponse schemas,scopes.ts,webhooks.ts,signature.ts,claims.ts; prose inpackages/platform-contract/CONTRACT.md. Endpoint, scope, signing and retry details: Platform API and events. - Events MSO to app:
org.app.changed,membership.changed,user.disabled,trends.updated. App to MSO:content.published. - Every event is one envelope:
id(idempotency key),type,org_id,occurred_at,data. - Scopes, one per data plane, are listed once in
PLATFORM_SCOPES; the issuer derives its scope list from it (apps/idp/src/provider.ts).
How registration works#
Outbound delivery is subscription-driven. writePlatformEvent (apps/web/src/server/platform/outbox.ts) writes one pending platform_outbox row per active row of platform_webhook_subscriptions whose eventTypes match, inside the caller's tenant transaction, so a rolled-back change sends nothing. With no subscription it writes nothing. The worker queue scheduled runs platform-webhooks:sweep every minute and apps/worker/src/processors/platform-webhook-delivery.ts posts the signed body (X-MSO-Signature: sha256=<hex>, X-MSO-Event-Id).
Add one#
New event type, MSO to app:
- Add the Zod schema to
packages/platform-contract/src/webhooks.ts, toplatformEventSchemaand toMSO_TO_APP_EVENT_TYPES. - Call
writePlatformEvent(orgId, '<type>', data)from the code that makes the change, inside its org transaction (web:apps/web/src/server/platform/, worker:apps/worker/src/lib/platform-outbox-write.ts). - Raise the package version and update
CONTRACT.mdand Platform API and events; add a case topackages/platform-contract/src/contract.test.ts.
New endpoint or scope:
- Add the response schema to
packages/platform-contract/src/api.ts; add the scope toPLATFORM_SCOPESonly if no existing plane scope fits (a plane has one scope). - Add the route under
apps/web/src/app/api/platform/v1/, starting withrequirePlatformScope('<scope>')(apps/web/src/server/platform/auth.ts), requiring the path organization to equal the token organization, and parsing the response with the schema. - Add the scope to the manifests of the satellites that may request it and to the issuer client entries (Connected app).
Receiving side: verify the HMAC over the raw body in constant time before parsing, store seen X-MSO-Event-Id values, order by occurred_at, return 2xx quickly.
Guards#
packages/platform-contract/src/contract.test.ts, event-envelope.test.ts; scripts/audit/platform-scope-per-plane.py (one scope per route, in audit:all); scripts/audit/event-envelope-single-schema.py (one envelope schema; token audit-ok-event-envelope); rule pack .claude/rules/platform-family.md.
Operating it#
- Retries: 2xx settles; 408, 425, 429 and 5xx retry at 30 s x 2^(n-1) capped at 6 h, at most 10 attempts; anything else is dead and stays in
platform_outboxfor inspection. Delivery is at-least-once and can arrive out of order. - The destination must be https on the satellite's launch host, with no credentials, no private or loopback address and no followed redirects. Secrets are envelope-encrypted.
- Inbound
POST /events: 600 requests a minute per organization and client, body at most 64 KiB, a repeated event id answersduplicate: true. trends.updatedis written by the worker when the shared feed revision moves (apps/worker/src/lib/trend-feed/announce.ts); a lost webhook delays an app by at most its own reconciliation.
Where it stops#
- No screen or API creates
platform_webhook_subscriptionsrows, so every webhook receiver is wired by hand; creating that path touches schema and row-level security and needs operator review. content.publishedis stored for lineage and has no consumer inapps/orpackages/.- The API exposes only the third-party market-intelligence plane and org structure; marketplace and marketing data have no endpoint.
- Realtime type
creator.hour_spikeis declared and has no publisher;source_watermarkcolumns have no writer (Event contracts). GET /social/trendsand/social/trends/countsare deprecated since 0.5.0 and removed in 1.0.