Hi everyone,
I'm trying to create an email template programmatically using the Klaviyo API (v2025-01-15) and want to include Universal Content Blocks in the template. Here’s what I’ve done so far:
- Fetched existing Universal Content Blocks using the
/api/template-universal-content/
endpoint (https://developers.klaviyo.com/en/reference/get_all_universal_content) and found the ID of the block I want to include. - Tried to create a new email template using
/api/templates/
, but I don’t see a documented way to reference Universal Content Blocks inside the template payload.
So a few questions:
- What would be the best way to allow for the creation of a new email template (or even just a wholesale new email campaign that is not a template) that includes existing universal content blocks?
- How can I fill in those blocks with variables (e.g for a product block, is there a way to specify which products it should fill in?)