Mobile & web push

Reach apps and browsers with Firebase Cloud Messaging, Apple Push, and the Web Push (VAPID) standard.

Firebase Cloud Messaging (Android + iOS)

FieldTypeDescription
project_idreqstringFirebase project ID.
service_account_jsonreqstringService account credentials JSON (HTTP v1 API).

Apple Push (APNs)

FieldTypeDescription
team_idreqstringApple Developer team ID.
key_idreqstringAPNs auth key ID.
private_keyreqstringAPNs .p8 private key.
bundle_idreqstringApp bundle identifier.
apns_environmentstringproduction or sandbox. Defaults to production.

Web Push (VAPID)

FieldTypeDescription
vapid_public_keyreqstringVAPID public key.
vapid_private_keyreqstringVAPID private key.
vapid_subjectreqstringContact mailto: or URL.

Register device tokens

Before you can push to a device, register its token against a contact with POST /device_tokens. The contact is created from the email if it doesn’t exist yet.

FieldTypeDescription
tokenreqstringThe device/push token from FCM, APNs or the browser Push API.
emailreqstringIdentifies the contact the device belongs to.
platformreqstringios, android or web.
device_namestringOptional label shown in the UI.
app_idstringOptional app identifier.
register-device.sh
curl https://api.messy.sh/device_tokens \
  -H "Authorization: Bearer $MESSY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "ada@example.com", "platform": "ios", "token": "<device-token>" }'

Update a token with PATCH /device_tokens/{id} (for example to deactivate it) and remove one with DELETE /device_tokens/{id}. Then send with type set to mobile_push or web_push. FCM and APNs can run side by side in one environment.