Use this file to discover all available pages before exploring further.
Data Feeds let you pull real-time data from your APIs directly into messages at send time. This allows you to deliver highly personalized content without pre-loading data into OneSignal.Use Data Feeds when your data changes frequently, such as:
A user’s current rewards balance
Latest order status
Personalized product recommendations
Other personalization methods (like Tags or Dynamic Content) work well for static data. Data Feeds are best for live, fast-changing values.
Data Feeds are currently available only for email messages sent through Journeys.
Need another channel? Fill out this short survey.
Suppose you want to show each customer their rewards balance:
Hi {{ first_name }},You have {{ data_feed.rewards.points }} points!Your membership status is {{ data_feed.rewards.status_level }}.Keep shopping to earn more points!
When Sarah receives this email, the Liquid variables are replaced with her actual points balance and membership status. The following sections walk through setting up this example step by step.
Navigate to Data > Data Feeds in the sidebar to see the list of existing Data Feeds and create a new one.Each Data Feed must have:
Name: A descriptive name like “Customer Rewards API” to help you distinguish feeds. Unique names are recommended but not required.
Alias: A short identifier like rewards used in Liquid syntax (e.g., {{ data_feed.rewards.points }}). Must be unique, lowercase, alphanumeric, with no spaces or special characters.
Method: The HTTP method OneSignal uses to contact your API. Usually GET, but POST is also supported.
URL: Your API endpoint. Supports Liquid syntax so OneSignal can fetch user-specific data.
For example, your rewards endpoint might accept the user’s external_id (stored in OneSignal) as a URL parameter:
A complete Data Feed configuration looks like this:
Test your feed before using it in production. Data Feed tests run against your Test Users, so verify that those subscriptions have attributes that return a real result from your API.
Finally, Activate your new Data Feed so it’s ready for use.
Use Liquid syntax to insert response data anywhere in your message. Continuing the rewards example, the API response for Sarah (whose external_id is a1-b2c3) might look like this:
If your API returns an error or doesn’t have data for a user, the message won’t be sent to that recipient. Make sure your API returns data for all expected users.
Before implementing Data Feeds, answer these questions:
What data do I want to show in my message? Working backwards from a simple outline with the items to be populated from your API identified will help you organize your thinking.
Is this data available via a single API endpoint?
How will I authenticate API requests?
What identifier or other data item will I use to fetch personalized data?
Is that identifier already stored in OneSignal? If not, how will it be populated?
Can my API handle the volume of requests I’ll generate?
What happens if my API doesn’t have data for a user?
- Blue Running Shoes- $84.00- <running shoes image>- Protein Bar- $5.99- <protein bar image>Cart total: $89.99
If you’re using the email block editor, when inserting this sort of complex Liquid syntax, particularly if you need to include images or links, for best results use the custom HTML block element.
Want to see how to trigger this abandoned cart email using custom events? Check out the Custom events properties tab for the complete workflow.
Continuing the previous abandoned cart example, how might we know how to fetch that particular cart in the first place?One method might be to create a Journey triggered by a cart_abandonedcustom event, where the properties includes a cart_id. In this example that event is being sent to OneSignal via API:
The user user_12345 enters the journey when this event is fired, then reaches a node sending an email. That email template is set up with the cart Data Feed, where the URL is set to retrieve the contents of a particular cart like so:
Thus, when this particular event is ingested and triggers the Journey:
The cart_id value of 98765 will be stored to the Journey
When the email step is reached, the cart Data Feed will reference that cart_id value and use it to call the cart API
The returned JSON properties will be parsed and inserted into the email as in the previous example above
Want to see how to conditionally display Data Feed content based on order status? Check out the Conditional display: order status tab to learn more.
Let’s say you want to include the status of a customer’s order, but only include a tracking number link if the order has been shipped. You can use an if statement to do so:
Your order is {{data_feed.order.status}}!{% if data_feed.order.tracking_number != empty %}Track it here: {{data_feed.order.tracking_url}}{% endif %}
Here, the tracking link will only be displayed if the tracking_number exists.
Data Feeds can be used to automatically insert up-to-date information into your messages without necessarily needing to be personalized per recipient.For example, perhaps you insert a banner image at the top of your emails and change it monthly to keep up with holidays and other monthly events. Rather than remembering to upload a new image to OneSignal and changing all your templates each month, you might set up a Data Feed that fetches the current banner image URL from your CMS or other asset-management location.You would set up a banner Data Feed that points to an endpoint without any variables in the URL like so:
https://acme.com/assets/email-banner
Which returns a response with the current banner URL:
You’d set your email template to use {{ data_feed.banner.banner_url }} as the image source URL, automating this process going forward.
This example covers how to send personalized, single-use coupon codes in emails using a Data Feed that fetches a unique value from your API for each recipient.
Hi George,Complete your booking in the next 2 hours and save 10% with your personal code: XYZ123ABC
Each user receives a unique coupon code, generated live via an external API call when the email is sent, valid for the given time window, and scoped to that user.
An external API that accepts a user identifier (for example, external_id) and campaign identifier, and returns JSON with the coupon code, discount, and expiration
A unique identifier (such as external_id) for each user that your API can use to generate coupons
A segment or trigger (for example, “abandoned search in last 24h”) used to send the email through a OneSignal Journey
In OneSignal, go to Messages → Email → New Template
Use the Data Feed alias and fields within your message body. For example:
<h2>Hi {{ first_name }},</h2><p>Complete your booking in the next {{ data_feed.coupon.expires_in_hours }} hours and save{{ data_feed.coupon.discount_percent }} with your personal code:<strong>{{ data_feed.coupon.code }}</strong></p><p><a href="https://example.com/checkout?coupon={{ data_feed.coupon.code }}">Use Code Now →</a></p>
Use Liquid syntax in the form {{ data_feed.<alias>.<field> }}
Make sure the Data Feed is attached to the template
If using the drag-and-drop editor with custom Liquid logic, use an HTML block
Step 3: Attach the Data Feed and trigger the email
In the template composer, under Personalization, toggle Data Feeds and select your feed (coupon_code_generator)
This ensures OneSignal makes the API call at send time for each recipient, populates the data, and injects it into the email
Set up a Journey to automate the message:
Entry condition: Segment such as “abandoned search in last 24 hours”
Wait until: Create a booking_completed custom event. Configure the wait to exit the Journey if this event fires, or continue after 1 hour. If they complete a booking, they exit without receiving the email; otherwise, they continue to receive the coupon.
Send email: Use the personalized coupon email template
Ensure the Journey uses the email channel and that recipients are subscribed to email
Data Feed API calls run at send time for every recipient. If your API responds slowly or cannot handle concurrent requests, message delivery slows proportionally. Aim for under 250 ms response time and ensure your infrastructure can handle your send volume.
If the Data Feed API call fails for a recipient — due to a 404, timeout, or missing data — OneSignal skips that recipient entirely. Check the error log in your Data Feed configuration and your own API logs for failures. Verify those users have the required identifiers in OneSignal.
Not currently. Each template supports one Data Feed. Fetch all the data you need in a single API response. If you need multiple feeds, share your use case.
Are Data Feeds available for push notifications or SMS?
No. Data Feeds are currently available only for email messages sent through Journeys. Support for additional channels is planned — share your use case to help prioritize.
What happens if my API is down when the message sends?
OneSignal skips any recipient whose Data Feed call fails. The message is not sent to that recipient, and no fallback value is inserted. Monitor your API uptime and error rates during scheduled sends.