Storyden
Notifications

Push Subscription Upsert

Register or refresh the authenticated account's browser push subscription. Web Push must be enabled on the instance.

PUT/notifications/push/subscriptions

Register or refresh the authenticated account's browser push subscription. Web Push must be enabled on the instance.

Authorization

storyden-session<token>

In: cookie

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Browser PushSubscription.toJSON() data. The browser's optional expirationTime is accepted but not used; expired subscriptions are removed when rejected by the push service.

Response Body

application/json

application/json

curl -X PUT "https://example.com/notifications/push/subscriptions" \  -H "Content-Type: application/json" \  -d '{    "endpoint": "http://example.com",    "keys": {      "p256dh": "string",      "auth": "string"    }  }'
{  "id": "string",  "endpoint": "http://example.com"}