Push
Push notifications — transactional sends to users, segments or filters.
// access
client.pushPush notifications — transactional sends to users, segments or filters.
Campaigns, provider credentials, segments and templates live in the console; this resource is for one-off, event-driven sends from your backend. Delivered over FCM / APNs / Web Push.
Push
classclient.push
Extends Resource.
notification()
methoddef notification() -> PushBuilderStart a fluent notification — the recommended way to send.
Returns PushBuilder
send()
methoddef send(distinct_ids, message=None, *, title=None, body=None, image_url=None, data=None, options=None) -> Dict[str, Any]Send to specific users across every device each has registered.
client.push.send(["user_1", "user_2"], title="Welcome 👋")
client.push.send(["user_1"], {"title": "Hi", "data": {"screen": "/home"}})Parameters
Prop
Type
Returns Dict[str, Any]
send_to_user()
methoddef send_to_user(distinct_id, message=None, **kwargs) -> Dict[str, Any]Send to one user.
Parameters
Prop
Type
Returns Dict[str, Any]
send_to_segments()
methoddef send_to_segments(segment_ids, message=None, **kwargs) -> Dict[str, Any]Send to the union of saved segments.
Parameters
Prop
Type
Returns Dict[str, Any]
send_raw()
methoddef send_raw(payload) -> Dict[str, Any]Send a fully assembled payload (what the builder calls).
Returns {sent, failed, recipients}.
Parameters
Prop
Type
Returns Dict[str, Any]
register_token()
methoddef register_token(token, platform, *, provider=None, distinct_id=None, device_key=None, app_version=None, os_type=None, os_version=None, lang=None, tags=None) -> Dict[str, Any]Register or refresh a device token.
The client SDKs normally do this; it's here for server-driven and
bring-your-own-token flows. platform is ios | android | web.
Parameters
Prop
Type
Returns Dict[str, Any]
unregister()
methoddef unregister(token) -> Dict[str, Any]Stop delivering to a token (logout, uninstall).
Parameters
Prop
Type
Returns Dict[str, Any]
opened()
methoddef opened(notification_id, **options) -> Dict[str, Any]Record that a notification was opened (delivery analytics).
Parameters
Prop
Type
Returns Dict[str, Any]
