Skip to main content
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.

How Data Feeds work

  1. Create a Data Feed – Configure how OneSignal connects to your API.
  2. Attach the Data Feed to a message template.
  3. Insert response fields in your message using Liquid syntax.
  4. 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:
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.

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 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:
https://acme.com/customers/user_id={{ external_id }}/rewards
  • Headers: Key-value pairs required by your API (e.g., authentication tokens). Supports Liquid syntax.
  • Body: Optional JSON request body. Supports Liquid syntax, the same as Journey webhooks.
For example, your API might require the user’s ID in the request body instead of the URL:
{
	"customer_id": "{{ subscription.external_id }}"
}
A complete Data Feed configuration looks like this:
Data Feed configuration showing name, alias, method, URL, and headers
Test your feed before using it in production. Data Feed tests run against your test subscriptions, 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.

2. Attach the Data Feed to your message template

Attach your Data Feed to your message template so that OneSignal knows to use it.
  1. Navigate to Messages > Templates
  2. In the Message section, select the Personalization button
Personalization button in the message template editor
  1. Toggle on Data Feeds and select your feed
Data Feeds toggle and feed selector in the message composer
  1. Save your template

3. Use the data in your message

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:
{
	"external_id": "a1-b2c3",
	"points": 193,
	"status_level": "Gold"
}
To insert the number of points and the status level, use dot notation to reference the Data Feed alias and response fields:
You have {{ data_feed.rewards.points }} points!
Your membership status is {{ data_feed.rewards.status_level }}.
This tells OneSignal:
  • Use a Data Feed
  • Use the rewards Data Feed
    • Recall: the rewards feed knows to call the API with the external_id of the recipient
  • From the response, insert the value of the points item (193) and the status_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.
  • Handle your send volume. A low rate limit on your API slows message delivery.
  • Return reasonably-sized payloads. Keep responses under 50 KB for best performance.
Current limits:
  • One Data Feed per template. Fetch everything you need in a single API response.
  • One API call per Data Feed per message.
  • Journeys only. Not yet available for other sending methods.
  • No chaining calls. The payload from one Data Feed cannot be used to call another.
Need multiple Data Feeds per template or support for other channels? Share your use case to help prioritize these features.

Setting up your API

Before creating a Data Feed, ensure your API can handle these requirements:

Authentication

Your API should accept authentication via headers:
Authorization: Bearer YOUR_TOKEN
or
X-API-Key: YOUR_KEY

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 include Content-Type: application/json.

JSON response

Your API should return a JSON object. Typically this means your headers will include Accept: application/json.

Personalization parameters

You’ll typically pass user identifiers in the URL like this:
https://api.example.com/users/{{external_id}}/data
https://api.example.com/rewards?email={{email | url_encode}}
And/or in the body:
{
	"customer_id": "{{ external_id }}",
	"email": "{{ subscription.email }}"
}
Make sure this data will exist in OneSignal (usually as Tags, but other options are available such as custom event properties).

Rate limits

Consider your API’s rate limits. Sending to 10,000 users means 10,000 API calls in rapid succession. 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 and 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.
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:
{
  "items": [
    {
      "name": "Blue Running Shoes",
      "price": 84.00,
      "image_url": "https://acme.com/blue-running-shoes.png"
    },
    {
      "name": "Protein Bar",
      "price": 5.99,
      "image_url": "https://acme.com/protein-bar.png"
    }
  ],
  "total": 89.99
}
If you want to show each item in the cart, plus the cart total, you can use a for loop in Liquid:
<ul>
  {% for item in data_feed.cart.items %}
    <li>
      <strong>{{ item.name }}</strong><br>
      ${{ item.price }}<br>
      <img src="{{ item.image_url }}" alt="{{ item.name }}">
    </li>
  {% endfor %}
</ul>

<p>Cart total: ${{ data_feed.cart.total }}</p>

This will result in:
- 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.

FAQ

My Data Feed values are not appearing in the message. What should I check?

Verify these in order:
  1. The Data Feed is attached to the template (under Personalization > Data Feeds).
  2. Your Liquid syntax matches the JSON response structure exactly — {{ data_feed.<alias>.<field> }}.
  3. The API endpoint returns valid JSON when called manually with the same identifiers.
  4. The recipient has the required identifier (e.g., external_id) stored in OneSignal.

Why are messages sending slowly?

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.

Why are some recipients not getting messages?

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.

Can I use more than one Data Feed in a template?

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.

Liquid syntax

Full reference for Liquid templating in OneSignal messages.

Journeys

Build automated messaging workflows that trigger Data Feed emails.

Custom events

Trigger Journeys and pass event properties for Data Feed URLs.

Message personalization

Overview of all personalization methods — tags, Liquid, dynamic content, and Data Feeds.