View as Markdown
OneSignal (REST API) icon

OneSignal (REST API) ACTION

Create Notification

Create a notification. See docs here
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's OneSignal (REST API) account once, then configure and run Create Notification from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "onesignal_rest_api-create-notification",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    onesignal_rest_api: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    included_segments: ["Included Segments"],
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Notification inputs
Property Type Description
name Name string
The name of the campaign
Optional
included_segments Included Segments string[]
The segment names you want to target. E.g. ["Active Users", "Inactive Users"]
Optional
contents Contents object
The notification's content (excluding the title), a map of language codes to text for each language. E.g. {"en": "English Message", "es": "Spanish Message"}
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
onesignal_rest_api-create-notification
Version
0.2.0
App
OneSignal (REST API)
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes