# OneSignal

> Manage OneSignal users, subscriptions, segments and message templates, and read notifications, clicks and deliveries.

App · 18 actions. Web page: https://docs.lodol.com/docs/integrations/onesignal

## Actions

### Add subscription

Add an email address or phone number to an existing user so you can message them there.

**Inputs**

- User ID (`alias_id`, text, required): The user's id, of the kind chosen in 'Find the user by'. An external ID is the id your own system uses for them.
- Type (`subscription_type`, text, required): Whether this is an email address or a phone number. One of: `Email` (Email address), `SMS` (Phone number (SMS)).
- Email or phone number (`token`, text, required): The email address, or the phone number with its country code, like +15555555555.
- Find the user by (`alias_label`, text): Which id you are giving for the user. Defaults to your own external ID. One of: `external_id` (External ID (your own user id) (default)), `onesignal_id` (OneSignal ID).
- Enabled (`enabled`, true/false): Whether they can be messaged. Defaults to on.

**Outputs**

- `subscription` (object): The new subscription

**Example output**

```json
{
  "subscription": {
    "app_id": "11111111-2222-4333-8444-555555555555",
    "app_version": "",
    "device_model": "",
    "device_os": "",
    "enabled": true,
    "id": "2c44505f-9b3d-4726-8b92-982807e42f38",
    "notification_types": 1,
    "sdk": "",
    "session_count": 0,
    "token": "jo@example.com",
    "type": "Email"
  }
}
```

### Add user alias

Give a user another id of your own, such as a CRM id, so you can find them by it later.

**Inputs**

- User ID (`alias_id`, text, required): The user's id, of the kind chosen in 'Find the user by'. An external ID is the id your own system uses for them.
- Alias name (`new_label`, text, required): What kind of id this is, such as crm_id.
- Alias value (`new_id`, text, required): The id itself.
- Find the user by (`alias_label`, text): Which id you are giving for the user. Defaults to your own external ID. One of: `external_id` (External ID (your own user id) (default)), `onesignal_id` (OneSignal ID).

**Outputs**

- `identity` (object): All of the user's ids, by label

**Example output**

```json
{
  "identity": {
    "crm_id": "c-1",
    "external_id": "customer-1234",
    "onesignal_id": "15e4b24f-6d35-4258-8141-2b0da33169ed"
  }
}
```

### Create or update user

Create a user by your own external ID, with tags and an email address or phone number to message. If a user already has that external ID, they are updated instead.

**Inputs**

- External ID (`external_id`, text, required): The id your own system uses for this user.
- Email address (`email`, text): Adds an email subscription so you can email them.
- Phone number (`phone_number`, text): Adds an SMS subscription. Include the country code, like +15555555555.
- Tags (`tags`, object): Your own keys and values to keep on the user, for segments and personalised messages. Set a tag to an empty value to remove it.
- Language (`language`, text): The user's language code, such as en, fr or pt-BR.
- Country (`country`, text): The user's two-letter country code, such as US.
- Time zone (`timezone_id`, text): The user's time zone, such as America/New_York.
- Other IDs (`aliases`, object): More ids for the user, each with a name, such as a CRM id.

**Outputs**

- `external_id` (text): The user's external ID, empty if none
- `identity` (object): All of the user's ids, by label
- `onesignal_id` (text): The user's OneSignal ID
- `properties` (object): Tags, language, country and time zone
- `subscriptions` (list): The user's subscriptions

**Example output**

```json
{
  "external_id": "customer-1234",
  "identity": {
    "external_id": "customer-1234",
    "onesignal_id": "15e4b24f-6d35-4258-8141-2b0da33169ed"
  },
  "onesignal_id": "15e4b24f-6d35-4258-8141-2b0da33169ed",
  "properties": {
    "country": "US",
    "language": "en",
    "tags": {
      "plan": "pro"
    }
  },
  "subscriptions": [
    {
      "app_id": "11111111-2222-4333-8444-555555555555",
      "app_version": "",
      "device_model": "",
      "device_os": "",
      "enabled": true,
      "id": "2c44505f-9b3d-4726-8b92-982807e42f38",
      "notification_types": 1,
      "sdk": "",
      "session_count": 0,
      "token": "jo@example.com",
      "type": "Email"
    }
  ]
}
```

### Create template

Create a reusable push, email or SMS message template. Fill in the fields that fit the channel you choose.

**Inputs**

- Name (`name`, text, required): The template's name, shown in OneSignal.
- Channel (`channel`, text): What the template sends. Defaults to push. One of: `push`, `email`, `sms`.
- Message (`message`, text): The text of a push or SMS template.
- Title (`heading`, text): The title of a push template.
- Subject (`subject`, text): The subject line of an email template.
- Body (`body`, text): The content of an email template, as HTML.
- Preview text (`preheader`, text): The short text shown after the subject in an inbox.
- Link (`url`, text): A web address a push template opens when tapped.

**Outputs**

- `template` (object): The template with its content

**Example output**

```json
{
  "template": {
    "channel": "push",
    "content": {
      "contents": {
        "en": "Your order has shipped."
      },
      "headings": {
        "en": "Shipped"
      }
    },
    "created_at": "2026-11-13T18:17:36.771Z",
    "id": "6dbb3101-c1e3-4ded-aae6-f74a3b0b61b5",
    "name": "Order shipped",
    "updated_at": "2026-11-13T18:17:36.779Z"
  }
}
```

### Delete subscription

Delete one subscription. The user and their others stay.

**Inputs**

- Subscription ID (`subscription_id`, text, required): The subscription's id, from 'Get user' (each entry in its subscriptions) or 'Add subscription'.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `subscription_id` (text): The subscription deleted

**Example output**

```json
{
  "deleted": true,
  "subscription_id": "2c44505f-9b3d-4726-8b92-982807e42f38"
}
```

### Delete template

Delete a template. Messages already sent from it are not affected.

**Inputs**

- Template (`template_id`, text, required): The template. Pick one, or give its id from an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `template_id` (text): The template deleted

**Example output**

```json
{
  "deleted": true,
  "template_id": "6dbb3101-c1e3-4ded-aae6-f74a3b0b61b5"
}
```

### Delete user

Delete a user and all of their subscriptions. This cannot be undone.

**Inputs**

- User ID (`alias_id`, text, required): The user's id, of the kind chosen in 'Find the user by'. An external ID is the id your own system uses for them.
- Find the user by (`alias_label`, text): Which id you are giving for the user. Defaults to your own external ID. One of: `external_id` (External ID (your own user id) (default)), `onesignal_id` (OneSignal ID).

**Outputs**

- `alias_id` (text): The id the user was found by
- `deleted` (true/false): Always true once deleted
- `onesignal_id` (text): The deleted user's OneSignal ID

**Example output**

```json
{
  "alias_id": "customer-1234",
  "deleted": true,
  "onesignal_id": "15e4b24f-6d35-4258-8141-2b0da33169ed"
}
```

### Delete user alias

Remove one of a user's extra ids. Their OneSignal ID stays.

**Inputs**

- User ID (`alias_id`, text, required): The user's id, of the kind chosen in 'Find the user by'. An external ID is the id your own system uses for them.
- Alias name (`label_to_remove`, text, required): The kind of id to remove, such as crm_id.
- Find the user by (`alias_label`, text): Which id you are giving for the user. Defaults to your own external ID. One of: `external_id` (External ID (your own user id) (default)), `onesignal_id` (OneSignal ID).

**Outputs**

- `identity` (object): The user's ids that remain, by label

**Example output**

```json
{
  "identity": {
    "external_id": "customer-1234",
    "onesignal_id": "15e4b24f-6d35-4258-8141-2b0da33169ed"
  }
}
```

### Get app

Get the connected OneSignal app: its name, how many users can receive messages, and which channels (push, email, SMS) are on.

**Inputs**: None.

**Outputs**

- `app` (object): The connected app

**Example output**

```json
{
  "app": {
    "channels": {
      "push": {
        "enabled": true,
        "platforms": [
          "ios"
        ]
      }
    },
    "created_at": "2026-11-12T20:26:37.710Z",
    "id": "11111111-2222-4333-8444-555555555555",
    "messageable_players": 98,
    "name": "Lodol App",
    "organization_id": "22222222-3333-4444-8555-666666666666",
    "players": 120,
    "updated_at": "2026-11-12T20:26:37.772Z"
  }
}
```

### Get outcomes

Get totals for clicks, confirmed deliveries, unsubscribes and sessions over the last hour, day or month. OneSignal's Free plan reports clicks only; the others need a paid plan.

**Inputs**

- Outcomes (`outcomes`, list): What to total. Defaults to clicks. One or more of: `os__click.count` (Clicks), `os__confirmed_delivery.count` (Confirmed deliveries), `os__unsubscribed.count` (Unsubscribes), `os__session_duration.sum` (Time spent in the app (seconds)), `os__session_duration.count` (Sessions).
- Period (`time_range`, text): How far back to count. Defaults to the last day. One of: `1h` (Last hour), `1d` (Last day (default)), `1mo` (Last month).
- Attributed to (`attribution`, text): Count outcomes that came directly from a message, were only influenced by one, or neither. Defaults to all. One of: `total` (Total (default)), `direct`, `influenced`, `unattributed`.

**Outputs**

- `count` (number): How many totals there are
- `outcomes` (list): One total per outcome asked for

**Example output**

```json
{
  "count": 1,
  "outcomes": [
    {
      "aggregation": "count",
      "id": "os__click",
      "value": 14
    }
  ]
}
```

### Get template

Get one template with its full content.

**Inputs**

- Template (`template_id`, text, required): The template. Pick one, or give its id from an earlier step.

**Outputs**

- `template` (object): The template with its content

**Example output**

```json
{
  "template": {
    "channel": "push",
    "content": {
      "contents": {
        "en": "Your order has shipped."
      },
      "headings": {
        "en": "Shipped"
      }
    },
    "created_at": "2026-11-13T18:17:36.771Z",
    "id": "6dbb3101-c1e3-4ded-aae6-f74a3b0b61b5",
    "name": "Order shipped",
    "updated_at": "2026-11-13T18:17:36.779Z"
  }
}
```

### Get user

Get a user by their external ID or OneSignal ID, with their tags, language, ids and every subscription.

**Inputs**

- User ID (`alias_id`, text, required): The user's id, of the kind chosen in 'Find the user by'. An external ID is the id your own system uses for them.
- Find the user by (`alias_label`, text): Which id you are giving for the user. Defaults to your own external ID. One of: `external_id` (External ID (your own user id) (default)), `onesignal_id` (OneSignal ID).

**Outputs**

- `external_id` (text): The user's external ID, empty if none
- `identity` (object): All of the user's ids, by label
- `onesignal_id` (text): The user's OneSignal ID
- `properties` (object): Tags, language, country and time zone
- `subscriptions` (list): The user's subscriptions

**Example output**

```json
{
  "external_id": "customer-1234",
  "identity": {
    "external_id": "customer-1234",
    "onesignal_id": "15e4b24f-6d35-4258-8141-2b0da33169ed"
  },
  "onesignal_id": "15e4b24f-6d35-4258-8141-2b0da33169ed",
  "properties": {
    "country": "US",
    "language": "en",
    "tags": {
      "plan": "pro"
    }
  },
  "subscriptions": [
    {
      "app_id": "11111111-2222-4333-8444-555555555555",
      "app_version": "",
      "device_model": "",
      "device_os": "",
      "enabled": true,
      "id": "2c44505f-9b3d-4726-8b92-982807e42f38",
      "notification_types": 1,
      "sdk": "",
      "session_count": 0,
      "token": "jo@example.com",
      "type": "Email"
    }
  ]
}
```

### List notifications

List the app's notifications, newest first, with their delivery counts. Gets one page; to see more, run it again with 'Skip'.

**Inputs**

- Page size (`limit`, number): How many to return, 1 to 50. OneSignal's default is 50. From 1 to 50.
- Skip (`offset`, number): How many to skip, to get a later page. Defaults to none. At least 0.
- Kind (`message_type`, text): Only messages made in the dashboard, by API, or automated. One of: `0` (Dashboard messages), `1` (API messages), `3` (Automated messages).

**Outputs**

- `count` (number): How many are in this page
- `limit` (number): The page size used
- `notifications` (list): The notifications
- `offset` (number): Where this page starts
- `total_count` (number): How many there are in all

**Example output**

```json
{
  "count": 1,
  "limit": 50,
  "notifications": [
    {
      "app_id": "11111111-2222-4333-8444-555555555555",
      "canceled": false,
      "completed_at": 1794593770,
      "contents": {
        "en": "Your order has shipped."
      },
      "converted": 14,
      "data": {},
      "email_subject": "",
      "errored": 0,
      "excluded_segments": [],
      "failed": 2,
      "headings": {
        "en": "Shipped"
      },
      "id": "b8f1c2de-5a43-4c8e-9a52-1d7b5d0b6c11",
      "included_segments": [
        "Subscribed Users"
      ],
      "name": "Order shipped",
      "platform_delivery_stats": {},
      "queued_at": 1794593763,
      "received": 98,
      "send_after": 1794593763,
      "successful": 120,
      "template_id": "",
      "url": "https://example.com/orders/1"
    }
  ],
  "offset": 0,
  "total_count": 1
}
```

### List segments

List the app's segments (groups of users that messages can be sent to), including OneSignal's built-in ones.

**Inputs**: None.

**Outputs**

- `count` (number): How many are in this page
- `limit` (number): The page size used
- `offset` (number): Where this page starts
- `segments` (list): The segments
- `total_count` (number): How many there are in all

**Example output**

```json
{
  "count": 1,
  "limit": 300,
  "offset": 0,
  "segments": [
    {
      "app_id": "11111111-2222-4333-8444-555555555555",
      "created_at": "2026-11-12T20:26:37.729Z",
      "description": "",
      "id": "f74c400d-af2b-4e27-b1c3-07c2f3a15d88",
      "is_active": true,
      "name": "Total Subscriptions",
      "read_only": false,
      "source": "default",
      "updated_at": "2026-11-12T20:26:37.729Z"
    }
  ],
  "total_count": 1
}
```

### List templates

List the app's message templates, optionally only push, email or SMS. Gets one page; to see more, run it again with 'Skip'.

**Inputs**

- Page size (`limit`, number): How many to return, 1 to 50. OneSignal's default is 50. From 1 to 50.
- Skip (`offset`, number): How many to skip, to get a later page. Defaults to none. At least 0.
- Channel (`channel`, text): Only templates for this channel. One of: `push`, `email`, `sms`.

**Outputs**

- `count` (number): How many are in this page
- `limit` (number): The page size used
- `offset` (number): Where this page starts
- `templates` (list): The templates
- `total_count` (number): How many there are in all

**Example output**

```json
{
  "count": 1,
  "limit": 50,
  "offset": 0,
  "templates": [
    {
      "channel": "push",
      "created_at": "2026-11-13T18:17:36.771Z",
      "id": "6dbb3101-c1e3-4ded-aae6-f74a3b0b61b5",
      "name": "Order shipped",
      "updated_at": "2026-11-13T18:17:36.779Z"
    }
  ],
  "total_count": 1
}
```

### Update subscription

Change a subscription's email address or phone number, or turn it on or off.

**Inputs**

- Subscription ID (`subscription_id`, text, required): The subscription's id, from 'Get user' (each entry in its subscriptions) or 'Add subscription'.
- Email or phone number (`token`, text): The new address or number. Leave empty to keep it.
- Enabled (`enabled`, true/false): Turn it on or off. Leave empty to keep it.

**Outputs**

- `enabled` (true/false): The new state, if you gave one
- `subscription_id` (text): The subscription changed
- `token` (text): The new address or number, if you gave one
- `updated` (true/false): Always true once changed

**Example output**

```json
{
  "enabled": true,
  "subscription_id": "2c44505f-9b3d-4726-8b92-982807e42f38",
  "token": "jo@example.com",
  "updated": true
}
```

### Update template

Rename a template or change its content. Fields you leave empty stay as they are.

**Inputs**

- Template (`template_id`, text, required): The template. Pick one, or give its id from an earlier step.
- Name (`name`, text): A new name. Leave empty to keep it.
- Message (`message`, text): The text of a push or SMS template.
- Title (`heading`, text): The title of a push template.
- Subject (`subject`, text): The subject line of an email template.
- Body (`body`, text): The content of an email template, as HTML.
- Preview text (`preheader`, text): The short text shown after the subject in an inbox.
- Link (`url`, text): A web address a push template opens when tapped.

**Outputs**

- `template` (object): The template with its content

**Example output**

```json
{
  "template": {
    "channel": "push",
    "content": {
      "contents": {
        "en": "Your order has shipped."
      },
      "headings": {
        "en": "Shipped"
      }
    },
    "created_at": "2026-11-13T18:17:36.771Z",
    "id": "6dbb3101-c1e3-4ded-aae6-f74a3b0b61b5",
    "name": "Order shipped",
    "updated_at": "2026-11-13T18:17:36.779Z"
  }
}
```

### Update user

Change a user's tags, language, country or time zone. Fields you leave empty stay as they are.

**Inputs**

- User ID (`alias_id`, text, required): The user's id, of the kind chosen in 'Find the user by'. An external ID is the id your own system uses for them.
- Find the user by (`alias_label`, text): Which id you are giving for the user. Defaults to your own external ID. One of: `external_id` (External ID (your own user id) (default)), `onesignal_id` (OneSignal ID).
- Tags (`tags`, object): Your own keys and values to keep on the user, for segments and personalised messages. Set a tag to an empty value to remove it.
- Language (`language`, text): The user's language code, such as en, fr or pt-BR.
- Country (`country`, text): The user's two-letter country code, such as US.
- Time zone (`timezone_id`, text): The user's time zone, such as America/New_York.

**Outputs**

- `alias_id` (text): The id the user was found by
- `properties` (object): The properties OneSignal now holds
- `updated` (true/false): Always true once changed

**Example output**

```json
{
  "alias_id": "customer-1234",
  "properties": {
    "language": "en",
    "tags": {
      "plan": "pro"
    }
  },
  "updated": true
}
```
