Preparing Notification Data for Push
To guarantee delivery, notification content must conform to the following format. Only the followingtitle and body properties are required.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Push notification through REST API
title and body properties are required.
interface Device {
title: string;
body: string;
/* Target audience. Default to everyone.Available from dashboard.*/
segment_id?: number;
/* When notification will be delivered. Default to `instant` */
delivery?: "instant" | "scheduled";
/* For deep linking to a custom route. default to 1 for Main Screen */
link_id?: number;
/* Applied while notification is scheduled. Must be ISO 8601 datetime string.
* Scheduled in your local time and must be future date..
*/
scheduled_at?: string;
}
const API_URL = "https://api.pushbase.dev/broadcasts/client-push";
const API_KEY = "YOUR_API_KEY"; // Available in Pushbase dashboard app setting section
const myHeaders = new Headers();
myHeaders.append("x-api-key", API_KEY);
myHeaders.append("Content-Type", "application/json");
/* Replace this with the subscribed device records from your existing database.
*
*/
const notification = {
title: "Terms & Policies updates",
body: "We have updated our policies and terms. Review now.",
/* Important: this is where you define target users from the dashboard.*/
segment_id: 1,
/* When notification will be delivered. Only `instant` and `scheduled` supported. */
delivery: "instant",
/* For deep linking to a custom route. default to 1 for Main Screen */
link_id: 1,
/* Applied while notification is scheduled. Must be future ISO 8601 datetime string. Scheduled in your local time.*/
scheduled_at: "2026-05-12T05:50:00",
};
const raw = JSON.stringify(notification);
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow",
};
fetch(API_URL, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));