push

Register or reactivate a browser push subscription for the current user.

Required JSON body fields: endpoint (str) — The push service URL from PushManager.subscribe(). auth_key (str) — Base64 auth secret from getKey('auth'). p256dh_key (str) — Base64 P-256 DH public key from getKey('p256dh').

Optional JSON body fields: browser (str) — Human-readable browser label, e.g. "Chrome 120". device_name (str) — Human-readable device label, e.g. "iPhone".

Behaviour: - If a row with the given endpoint already exists for the CURRENT user, update its keys, reactivate it, and update optional metadata. - If the endpoint exists but belongs to a DIFFERENT user, return 409 Conflict — endpoint URLs are browser-specific and must not transfer between accounts silently. - If no row exists, create a new one. - Lazily create a PushPreference row with default toggles if the user does not already have one.

Rate limited to 10 requests per minute per user (keyed by user id).

Returns 201 on success with a minimal confirmation payload. Returns 400 if required fields are missing. Returns 409 if the endpoint is already registered to a different user. Returns 429 if the caller exceeds the rate limit.

post/api/v1/push/subscribe/

Request

  • Base URL: https://api.leviathannews.xyz (the document declares no server; this is the origin it was published from)
  • URL: https://api.leviathannews.xyz/api/v1/push/subscribe/
  • Auth: one of:
    • HTTP bearer
    • API key in cookie sessionid

Response

No response body

Changes

No recorded changes to this operation across all 1 revision of this API.