Database, DMP, & CRM integration

Linking your database user data with OneSignal

Connecting OneSignal to your own database, CRM, or data platform unlocks powerful ways to personalize, automate, and scale messaging. Whether you're using Salesforce, a custom DMP, or any internal user system, integration lets you:

  • Send time-sensitive, personalized notifications based on live data.
  • Sync and store relevant user user message data between systems.
  • Use your database as the source of truth while leveraging OneSignal’s delivery and targeting capabilities

This guide will walk through common use cases, setup, and integration methods.



Benefits of Database integration

Personalized messaging at scale

Use customer data stored in your database to personalize messages. For example:

  • Set Tags of user data to store in OneSignal and include in your message.
  • Use custom_data in our Create message API to inject data without storing it as a tag.

More details in our Message Personalization docs.

Triggering time-sensitive messages

Trigger push, email, and SMS when something happens in your system. Examples:

  • New order placed
  • Subscription about to expire
  • Customer hits a usage milestone

Use our Create message API with aliases or filters to target all the right user at the right time.

Centralized user identity via External ID & Aliases

OneSignal supports:

  • Setting an external_id as a unique user identifier across systems.
  • Add up to 10 more custom aliases (e.g., crm_id, facebook_id) per user.

User our SDK's login method to set the External ID on your web and mobile Subscriptions. You can also create email and SMS Subscriptions via our SDK or the Create user or Create subscription (by alias) APIs.

This ensures accurate targeting, even across devices or platforms. We recommend reviewing our docs on Users and Subscriptions.


Data flow: OneSignal ↔ your Database

To sync user data between systems, it is highly recommended to use the External ID for your user identifier. You can then add custom aliases in addition to the External ID. Email addresses and phone numbers can be used as External IDs along with Subscriptions.

If you do not have a global user identifier, you may want to consider creating one. Otherwise, you can use OneSignal ID and/or Subscription IDs, but this will make the integration more difficult as OneSignal IDs are anonymous until identified with the External ID and a single user will likely have multiple OneSignal/Subscription IDs.

Sending data to OneSignal

There are two main methods to sync user data from your database, CRM, or DMP into OneSignal:

API

Use the Create user API or Create subscription (by alias) API to create users, subscriptions, add aliases, and tags.

Use the Update User API if you just want to add tags Tags.

  • High throughput: Up to 1,000 requests per second
  • Supports multiple aliases identifiers (e.g., external_id, facebook_id)

CSV import

Best for bulk updates or one-off uploads. See Import for more details.

Getting data out of OneSignal

Use Event Streams to get message event data out of OneSignal. Other APIs that may be helpful:


Where should data live? (OneSignal or your Database)

Deciding where to store data depends on its purpose. A general recommendation: Only store data in OneSignal if it’s directly used for messaging. Everything else is best kept in your own database.

User Data

Store user identifiers and messaging-specific data in OneSignal:

  • external_id and custom aliases (e.g., crm_id, facebook_id)
  • Email addresses (for email campaigns)
  • Phone numbers (for SMS)

If needed, you can store lightweight user attributes as Data Tags. These are easy to update and remove.

For richer personalization, consider injecting custom values at send-time using the custom_data API property—keeping that data entirely within your system.

For more details on Privacy & security, we recommend our Data collection & security FAQs.

Message & Notification Data

OneSignal retains messaging data (e.g., delivery and engagement history) for a limited period. If you need long-term access—for compliance, analytics, or internal dashboards—you should archive this data in your own database.


Triggering messages from your Database

You have two primary ways to trigger messages from your database, and in most cases, a combination of both provides the best flexibility and control.

Option 1: Real-Time Messaging via API

Use the Create message API to send real-time, transactional notifications. Target users by:

  • external_id or custom aliases
  • Email address
  • Phone number

This is ideal for:

  • Transactional messages (e.g., order confirmations, password resets)
  • Notifications that must be sent immediately. They can be scheduled with the send_after parameter.
  • Targeting individual users or groups (up to 20,000 aliases per API call).

Option 2: Audience segmentation & automation

Set Tags on users to build dynamic segments. Then send messages by:

  • Targeting segments or filters via the API.
  • Using our dashboard for manual sends.
  • Automating flows with Journeys.

This is best for:

  • Marketing messages (e.g., promotions, re-engagement campaigns)
  • Scheduled or event-triggered notifications that aren’t time-critical.
  • Allowing marketers or product teams to manage messaging via the dashboard.