Receive platform Webhooks
Verify, deduplicate and persist notifications in a durable Inbox, then read platform snapshots to update your own business jobs.
Subscribe to events
Select the project, service/resource and actual event catalog entries in Console, and configure a public HTTPS receiver. APIs include:
| Action | Endpoint |
|---|---|
| Event catalog | GET /api/v1/webhook-event-types |
| Provision subscription/signing credential | POST /api/v1/webhook-subscriptions:provision |
| Test | POST /api/v1/webhook-subscriptions/{id}:test |
| Deliveries | GET /api/v1/webhook-deliveries |
| Delivery and attempts | GET /api/v1/webhook-deliveries/{id} |
| Retry | POST /api/v1/webhook-deliveries/{id}:retry |
Management requires project-authorized webhooks:read/webhooks:write. Provisioning returns signing_secret once. Store it in your receiver's secret manager. A platform Secret reference is not the HMAC value, and this key is separate from OAuth client credentials.
Verify the actual protocol
Outgoing notifications use CloudEvents JSON and application/cloudevents+json. The platform's RFC 9421 HTTP Message Signatures profile covers method, full target URI, Content-Digest and Content-Type.
Headers include Content-Digest, Signature-Input, Signature, webhook-id and webhook-timestamp. The presence of webhook-prefixed headers does not make this the different Standard Webhooks HMAC construction.
SDK source provides verifyWebhook(). Download the standalone webhooks.ts without installing the full SDK. It uses standard Web Crypto; compile it in a TypeScript backend or load it with Node.js 22.18 type stripping:
import { verifyWebhook } from './webhooks.ts';
const event = await verifyWebhook({
body: rawBody,
headers: request.headers,
method: 'POST',
url: configuredPublicWebhookURL,
secret: signingSecrets,
});An operator-distributed SDK package also exports the same function from @orbitspace/sdk. Your application supplies its HTTP framework, bounded raw-body reader and Inbox database.
Use exact raw bytes, not reserialized JSON. Configure the full public URL; a proxy's internal URL or untrusted Host header must not replace the signed target. The verifier enforces a maximum five-minute window and accepts multiple trusted keys during rotation.
Receipt transaction
Bound request size/time, verify signatures and structure, commit an Inbox record atomically, then return 2xx. Process it asynchronously after durable admission.
A PostgreSQL application can use this uniqueness boundary; other databases need equivalent semantics:
CREATE TABLE orbitspace_webhook_inbox (
source text NOT NULL,
event_id text NOT NULL,
body_sha256 text NOT NULL,
payload jsonb NOT NULL,
state text NOT NULL DEFAULT 'pending',
received_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (source, event_id)
);Deduplicate business events by CloudEvent (source, id); use webhook-id for delivery diagnostics. A timestamp is not a deduplication key. Acknowledge identical duplicates; quarantine conflicting content under the same identity. Return a failure when persistence is unavailable rather than acknowledging an in-memory queue.
Concurrency and recovery
Events can repeat and consumers can process them concurrently. Resolve the business job, reload its Invocation/Goal, and apply updates with observed versions. An older notification must not regress a terminal state. Delivery success is not execution success.
The sender retries transient transport failures and HTTP 408, 425, 429 and 5xx within bounds. Ordinary 4xx and redirects are not repaired by retries. Fix the receiver before requesting delivery replay.
Rotate keys
POST /api/v1/webhook-subscriptions/{id}:rotateSigningKey uses the observed expected_state_version. Accept old and new keys during overlap, verify new-key delivery, then call :endKeyOverlap. Do not log secret values or hardcode one signature label/key during migration.