ressource.socialbetadocumentation
API referencePush

Register (or refresh) a device for web push

The body is the browser's `PushSubscription.toJSON()`. Idempotent on the endpoint, which must be https on a known push service (FCM, Mozilla, Apple, WNS) resolving to public addresses — anything else is 400 `push_endpoint_not_allowed`. The device's user agent is read from the request. Past the device limit, a new device is 429.

PUT
/api/v1/push-subscriptions

Sends a real request with your token. Prefer a read-only token; it is kept in this browser's storage.

The body is the browser's PushSubscription.toJSON(). Idempotent on the endpoint, which must be https on a known push service (FCM, Mozilla, Apple, WNS) resolving to public addresses — anything else is 400 push_endpoint_not_allowed. The device's user agent is read from the request. Past the device limit, a new device is 429.

Authorization

headerAuthorizationBearer <token>

A personal access token (rsk_…) or a Supabase access token.

Request Body

application/json
  1. body
endpoint*string

The push service URL the browser gave: https on fcm.googleapis.com, updates.push.services.mozilla.com, web.push.apple.com or *.notify.windows.com

Match^https:\/\/.*
Formatstarts_with
Lengthlength <= 2048
expirationTime?number|null
keys*
device_name?|null

Response Body

Saved

application/json
  1. response
endpoint*string
curl -X PUT 'https://www.ressource.social/api/v1/push-subscriptions' \  -H 'Content-Type: application/json' \  -d '{  "endpoint": "string",  "keys": {    "p256dh": "string",    "auth": "string"  }}'
{  "endpoint": "string"}