Skip to main content
If you are using Snowflake with OneSignal’s legacy integration, please refer to the Snowflake Legacy Integration guide.

OneSignal Snowflake integration overview


Overview

The OneSignal + Snowflake integration supports two powerful data pipelines:
  • Export: Automatically send messaging event data (push, email, SMS, in-app) from OneSignal to Snowflake for analysis and reporting.
  • Import: Sync custom user events from your Snowflake datasets to OneSignal to trigger automated Journeys and personalized messaging.
Together, these integrations give you complete control over user engagement data—powering advanced analytics and real-time behavior-driven messaging.

Export OneSignal events to Snowflake

This is currently in early access. To request access, contact [email protected] with:
  • Your company name
  • Your OneSignal organization ID
  • The app ID(s) you want to enable
Send messaging performance and engagement events (e.g., sends, opens, clicks) to Snowflake to:
  • Build custom dashboards and reports
  • Track delivery and engagement trends across channels
  • Combine OneSignal data with other business data for analysis
Requirements
  • OneSignal Professional Plan (not available on free apps)
  • Snowflake account
  • SECURITYADMIN or ACCOUNTADMIN role in Snowflake (for setup)
Setup Steps

1. Gather your Snowflake account details

Before configuring the integration, collect the following information from your Snowflake account:
  • Snowflake Host: Your account URL in the format <account_identifier>.snowflakecomputing.com
  • Database name: The database where OneSignal will write event data
  • Schema name: The schema within the database for OneSignal tables (this will be auto created by OneSignal)
  • Warehouse name: The warehouse to use for data loading operations

Snowflake account identifier location

2. Run setup script in Snowflake

Execute the following SQL script in your Snowflake warehouse to create the necessary role, user, warehouse, and database for OneSignal:
begin;

   -- create variables for user / role / warehouse / database (needs to be uppercase for objects)
   set role_name = 'ONESIGNAL_ROLE';
   set user_name = 'ONESIGNAL_USER';
   set warehouse_name = 'ONESIGNAL_WAREHOUSE';
   set database_name = 'ONESIGNAL';

   -- change role to securityadmin for user / role steps
   use role securityadmin;

   -- create role for onesignal
   create role if not exists identifier($role_name);
   grant role identifier($role_name) to role SYSADMIN;

   -- create a user for onesignal
   create user if not exists identifier($user_name)
   default_role = $role_name
   default_warehouse = $warehouse_name;

   grant role identifier($role_name) to user identifier($user_name);

   -- set binary_input_format to BASE64
   ALTER USER identifier($user_name) SET BINARY_INPUT_FORMAT = 'BASE64';

   -- set timestamp_input_format to AUTO for the user
   ALTER USER identifier($user_name) SET TIMESTAMP_INPUT_FORMAT = 'AUTO';

   -- change role to sysadmin for warehouse / database steps
   use role sysadmin;

   -- create a warehouse for onesignal
   create warehouse if not exists identifier($warehouse_name)
   warehouse_size = xsmall
   warehouse_type = standard
   auto_suspend = 60
   auto_resume = true
   initially_suspended = true;

   -- create database for onesignal
   create database if not exists identifier($database_name);

   -- grant onesignal role access to warehouse
   grant USAGE
   on warehouse identifier($warehouse_name)
   to role identifier($role_name);

   -- grant onesignal access to database
   grant CREATE SCHEMA, MONITOR, USAGE
   on database identifier($database_name)
   to role identifier($role_name);

 commit;
You can customize the variable values at the top of the script to match your naming conventions. If you’re using an existing warehouse or database, modify the script accordingly.

3. Generate key pair for authentication

OneSignal requires key-pair authentication for secure access to your Snowflake account. Follow these steps to generate and configure the keys:
1

Generate a private key

Run one of the following commands to generate a private key:Unencrypted private key (simpler, but less secure):
openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8 -nocrypt
Encrypted private key (recommended for production):
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 aes256 -inform PEM -out rsa_key.p8
If using an encrypted key, you’ll be prompted to create a passphrase. Save this passphrase securely—you’ll need it when configuring OneSignal.
2

Generate the public key

Generate the public key from your private key:
openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
3

Assign the public key to your Snowflake user

Copy the contents of the public key file (excluding the header and footer lines), then run this SQL command in Snowflake:
ALTER USER ONESIGNAL_USER SET RSA_PUBLIC_KEY='<YOUR_PUBLIC_KEY_CONTENT>';
Replace <YOUR_PUBLIC_KEY_CONTENT> with the key content (without -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines).
Store your private key file securely. You’ll need to provide it to OneSignal in the next step. Never share your private key publicly or commit it to version control.

4. Connect OneSignal

1

Activate the integration

In OneSignal, navigate to Data > Integrations > Snowflake.
2

Enter the details

  • Host: <your_account>.snowflakecomputing.com
  • Port: Optional, defaults to 443
  • Database: e.g. ONESIGNAL
  • Role: Optional, uses the user’s default role if omitted
  • User: e.g. ONESIGNAL_USER
  • Private Key: Paste the contents of your private key file (rsa_key.p8)
  • Private Key Passphrase: Optional, only if your private key is encrypted
  • Data processing location: Where data is processed before before sending it to Snowflake
3

Configure the integration

  • Sync Frequency: as often as every 15 minutes
  • Schema/Table Names: pre-set as onesignal_events_<app-id> and message_events (editable)
  • Event Types: choose which to sync—select all or just what you need
4

Select events

Select the events you care to receive in your Snowflake warehouse.
5

Complete the setup

Click Save and wait for the success confirmation
Initial data sync can take 15–30 minutes to appear in Snowflake.While you wait, send messages via push, email, in-app, or SMS to trigger the events selected.

5. View data in Snowflake

Once the initial sync completes, query your OneSignal event data:
-- View recent message events
SELECT *
FROM <your-database>.<your-schema>.message_events
ORDER BY _CREATED DESC
LIMIT 100;
If you run into issues like missing schemas, permission errors, or malformed events, contact [email protected].

Message events and properties

Message event kinds

Property: event_kind Type: String The kind of message and event (e.g. message.push.received, message.push.sent).
Message Event (OneSignal)event_kindDescription
Push Sentmessage.push.sentPush notification successfully sent.
Push Receivedmessage.push.receivedDelivered push (see Confirmed Delivery).
Push Clickedmessage.push.clickedUser clicked the push.
Push Failedmessage.push.failedDelivery failure. See message reports.
Push Unsubscribedmessage.push.unsubscribedUser unsubscribed from push.
In-App Impressionmessage.iam.displayedIn-App message shown.
In-App Clickedmessage.iam.clickedIn-App message clicked.
In-App Page Viewedmessage.iam.pagedisplayedIn-App page shown.
Email Sentmessage.email.sentEmail delivered.
Email Receivedmessage.email.receivedEmail accepted by recipient’s mail server.
Email Openedmessage.email.openedEmail opened. See Email Reports.
Email Link Clickedmessage.email.clickedLink in email clicked.
Email Unsubscribedmessage.email.unsubscribedRecipient unsubscribed.
Email Marked Spammessage.email.resporedasspamMarked as spam. See Email Deliverability.
Email Bouncedmessage.email.hardbouncedBounce due to permanent delivery failure.
Email Failedmessage.email.failedDelivery failed.
Email Suppressedmessage.email.supressedSuppressed due to suppression list.
SMS Sentmessage.sms.sentSMS sent.
SMS Deliveredmessage.sms.deliveredSMS successfully delivered.
SMS Failedmessage.sms.failedSMS failed to deliver.
SMS Undeliveredmessage.sms.undeliveredSMS rejected or unreachable.

Event data schema

For each message event generated by a user, the following metadata will be attached to the record.
Column NameTypeDescription
event_idUUIDUnique identifier for the event
event_timestampTimestampTime of event occurrence
event_kindStringThe Event Kind
subscription_device_typeStringDevice type (e.g., iOS, Android, Web, Email, SMS)
languageStringSubscription language code
versionStringIntegration version
device_osStringDevice operating system version
device_typeNumberNumeric device type
tokenStringPush token, phone number, or email
subscription_idUUIDSubscription ID
subscribedBooleanSubscription status
onesignal_idUUIDOneSignal user ID
last_activeStringLast active timestamp
sdkStringOneSignal SDK version
external_idStringExternal user ID that should match the integration user ID
app_idUUIDApp ID from OneSignal
template_idUUIDTemplate ID (if applicable)
message_idUUIDMessage batch/request ID
message_nameStringName of the message
message_titleStringMessage title (English only)
message_contentsStringTruncated message body (English only)
_created, _id, _index, _fivetran_syncedInternal useFivetran sync metadata

Notes

  • Syncs after saving/activating may take an additional 15-30 minutes to complete.
  • Deactivating may still result in one final sync after deactivation.
  • To ensure efficient data synchronization, our system automatically creates and manages staging datasets. These datasets, named with a pattern like fivetran_{two random words}_staging, temporarily store data during processing before it’s integrated into your main schema. These staging datasets are essential for maintaining a streamlined workflow and should not be deleted, as they will be automatically recreated.

Import events from Snowflake

Send behavioral event data from Snowflake to OneSignal to:
  • Trigger Journeys based on user activity
  • Personalize messaging based on behavioral data
Requirements
  • Snowflake account with warehouse access
  • Event data stored in Snowflake tables or views
  • Network connectivity from OneSignal to your Snowflake instance
  • User credentials with appropriate permissions
Setup Steps
1

Create dedicated role for OneSignal

Create a role hierarchy following Snowflake best practices:
-- Create a role for the census user
CREATE ROLE CENSUS_ROLE;

-- Ensure the sysadmin role inherits any privileges the census role is granted
GRANT ROLE CENSUS_ROLE TO ROLE SYSADMIN;
2

Create dedicated warehouse

Create a cost-optimized warehouse for OneSignal operations:
-- Create a warehouse for the census role, optimizing for cost over performance
CREATE WAREHOUSE CENSUS_WAREHOUSE WITH
    WAREHOUSE_SIZE = XSMALL
    AUTO_SUSPEND = 60
    AUTO_RESUME = TRUE
    INITIALLY_SUSPENDED = FALSE;

GRANT USAGE ON WAREHOUSE CENSUS_WAREHOUSE TO ROLE CENSUS_ROLE;
GRANT OPERATE ON WAREHOUSE CENSUS_WAREHOUSE TO ROLE CENSUS_ROLE;
GRANT MONITOR ON WAREHOUSE CENSUS_WAREHOUSE TO ROLE CENSUS_ROLE;
3

Create user and grant permissions

Create the OneSignal user and grant access to your event data:
-- Create the census user
CREATE USER CENSUS WITH
    DEFAULT_ROLE = CENSUS_ROLE
    DEFAULT_WAREHOUSE = CENSUS_WAREHOUSE
    PASSWORD = '<strong-unique-password>';

GRANT ROLE CENSUS_ROLE TO USER CENSUS;

-- Grant access to your event data (replace with your actual database/schema)
GRANT USAGE ON DATABASE "<your-database>" TO ROLE CENSUS_ROLE;
GRANT USAGE ON SCHEMA "<your-database>"."<your-schema>" TO ROLE CENSUS_ROLE;
GRANT SELECT ON ALL TABLES IN SCHEMA "<your-database>"."<your-schema>" TO ROLE CENSUS_ROLE;
GRANT SELECT ON FUTURE TABLES IN SCHEMA "<your-database>"."<your-schema>" TO ROLE CENSUS_ROLE;
GRANT SELECT ON ALL VIEWS IN SCHEMA "<your-database>"."<your-schema>" TO ROLE CENSUS_ROLE;
GRANT SELECT ON FUTURE VIEWS IN SCHEMA "<your-database>"."<your-schema>" TO ROLE CENSUS_ROLE;
4

Create bookkeeping database (Advanced Sync Engine)

Create a private database for OneSignal’s sync state management:
-- Create a private bookkeeping database
CREATE DATABASE "CENSUS";
GRANT ALL PRIVILEGES ON DATABASE "CENSUS" TO ROLE CENSUS_ROLE;

CREATE SCHEMA "CENSUS"."CENSUS";
GRANT ALL PRIVILEGES ON SCHEMA "CENSUS"."CENSUS" TO ROLE CENSUS_ROLE;
GRANT CREATE STAGE ON SCHEMA "CENSUS"."CENSUS" TO ROLE CENSUS_ROLE;
Skip this step if using Basic Sync Engine or read-only mode.
5

Configure authentication

Set up key-pair authentication (recommended) for enhanced security:
  1. Generate a public/private key pair following Snowflake’s documentation
  2. Configure the public key on your Snowflake user
  3. Use the private key in OneSignal’s connection settings
Alternatively, you can use password authentication (deprecated - will be blocked November 2025).
6

Connect to OneSignal

In OneSignal, go to Data > Integrations and click Add Integration.Select Snowflake and provide the following connection details:
  • Account Name: Your Snowflake account identifier (e.g., abc123.us-east-1)
  • Warehouse: CENSUS_WAREHOUSE
  • User: CENSUS
  • Database: Your event data database name
  • Schema: Your event data schema name
  • Authentication: Key-pair (provide private key and optional passphrase)

Event data mapping

Map your to OneSignal’s custom events format:
OneSignal FieldDescriptionRequired
nameevent_nameEvent identifierYes
external_iduser_idUser identifierYes
timestampevent_timestampWhen event occurredNo
propertiesevent_dataNo

Example Event Table Schema

-- Example Snowflake event table
CREATE TABLE analytics.user_events (
    event_id STRING,
    event_name STRING NOT NULL,
    user_id STRING NOT NULL,
    event_timestamp TIMESTAMP_TZ DEFAULT CURRENT_TIMESTAMP(),
    event_properties VARIANT,
    session_id STRING,
    device_type STRING
);

SQL Query Mode

Write custom SQL queries to transform your event data:
-- Example: Recent high-value events
SELECT
    event_name,
    user_id,
    event_timestamp,
    event_properties
FROM analytics.user_events
WHERE event_timestamp >= DATEADD(day, -7, CURRENT_TIMESTAMP())
    AND event_properties:value::NUMBER > 100
ORDER BY event_timestamp DESC;

Advanced configuration

Managing Warehouse Costs

  • Use X-Small warehouse size for cost optimization
  • Configure auto-suspend (60 seconds) and auto-resume
  • Schedule syncs during off-peak hours
  • Consider sharing warehouse with other batch processing systems

Live Syncs Support

For real-time event processing, enable change tracking on your event tables:
ALTER TABLE "analytics"."user_events" SET CHANGE_TRACKING = TRUE;

Network Security

If using Snowflake’s Allowed IPs network policy, add OneSignal’s IP addresses to your allowlist. Contact OneSignal support for the current IP ranges.

Limitations

  • Complex analytical queries may impact warehouse performance and costs
  • User/Password authentication will be deprecated November 2025
  • The CENSUS database is reserved for OneSignal operations only

FAQ

Which authentication method should I use?

Use Key-pair authentication (recommended). User/Password authentication will be blocked by Snowflake starting November 2025.

Can I use an existing warehouse?

Yes, you can share a warehouse with other batch processing systems like dbt or Fivetran to optimize costs. Ensure the warehouse has sufficient capacity for your event processing needs.

How can I optimize costs?

  • Use X-Small warehouse size
  • Configure aggressive auto-suspend (60 seconds)
  • Schedule syncs during off-peak hours
  • Use hourly/daily syncs instead of continuous syncing