Send push notification
Send a push notification to a device token or all devices of a user.
Features:
- Send to a specific device token OR all devices of a userId
- Support for Android, iOS, and Web platforms
- Rich notifications with images, custom data, and actions
- Priority and TTL settings
- Badge and sound customization
- Automatically saves notification to database
Target Options:
- token: Send to a specific device token (optional)
- userId: Send to all registered devices of a user (optional)
- At least one of
tokenoruserIdmust be provided
Authentication:
- Requires valid Bearer token
- Test tokens available for development:
test-jwt-token,agent-jwt-token
Platform Support:
- Android: FCM with custom sounds, click actions, and TTL
- iOS: APNs with badge, sound, and custom payload
- Web: Web Push with icons and click actions
Examples:
- Send to specific device: Provide
tokenfield - Send to all user devices: Provide
userIdfield (fetches all tokens from database) - Rich notification: Include image, custom data, and click action
- High priority: Set priority to “high” for time-sensitive notifications
Authentication
AuthorizationBearer
JWT token for authentication. Use ‘test-jwt-token’ for development.
Request
This endpoint expects an object.
title
body
token
userId
data
imageUrl
clickAction
badge
sound
priority
timeToLive
Response
This endpoint returns an object.
success
data
error

