Help
Help
Push Notifications
Register device tokens so the server can deliver push notifications via APNs (iOS) or other push providers. These endpoints support session cookies for the web app and Bearer tokens for native clients.
Endpoint table
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/push/register | Session or Bearer | Register or update a device token for the current user. |
| DELETE | /api/push/unregister | Session or Bearer | Unregister a device token. |
Registering a device
POST /api/push/register
Authorization: Bearer 3f1c9e...<64 hex chars>...a8
Content-Type: application/json
{
"token": "<base64-or-hex device token>",
"platform": "ios",
"environment": "production"
}
| Field | Type | Required | Notes |
|---|---|---|---|
token | string | yes | The provider-issued device token. |
platform | string | yes | ios or android. |
environment | string | no | sandbox or production. Inferred from server config when omitted. |
Response (200): { "registered": true }
If the device token already exists for the current user, the existing record is updated rather than duplicated.
Unregistering
DELETE /api/push/unregister
Content-Type: application/json
{ "token": "<base64-or-hex device token>" }
Removes the registration. Idempotent: unregistering an unknown token returns 200.
Notes
- Re-register the device on every app launch in case the token has rotated.
- The server delivers a push notification for events that also generate an in-app notification (new follower, reply, dig, etc.), subject to the user's per-event delivery preferences in Users and Profile settings.
- A user who is signed in on multiple devices receives the push on all of them.
Related
- Notifications: the in-app notification tray and per-event delivery preferences.
- Users and Profile: where notification delivery preferences are stored.
- API overview: base URL, authentication at a glance, and response conventions.
- API explorer: try push notification endpoints live with the interactive Swagger console.