You only need these endpoints if you are building your own storefront or app
front end. The Senderz storefront bundle already performs both calls for
popups that collect push opt-in.
Get the VAPID public key
applicationServerKey when calling pushManager.subscribe().
The key is platform-wide, not per workspace, so this endpoint takes no input and needs no credentials. Sending headers or a query string changes nothing, and the route is GET only. Fetch it once at startup and cache it.
Response
string | null
The base64url VAPID public key, or
null when web push is not configured on
the platform.boolean
true when a key is available. When false, subscriptions are still
recorded but no notification can be delivered, so hide your opt-in prompt.Example
200 OK
200 OK (push not configured)
Register a subscription
200 OK, not 201.
The profile must already exist. Create it first with POST /public/profiles or PUT /public/profiles, then pass its id here.
Headers
string
required
Workspace slug or UUID.
string
required
Your workspace API key. The key decides which workspace the subscription is
written to. The header value is never trusted on its own.
Body
The body mirrors the browser’sPushSubscription object plus the profile id and optional device metadata.
string
required
UUID of the profile this browser belongs to. A profile that does not exist in
the workspace returns
404.string
required
The push service endpoint URL from
subscription.endpoint. Non-empty,
maximum 2048 characters.object
required
The encryption key pair from
subscription.getKey(). The object as a whole is
required. Omitting it, or sending null, returns 400, because a
subscription without keys can never be delivered to.string
Optional user agent string, maximum 500 characters. Stored for support and
never returned by this endpoint.
string
Optional browser label, maximum 64 characters. Free text, for example
chrome.string
Optional platform label, maximum 64 characters. Free text, for example
macos.keys. Sending the raw browser subscription object unmodified will fail if it carries extra fields such as expirationTime, so pick out endpoint and keys explicitly.
Response
string
Subscription UUID.
string
The profile the subscription is attached to.
string
SHA-256 hex digest of the endpoint URL, 64 characters. This is the stable
identity of the browser. The endpoint URL itself is never returned.
string | null
The browser label you sent, or
null.string | null
The platform label you sent, or
null.string
ISO 8601 timestamp of first registration.
string
ISO 8601 timestamp, refreshed on every registration of this endpoint.
string | null
ISO 8601 timestamp when the subscription was revoked, or
null while live. A
successful registration always returns null here, including when it revived
a previously revoked row.string | null
Why the subscription was revoked, or
null while live.Example
200 OK
What registering does
A successful call does more than store a row. In one transaction it:1
Upserts the subscription
Identity is the endpoint, not the request. Posting the same
endpoint
again updates the keys and device labels, clears revokedAt and
revokeReason, and refreshes lastSeenAt on the existing row rather than
creating a second one. Re-registering on every page load is safe.2
Opts the profile in to push
Sets the profile’s push consent to
subscribed, stamps the consent
timestamp and records the consent source as storefront_popup.3
Writes a consent record
Appends an entry to the profile’s consent history with the caller IP and
user agent as evidence.
4
Lifts suppression for that browser
Removes any push suppression held against this endpoint, so a browser that
previously went away can opt back in.
Push suppression is per browser, keyed on
endpointHash, not per profile. One
browser going stale does not unsubscribe the profile while another live
browser remains.Errors
404 Not Found

