- A user’s current rewards balance
- Latest order status
- Personalized product recommendations
Data Feeds are currently available only for email messages sent through Journeys.
Need another channel? Fill out this short survey.
How Data Feeds Work
- Create a Data Feed – Configure how OneSignal connects to your API.
- Attach the Data Feed to a message template.
- Insert response fields in your message using Liquid syntax.
- At send time, OneSignal makes an API call for each recipient, parses the response, and injects the data into your message.
Example: Display reward points
Suppose you want to show each customer their rewards balance:{{ data_feed.rewards.points }}
and {{ data_feed.rewards.status_level }}
.
We’ll use this example to show you how to set up a Data Feed step by step below.
Creating and using a Data Feed
1. Set up your Data Feed configuration
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 it in your list of feeds. We recommend these be unique, but it’s not required.
- Alias: A short name like rewards that you’ll use in Liquid syntax. These must be unique, contain no spaces, and can only contain lower-case alphanumeric characters with no special symbols.
- Method: How we should contact your API. Usually this is GET but POST is also supported.
- URL: The address of the API. You can include Liquid syntax, enabling us to call the API to fetch user-specific data.
- Headers: Enter header key-value pairs as needed by your API specifications. A typical important use will be to include authentication information. These fields also support Liquid syntax in case it is needed.
- Body: Should your API require it, you can include a body in the request in JSON format. This editor supports Liquid syntax, just like Journey Webhooks.

Data Feed configuration example
2. Attach the Data Feed to your message template
Attach your Data Feed to your message template so that OneSignal knows to use it.- Navigate to Messages > Templates
- In the Message section, select the Personalization button

Personalization button options
- Toggle on Data Feeds and select your feed

Data Feeds section in the message composer
- Save your template
3. Use the data in your message
Use Liquid syntax to insert the response data anywhere in your message. In our example, let’s say that the response for Sarah, whose external_id is1a1-b2c3
, is a simple JSON blob like this:
- Use a Data Feed
- Use the
rewards
Data Feed- Recall: the
rewards
feed knows to call the API with theexternal_id
of the recipient
- Recall: the
- From the response, insert the value of the
points
item (193) and thestatus_level
item (Gold)
Requirements and Limits
Your API needs to:- Accept single-step authentication with auth tokens in headers
- Respond quickly. Under 250ms recommended (this directly affects send speed)
- Return JSON. Other formats are not supported at this time.
- If you have a use case relying on an alternative format, we want to hear from you! Fill out this short survey here.
- Handle your volume and rate of message sends. If your API has a low rate limit, this will prevent us from delivering your messages quickly.
- Return reasonably-sized payloads. We recommend keeping responses under 50kb for best performance.
- One Data Feed per template. We expect to increase this limit in the future. Fill out this short survey here to let us know you need this.
- One API call per Data Feed per message. Fetch everything you need in one call.
- Journeys only. Not yet available for other sending methods. Fill out this short survey here to let us know you need this.
- No chaining calls. The payload from one Data Feed cannot be used to call another.
Setting up your API
Before creating a Data Feed, ensure your API can handle these requirements:Authentication
Your API should accept authentication via headers:JSON Request Body
If you need to include a body in the request, your API should accept JSON. This may mean your headers need to includeContent: application/json
.
JSON Response
Your API should return a JSON object. Typically this means your headers will includeAccept: application/json
.
Personalization Parameters
You’ll typically pass user identifiers in the URL like this:JSON
Rate Limits
Consider your API’s rate limits. If you’re sending to 10,000 users in rapid succession, we’ll make 10,000 API calls. Ensure your API can handle this volume.Error Handling
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.Getting Started Checklist
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?
Examples & advanced use cases
Data Feeds can be used with Liquid syntax or in combination with other features in creative ways to produce more complex personalization.Iterating with loops: abandoned cart
Let’s say you have a Data Feed cart that returns an array of items in the user’s cart, plus the cart total dollar amount:JSON
HTML
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.
Custom events properties
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 acart_abandoned
custom event, where the properties includes a cart_id. In this example that event is being sent to OneSignal via API:
curl

Custom event for Journey entry
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:
- The
cart_id
value of98765
will be stored to the Journey - When the email step is reached, the
cart
Data Feed will reference thatcart_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
Conditional display: order status
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 anif
statement to do so:
tracking_number
exists.
Automation without personalization
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 abanner
Data Feed that points to an endpoint without any variables in the URL like so:
JSON
{{ data_feed.banner.banner_url }}
as the image source URL, automating this process going forward.
Troubleshooting
My data isn’t showing
- Check that your Data Feed is attached to the template
- Verify your Liquid syntax matches your JSON structure exactly
- Test your API endpoint manually to ensure it’s returning data
- Check that the user has the required data tags (like
external_id
)
Messages are sending slowly
- Check your API response time
- Ensure your API can handle concurrent requests
Some recipients aren’t getting messages
- Your API might not have data for those users
- Check the error log in the Data Feed configuration for 404s or errors
- Check your API logs for 404s or errors
- Verify those users have the required identifiers in OneSignal