Skip to navigation

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 token or userId must 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 token field
  • Send to all user devices: Provide userId field (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.
titlestringRequired
bodystringRequired
tokenstringOptional
userIdstringOptional
dataobjectOptional
imageUrlstringOptional
clickActionstringOptional
badgedoubleOptional
soundstringOptional
priority"high" or "normal"Optional
timeToLivedoubleOptional

Response

This endpoint returns an object.
successboolean
dataobjectOptional
errorobjectOptional