Create, update, and retrieve web feeds with the Web Feeds API
Before you begin
Check out our general API overview to make sure you’re ready to get started with specific endpoints.
A web feed allows you to dynamically populate a Klaviyo email with a feed of data, such as from blog posts. Before sending the email, Klaviyo makes an HTTP request to the web feed URL and fetches the data. The content of the web feed is then available for use in your email. Simply keep the feed up-to-date and Klaviyo will ensure fresh content from your feed is populated into every send. To read more about using web feeds in emails with Klaviyo, check out how to add a custom web feed in an email.
Use cases
Here are some example use cases supported by the Web Feeds API:
- Create new web feeds.
- Retrieve your account's web feeds.
- Update the name, URL, or other attributes of a web feed.
- Remove inactive web feeds.
Do more with your new web feeds. Use the Universal Content API to create a universal content block that references the web feed to support use cases with dynamic content, such as including a list of recent blog posts, displaying a stream of user-generated content, etc.
Limitations
- Accounts can have up to 10 web feeds.
- Web feed content is limited to 4MB.
Data model
A web feed can have the following:
-
id
The web feed ID.
-
attributes
-
name
The name of the web feed.
-
url
The URL of the web feed.
-
request_method
The HTTP method used, either
get
orpost
. -
content_type
The content type of the web feed, either
json
orxml
. -
created
The timestamp of when the web feed was created.
-
updated
The timestamp of when the web feed was last updated.
-
status
The current status of the web feed, such as
ok
ordisabled
. When a web feed is initially created, status may benull
.-
ok
This status indicates that Klaviyo successfully pulled data from the web feed URL and cached it. -
disabled
This status indicates that there was an issue pulling data from your web feed.
-
-
When status is
disabled
, campaigns or flows using that feed will stop sending.
Create Web Feed
Create a new web feed in your account by passing in a name, URL, request method, and content type.
When you submit a web feed creation request, Klaviyo will validate your web feed. Failed validation will result in an error and the web feed will not be created in your account. Review the errors section for more information on why your web feed creation has failed.
curl --request POST \
--url https://a.klaviyo.com/api/web-feeds \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2025-04-15' \
--data '
{
"data": {
"type": "web-feed",
"attributes": {
"request_method": "get",
"content_type": "json",
"name": "blog_posts",
"url": "https://help.klaviyo.com/api/v2/help_center/en-us/articles.json"
}
}
}
'
Get Web Feed(s)
Get a specific web feed via web feed ID or get all web feeds in an account. Use filters to retrieve a subset of all web feeds. In this example, we retrieve all web feeds with the name Blog posts
.
curl --request GET \
--url 'https://a.klaviyo.com/api/web-feeds?filter=equals%28name%2C%27Blog_posts%27%29&page[size]=5' \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'revision: 2025-04-15'
Update Web Feed
Update some or all attributes of the web feed with the given ID. In this example, we update the name of the web feed to new_blog
.
When you update a web feed, for example to change its content type from xml to json, Klaviyo will validate your web feed. If validation fails, the update request will also fail and your content type will not be changed.
curl --request PATCH \
--url https://a.klaviyo.com/api/web-feeds/925e385b52fb \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2025-04-15' \
--data '
{
"data": {
"type": "web-feed",
"id": "925e385b52fb",
"attributes": {
"name": "new_blog"
},
}
}
'
Delete Web Feed
Delete a web feed from your account with the provided web feed ID.
This action is not reversible, please use caution when deleting web feeds via API.
curl --request DELETE \
--url https://a.klaviyo.com/api/web-feeds/925e385b52fb \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'revision: 2025-04-15'
Errors
Creation and modification of web feeds may result in errors for a variety of reasons. If you are seeing 400 errors when making requests to the Web Feeds API, review the following error descriptions for more information.
-
Blocked IP address
The specified web feed URL resolved to a blocked IP address.
-
Missing URL schema
The specified web feed URL is missing a schema. Please include http:// or https:// as part of your URL.
-
Invalid URL schema
The specified web feed URL has an invalid schema. Please include http:// or https:// as part of your URL.
-
Unable to connect to URL
The specified web feed URL is unreachable. Please ensure your feed is publicly accessible.
-
Unable to decode feed content
The specified web feed URL returned content that could not be decoded. Please ensure your feed returns valid JSON or XML before trying again.
-
Feed returned a non-200
The specified web feed URL returned a non-200 status code. Please ensure your feed returns a 2xx status code before trying again.
-
Feed content > 4MB limit
The specified web feed URL returned content that was too large (> 4MB). Please reduce the size of your feed before trying again.
-
Feed took too long to fetch
The specified web feed URL took over 5 seconds to fetch. Please improve the performance of your feed before trying again.
-
Reached max # of feeds
Total number of web feeds must not exceed 10.
-
A web feed with this name already exists
A web feed with the name
blog_posts
already exists.