Skip to content

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#

GET /api/push/vapid-key #

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"
}
POST /api/push/subscribe #

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
}
POST /api/push/unsubscribe #

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
}
POST /api/push/fcm-token #

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
}
DELETE /api/push/fcm-token #

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
}
POST /api/push/test #

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.

typeKeys
messageconversation_id, message_id, sender_id, title, body, silent ("1"/"0"), mention ("1"/"0")
reactionconversation_id, message_id, title, body
callconversation_id, call_id, mode (audio/video), title (caller)
call_answeredconversation_id, call_id
call_endedconversation_id, call_id, reason
reminderreminder_id, conversation_id, message_id, title, body
login_codetitle, 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.