Help
Help
Loading help article
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.
| 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. |
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.
DELETE /api/push/unregister
Content-Type: application/json
{ "token": "<base64-or-hex device token>" }
Removes the registration. Idempotent: unregistering an unknown token returns 200.