Skip to main content
All CollectionsGetting startedUsing Batch APIs
How can I send event-based notifications?
How can I send event-based notifications?

You can use the Transactional API to send push notifications to specific user/device IDs in real-time.

Baptiste avatar
Written by Baptiste
Updated over 7 months ago

Event-based notifications allow you to reach specific users each time an event is triggered in your back end. ou can send these notifications using the Transactional API and targeting up to 10K IDs per call.

As described in the above example, you need to write server-side code to:

  1. Monitor changes in your back-end or your Firebase database.

  2. Trigger a call to the Transactional API targeting one or several IDs.

A small NodeJS or PHP script can do the job perfectly if you are familiar with those technologies.

There are three types of IDs you can target with the Transactional API:

  • Custom user ID: If your app has a login system, Batch can associate several push tokens to a single user ID. This allows you to use the Transactional API with your own IDs, regardless of the OS of the user (know more here: iOS / Android / Cordova / Web).

  • Installation ID: In case your app doesn't have a login system or you don't want to share your user IDs with Batch, you can use the Installation ID. This anonymized ID is generated automatically by Batch and offers the same advantages as custom IDs (know more here).

  • Device token: We recommend against using push tokens with the transactional API. Push tokens are linked to a specific device and OS. They also change on Android and iOS when users reinstall your app.

Batch provides a simple debug tool that lets the list of all the targeted push tokens for any given API call to the Transactional API. Go to ⚙️ Settings → Debug, select "Transactional" and input the token generated by the API on each successful call:

🚧 Important note: Batch manages iOS and Android separately. You will need to call our APIs twice if your app has an iOS and an Android version.


This article belongs to Batch's FAQ. Need more help? Find insightful articles, documentation, case & market studies, guides, and even more in our website's Resources section on batch.com and our blog.

Did this answer your question?