Push Notifications

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 il_tok_...
Content-Type: application/json

{
  "deviceToken": "<base64-or-hex device token>",
  "platform": "ios",
  "appId": "com.example.interlinedlist"
}
FieldTypeRequiredNotes
deviceTokenstringyesThe provider-issued device token.
platformstringyesios (more platforms may be added).
appIdstringnoBundle identifier. Useful when supporting multiple app variants.

Response (200): { "ok": true, "deviceId": "..." }

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

{ "deviceToken": "<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.