Admin Push Campaigns

Send a push notification campaign to a OneSignal-defined audience

Requires at least one targeting dimension (refuses to broadcast to all users). Persists a row in push_campaigns with the audit trail and returns the OneSignal-reported recipient count.

post/api/admin/push-campaigns/send

Request

  • Base URL
    https://api.rewritelifestyle.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://api.rewritelifestyle.ai/api/admin/push-campaigns/send
  • Auth
    HTTP bearer

Request body

titlestring required

Notification heading. Max 80 chars recommended.

bodystring required

Notification body. Max 200 chars recommended.

dataobject

Optional deep-link payload delivered to the app (e.g. { screen: "Subscription" })

expectedRecipientCountnumber

Recipient count the admin saw in the preview. Used as a sanity check — if OneSignal returns a much larger audience the send is rejected.

testUserIdnumber

Send only to this one user ID, bypassing targeting entirely — for trying out a campaign before sending it to a real audience. When set, targeting may be empty.

Response

unknown required

Example response

{
  "success": true,
  "campaignId": 17,
  "recipientCount": 312,
  "onesignalNotificationId": "b98cf9..."
}

Changes

No recorded changes to this operation across all 34 revisions of this API.