Skip to content
DunSocial Docs

Devices and account

Register push devices and manage account deletion.

Register a push device

POST /api/user/devices

curl -X POST https://api.dunsocial.com/api/user/devices \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
  "fcmToken": "DEVICE_FCM_TOKEN",
  "platform": "ios",
  "deviceName": "iPhone",
  "appVersion": "1.0.0"
}'

platform is "ios" or "android".

Unregister with DELETE /api/user/devices/:token (URL-encode the FCM token).

For listing devices and notification status, see Notifications.

Account deletion plan

Before deleting an account, check impact:

GET /api/user/account/deletion-plan

Returns owned shared workspaces, solo workspaces, memberships, whether you can delete now, and a blocked reason if not.

Delete account

DELETE /api/user/account

Hard-deletes the user after invariants pass. Blocked while you own any workspace that still has other members — transfer ownership or close those workspaces first.

Solo-owned workspaces are closed as part of the flow.

Legacy MCP tokens (do not use for new setups)

Assistants should connect with OAuth via MCP. The endpoints below are a legacy fallback (session only) and are not exposed in Settings → MCP:

Method Path Notes
POST /api/user/mcp-token { workspaceId } → token + expiry
GET /api/user/mcp-tokens Metadata only (no secrets)
DELETE /api/user/mcp-tokens/:id Revoke