FCM Token Manager
API Contract
REST
/api/v1/fcm-tokens
6 endpoints
GET
/api/v1/fcm-tokens/api/v1/fcm-tokens
List all registered FCM tokens (admin)
Public
Response Example
{
"data": [
{
"token_id": "tok-221",
"user_id": "usr-441",
"token": "fMEk9a1s:APA91bH...Zx8",
"platform": "android",
"registered_at": "2026-03-01T10:00:00Z",
"last_refreshed_at": "2026-03-20T08:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 5
}
}
GET
/api/v1/fcm-tokens/api/v1/fcm-tokens/:id
Get a single FCM token record by ID
Public
Response Example
{
"token_id": "tok-221",
"user_id": "usr-441",
"token": "fMEk9a1s:APA91bH...Zx8",
"platform": "android",
"registered_at": "2026-03-01T10:00:00Z",
"last_refreshed_at": "2026-03-20T08:00:00Z"
}
POST
/api/v1/fcm-tokens/api/v1/fcm-tokens
Register a new FCM token for a user
Public
Request Example
{
"user_id": "usr-441",
"token": "fMEk9a1s:APA91bH...Zx8",
"platform": "android"
}
Response Example
{
"token_id": "tok-250",
"user_id": "usr-441",
"token": "fMEk9a1s:APA91bH...Zx8",
"platform": "android",
"registered_at": "2026-03-26T08:00:00Z"
}
PUT
/api/v1/fcm-tokens/api/v1/fcm-tokens/:id
Refresh/update a user's FCM token
Public
Request Example
{
"new_token": "eVk3bL2t:APA91bZY...Qw4"
}
Response Example
{
"token_id": "tok-221",
"user_id": "usr-441",
"token": "eVk3bL2t:APA91bZY...Qw4",
"last_refreshed_at": "2026-03-26T09:00:00Z"
}
DELETE
/api/v1/fcm-tokens/api/v1/fcm-tokens/:id
Revoke a specific FCM token
Public
Response Example
{
"deleted": true,
"token_id": "tok-221"
}
GET
/api/v1/fcm-tokens/api/v1/fcm-tokens/user/:user_id
Get all FCM tokens registered for a user
Public
Response Example
{
"user_id": "usr-441",
"tokens": [
{
"token_id": "tok-221",
"token": "fMEk9a1s:APA91bH...Zx8",
"platform": "android",
"last_refreshed_at": "2026-03-20T08:00:00Z"
},
{
"token_id": "tok-222",
"token": "dZqP7c3m:APA91bRT...Lp2",
"platform": "ios",
"last_refreshed_at": "2026-03-18T12:00:00Z"
}
]
}