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

MethodPathAuthDescription
POST/api/push/registerSession or BearerRegister or update a device token for the current user.
DELETE/api/push/unregisterSession or BearerUnregister 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"
}
FieldTypeRequiredNotes
tokenstringyesThe provider-issued device token.
platformstringyesios or android.
environmentstringnosandbox 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.
  • 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.