Register a push device

POST/push/devices

Store an FCM registration token so the user can receive push notifications for new chat messages. Registration is idempotent on token, so re-sending the same token does not create duplicates. If the token already belongs to another user (device hand-off or account switch), ownership moves to the authenticated user. A previously disabled token is re-enabled.

AuthLogin required

Request body

tokenstringrequired

FCM registration token.

platformstringrequired

One of IOS / ANDROID / WEB.

localestring

Locale for notification text (e.g. ja / en). Falls back to the user's language settings when omitted.

Notes

Devices are scoped to the app (OAuth client) that registered them. Devices registered by other apps are neither listed nor deletable.

Revoking the app's authorization also deletes the devices it registered, so push notifications stop.

When FCM reports a token as unregistered, the device is automatically excluded from future deliveries.

Response

FieldTypeDescription
idstringDevice ID, used when unregistering.
tokenMaskedstringOnly the tail of the token. The full token is never returned.
platformstringIOS / ANDROID / WEB.
clientIdstring | nullOAuth client ID that registered the device.
localestring | nullLocale for notification text.
lastUsedAtstring | nullLast successful delivery (ISO 8601).
createdAtstringCreated at (ISO 8601).
updatedAtstringUpdated at (ISO 8601).
Request
curl https://api.4s.link/push/devices \
-X POST \
-H "Authorization: Bearer 4s_at_..." \
-H "Content-Type: application/json" \
-d '{
"token": "fcm-registration-token-...",
"platform": "IOS",
"locale": "ja"
}'
Example response
{
"id": "b7c1a2d3-...",
"tokenMasked": "...9fA2xQ",
"platform": "IOS",
"clientId": "a1b2c3d4-...",
"locale": "ja",
"lastUsedAt": null,
"createdAt": "2026-08-18T09:00:00.000Z",
"updatedAt": "2026-08-18T09:00:00.000Z"
}