REST API
Notifications & push
Web Push and FCM registration and push payload formats.
Browsers use Web Push (VAPID); native apps register an FCM token. Mute (/conversations/{id}/mute) suppresses message pushes except mentions and replies to you; silent messages arrive without sound.
Endpoints#
Web Push VAPID key
Bearer token
Public key for PushManager.subscribe({applicationServerKey}).
Parameters
No parameters.
Request
curl
curl 'https://minchatapp.com/api/push/vapid-key' \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json'
Response
HTTP 200
{
"public_key": "BIgmiEbXaxZR6tPF…example-vapid-public-key"
}
Register a Web Push subscription
Bearer token
Rate limit: 20/min
Send PushSubscription.toJSON().
Parameters
| Name | Type | Description |
|---|---|---|
subscription
required body
|
array |
PushSubscription.toJSON(). |
subscription.endpoint
required body
|
string |
Push endpoint URL. |
subscription.keys
required body
|
array |
Encryption keys. |
subscription.keys.p256dh
required body
|
string |
Public key. |
subscription.keys.auth
required body
|
string |
Auth secret. |
Request
curl
curl -X POST 'https://minchatapp.com/api/push/subscribe' \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"subscription": {"endpoint": "https://fcm.googleapis.com/fcm/send/abc", "keys": {"p256dh": "BNc…", "auth": "k1…"}}}'
Response
HTTP 200
{
"success": true
}
Remove a Web Push subscription
Bearer token
Parameters
| Name | Type | Description |
|---|---|---|
subscription
required body
|
array |
PushSubscription.toJSON(). |
subscription.endpoint
required body
|
string |
Push endpoint URL. |
Request
curl
curl -X POST 'https://minchatapp.com/api/push/unsubscribe' \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"subscription": {"endpoint": "https://fcm.googleapis.com/fcm/send/abc"}}'
Response
HTTP 200
{
"success": true
}
Register an FCM token
Bearer token
Rate limit: 20/min
Native apps (Android/desktop).
Parameters
| Name | Type | Description |
|---|---|---|
token
required body
|
string |
Token. max 512 chars
|
platform
optional body
|
string |
Client platform. max 20 chars
|
Request
curl
curl -X POST 'https://minchatapp.com/api/push/fcm-token' \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"token": "fcm-device-token", "platform": "android"}'
Response
HTTP 200
{
"success": true
}
Remove an FCM token
Bearer token
Parameters
| Name | Type | Description |
|---|---|---|
token
required body
|
string |
Token. max 512 chars
|
Request
curl
curl -X DELETE 'https://minchatapp.com/api/push/fcm-token' \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"token": "fcm-device-token"}'
Response
HTTP 200
{
"success": true
}
Send a test push
Bearer token
Rate limit: 5/10 min
Sends a test notification to all your devices.
Parameters
No parameters.
Request
curl
curl -X POST 'https://minchatapp.com/api/push/test' \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json'
Response
Responds with HTTP 200.
Push payloads (FCM data)#
All FCM values are strings.
| type | Keys |
|---|---|
message | conversation_id, message_id, sender_id, title, body, silent ("1"/"0"), mention ("1"/"0") |
reaction | conversation_id, message_id, title, body |
call | conversation_id, call_id, mode (audio/video), title (caller) |
call_answered | conversation_id, call_id |
call_ended | conversation_id, call_id, reason |
reminder | reminder_id, conversation_id, message_id, title, body |
login_code | title, body (one-time sign-in code) |
FCM data
{
"type": "message",
"conversation_id": "12",
"message_id": "4521",
"sender_id": "2",
"title": "Design team",
"body": "Boris Petrov: Build updated",
"silent": "0",
"mention": "1"
}
Web Push notifications carry title, body, the conversation id and the same type, message_id, silent, mention fields.