--- title: "DevPlace REST: Web Push Registration" description: "Registering browser and APNs push subscriptions: discovering enabled providers via push.json, fetching the public VAPID key, posting a PushSubscription, and the client-side unsubscribe model with no server endpoint." language: null framework: null category: api_design tags: - devplace - api - http-api - web-push - vapid - notifications - apns - rest - service-worker keywords: - devplace GET /push.json providers - devplace vapid public key endpoint - devplace register PushSubscription api - web push unsubscribe PushManager devplace last_updated: 2026-08-12 difficulty: intermediate version: "DevPlace (devplace.net), documented 2026-08" related: - rest_notifications.md - conventions_and_errors.md - authentication.md - README.md search_priority: normal status: published --- # DevPlace REST: Web Push Registration Push notifications are delivered by one or more providers. `webpush` is the default and implements the Web Push protocol: fetch the public VAPID key, then register a `PushSubscription` obtained from the browser's `PushManager`. `apns` delivers to an Apple Push Notification service device token and is only offered when an administrator has configured it. `GET /push.json` lists the providers that currently accept registrations. A registration body without a `provider` field is a `webpush` registration, so existing clients need no change. There is no server-side unsubscribe endpoint: unsubscription is handled entirely in the browser by calling `PushManager.unsubscribe()` on the subscription. The server stops delivering to a subscription once its push endpoint reports it as gone. These mirror the in-app [Notifications](rest_notifications.md) feed. Every endpoint follows the shared [Conventions & Errors](conventions_and_errors.md) (auth, content negotiation, pagination, status codes); see [Authentication](authentication.md) for the four ways to sign requests. ## `GET /push.json` - Get the public key Return the VAPID public key and the providers that accept registrations. *Minimal role:* Public **Sample response** ```json { "publicKey": "BASE64_VAPID_KEY", "providers": { "webpush": { "publicKey": "BASE64_VAPID_KEY" } } } ``` ## `POST /push.json` - Register a subscription Register a push subscription. Sends a welcome notification. *Minimal role:* Member **Parameters** | Name | In | Type | Required | Description | |------|----|------|----------|-------------| | `provider` | json | string | no | Provider to register with. Omit for webpush. | | `endpoint` | json | string | no | Subscription endpoint URL. Required for webpush. | | `keys` | json | string | no | Subscription keys object. Required for webpush. | | `token` | json | string | no | Hexadecimal device token. Required for apns. | > A webpush body is JSON: `{"endpoint": "...", "keys": {"p256dh": "...", "auth": "..."}}`. > An APNs body is JSON: `{"provider": "apns", "token": "..."}`. > A provider that is unknown, disabled or unconfigured returns 400. **Sample response** ```json { "registered": true } ```