---
title: "Templates"
description: "Reference documentation for the Templates endpoints in the Klaviyo REST API."
url: "https://developers.klaviyo.com/en/v2026-01-15/reference/templates"
revision: "2026-01-15"
llmsTxt: "https://developers.klaviyo.com/en/v2026-01-15/reference/templates/llms.txt"
---

# Templates

## Before you begin

Check out our general [API overview](https://developers.klaviyo.com/en/reference.md) before getting started with specific endpoints.

Use the Templates API to seamlessly create, update, and manage email templates programmatically. Whether you use fully custom HTML, hybrid templates compatible with Klaviyo’s drag-and-drop editor, or native drag-and-drop templates, the Templates API offers flexibility for tailored email experiences.

> [!NOTE]
> When calling the Templates API, your authentication key must have the appropriate scopes (`templates:read`, `templates:write`).

## Use cases

The Templates API supports the following use cases:

* Get, create, and manage templates.
* Create and update HTML, Hybrid and native drag-and-drop templates.
* Render a template with the given template ID and context.
* Clone a template.
* Convert an HTML template into a drag-and-drop template.

> [!NOTE]
> Looking to assign a template to a campaign message or fetch template data for a specific campaign message? Check out our Messages endpoints within the Campaigns API.

## Data model

A template has the following:

* `id`

    The template ID.

* `attributes`
    * `name` (required)

        The name of the template.

    * `editor_type` (required)

        The type of editor. Supported values:

        * `CODE` — custom HTML templates.
        * `USER_DRAGGABLE` — [hybrid templates](https://help.klaviyo.com/hc/en-us/articles/115005254188) edited as HTML in the API but compatible with the drag-and-drop editor.
        * `SYSTEM_DRAGGABLE` — native drag-and-drop templates backed by a structured `definition` object.

    * `html`

        The HTML contents of the template. Used for `CODE` and `USER_DRAGGABLE` templates. Not used when `editor_type` is `SYSTEM_DRAGGABLE` (use `definition` instead).

    * `text`

        The plaintext version of the template.

    * `definition`

        Structured drag-and-drop template content (body, styles, and related metadata) for `SYSTEM_DRAGGABLE` templates. Required when creating a `SYSTEM_DRAGGABLE` template. On [Get Templates](https://developers.klaviyo.com/en/reference/get_templates.md), the `definition` attribute is omitted by default; pass `additional-fields[template]=definition` to include it in list responses. [Get Template](https://developers.klaviyo.com/en/reference/get_template.md) includes `definition` for `SYSTEM_DRAGGABLE` templates. For the exact JSON shape, refer to the endpoint schemas in the [API reference](https://developers.klaviyo.com/en/reference/get_templates.md).

    * `amp`

        The AMP version of the template. Requires an enabled [AMP email](https://developers.klaviyo.com/en/docs/send_amp_emails_in_klaviyo.md) to access in-app. Not used when `editor_type` is `SYSTEM_DRAGGABLE`.

    * `created`

        The timestamp of when the template was last created.

    * `updated`

        The timestamp of when the metric was last updated.

## Create a template

When creating a template with the [Create Template](https://developers.klaviyo.com/en/reference/create_template.md) endpoint, your request payload must include at least a template name and an editor type.

- For `CODE` or `USER_DRAGGABLE` templates, include the appropriate HTML-related fields as described in the API reference.
- For `SYSTEM_DRAGGABLE` templates, include a `definition` to define the template content (body, styles, rows, columns, blocks etc).

### Create a HTML template

The example below is a **`CODE`** template. It utilizes dynamic variables including `first_name`, `last_name`, `discount_code`, and `order_total` to tailor the content for each recipient. These variables enable seamless personalization when rendering the template.

```json Request
{
   "data": {
       "type": "template",
       "attributes": {
           "name": "Personalized Discount Email",
           "editor_type": "CODE",
           "html": "<html>\n  <head>\n    <meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\" />\n    <title>Special Discount for You</title>\n    <style>\n      body {\n        background-color: #f6f6f6;\n        font-family: sans-serif;\n        margin: 20px;\n      }\n      .main {\n        background: #ffffff;\n        border-radius: 3px;\n        width: 100%;\n      }\n      .container {\n        margin: 0 auto !important;\n        width: 600px;\n      }\n      .wrapper {\n        box-sizing: border-box;\n        padding: 15px;\n      }\n      table {\n        width: 100%;\n      }\n    </style>\n  </head>\n  <body>\n    <div class=\"container\">\n      <table class=\"main\">\n        <tr>\n          <td class=\"wrapper\">\n            <p>Hello {{ first_name }} {{ last_name }},</p>\n            <p>Thank you for your order of ${{ order_total }}!</p>\n            <p>As a thank you, here’s a special discount code just for you: <strong>{{ discount_code }}</strong></p>\n            <p>Use it at checkout to enjoy your discount.</p>\n          </td>\n        </tr>\n        <tr>\n          <td class=\"wrapper\">{% unsubscribe %}</td>\n        </tr>\n      </table>\n    </div>\n  </body>\n</html>"
       }
   }
}
```
```json Response
{
    "data": {
        "type": "template",
        "id": "TuG2Zd",
        "attributes": {
            "name": "Personalized Discount Email",
            "editor_type": "CODE",
            "html": "<html>\n<head>\n<meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\"/>\n<title>Special Discount for You</title>\n<style>body {\n    background-color: #f6f6f6;\n    font-family: sans-serif;\n    margin: 20px\n    }\n.main {\n    background: #fff;\n    border-radius: 3px;\n    width: 100%\n    }\n.container {\n    margin: 0 auto !important;\n    width: 600px\n    }\n.wrapper {\n    box-sizing: border-box;\n    padding: 15px\n    }\ntable {\n    width: 100%\n    }</style></head>\n<body>\n<div class=\"container\">\n<table class=\"main\">\n<tr>\n<td class=\"wrapper\">\n<p>Hello {{ first_name }} {{ last_name }},</p>\n<p>Thank you for your order of ${{ order_total }}!</p>\n<p>As a thank you, here’s a special discount code just for you: <strong>{{ discount_code }}</strong></p>\n<p>Use it at checkout to enjoy your discount.</p>\n</td>\n</tr>\n<tr>\n<td class=\"wrapper\">{% unsubscribe %}</td>\n</tr>\n</table>\n</div>\n</body>\n</html>",
            "text": null,
            "amp": null,
            "created": "2025-02-05T19:12:51.599729+00:00",
            "updated": "2025-02-05T19:12:51.599758+00:00"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/templates/TuG2Zd/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/templates"
    }
}
```

### Create a drag-and-drop template

The example below is a **`SYSTEM_DRAGGABLE`** template. The `definition` in the request below matches the **`definition` object in the Get Template response** for `SYSTEM_DRAGGABLE` templates (see **Get a drag-and-drop template** under [Fetch templates](#fetch-templates)).

```json Request
{
   "data": {
       "type": "template",
       "attributes": {
           "name": "Spring welcome (DnD)",
           "editor_type": "SYSTEM_DRAGGABLE",
           "text": "Hi there, thanks for subscribing.",
           "definition": {
               "body": {
                   "properties": {},
                   "styles": {},
                   "sections": [
                       {
                           "content_type": "section",
                           "type": "section",
                           "data": {
                               "properties": {},
                               "display_options": {},
                               "styles": {}
                           },
                           "rows": [
                               {
                                   "data": {
                                       "styles": {
                                           "column_layout": "1-column-full-width"
                                       }
                                   },
                                   "columns": [
                                       {
                                           "data": {},
                                           "blocks": [
                                               {
                                                   "content_type": "block",
                                                   "type": "text",
                                                   "data": {
                                                       "content": "<p>Hi {{ person.first_name|default:'there' }}, thanks for subscribing.</p>",
                                                       "display_options": {},
                                                       "styles": {}
                                                   }
                                               }
                                           ]
                                       }
                                   ]
                               }
                           ]
                       }
                   ]
               },
               "styles": [
                   {"style_type": "base-styles", "properties": {}, "styles": {}},
                   {"style_type": "text-styles", "styles": {}},
                   {"style_type": "link-styles", "styles": {}},
                   {"style_type": "heading-1-styles", "styles": {}},
                   {"style_type": "heading-2-styles", "styles": {}},
                   {"style_type": "heading-3-styles", "styles": {}},
                   {"style_type": "heading-4-styles", "styles": {}},
                   {"style_type": "mobile-styles", "properties": {}, "styles": {}}
               ]
           }
       }
   }
}
```
```json Response
{
    "data": {
        "type": "template",
        "id": "V2kMn9",
        "attributes": {
            "name": "Spring welcome (DnD)",
            "editor_type": "SYSTEM_DRAGGABLE",
            "html": "<html><head><meta charset=\"utf-8\"/><title>Spring welcome</title></head><body><p>Hi {{ person.first_name|default:'there' }}, thanks for subscribing.</p></body></html>",
            "text": "Hi there, thanks for subscribing.",
            "definition": {
                "body": {
                    "properties": {},
                    "styles": {},
                    "sections": [
                        {
                            "content_type": "section",
                            "type": "section",
                            "data": {
                                "properties": {},
                                "display_options": {},
                                "styles": {}
                            },
                            "rows": [
                                {
                                    "data": {
                                        "styles": {
                                            "column_layout": "1-column-full-width"
                                        }
                                    },
                                    "columns": [
                                        {
                                            "data": {},
                                            "blocks": [
                                                {
                                                    "content_type": "block",
                                                    "type": "text",
                                                    "data": {
                                                        "content": "<p>Hi {{ person.first_name|default:'there' }}, thanks for subscribing.</p>",
                                                        "display_options": {},
                                                        "styles": {}
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "styles": [
                    {"style_type": "base-styles", "properties": {}, "styles": {}},
                    {"style_type": "text-styles", "styles": {}},
                    {"style_type": "link-styles", "styles": {}},
                    {"style_type": "heading-1-styles", "styles": {}},
                    {"style_type": "heading-2-styles", "styles": {}},
                    {"style_type": "heading-3-styles", "styles": {}},
                    {"style_type": "heading-4-styles", "styles": {}},
                    {"style_type": "mobile-styles", "properties": {}, "styles": {}}
                ]
            },
            "amp": null,
            "created": "2026-04-10T15:30:00+00:00",
            "updated": "2026-04-10T15:30:00+00:00"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/templates/V2kMn9/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/templates"
    }
}
```

> [!NOTE]
> **Adding universal content to a template**
> Currently, our APIs do not natively support referencing universal content blocks directly in the payload. You'll need to fetch the block's content (via [Get Universal Content](https://developers.klaviyo.com/en/reference/get_universal_content.md)), add the content to your template, and upload the final HTML. See our [Universal Content API overview](https://developers.klaviyo.com/en/reference/templates.md) for more information on managing universal content blocks via API.

## Render a template

Render a template with a given template ID and context attribute (a JSON object with the context the email template is rendered with). A call to [Render Template](https://developers.klaviyo.com/en/reference/render_template.md) returns the AMP, HTML, and plain text versions of the email template.

Here’s the request and response for rendering the template we created above:

```json Request
{
   "data": {
       "type": "template",
       "id": "TuG2Zd",
       "attributes": {
           "context": {
               "first_name": "John",
               "last_name": "Doe",
               "discount_code": "WELCOME10",
               "order_total": 49.99
           }
       }
   }
}
```
```json Response
{
    "data": {
        "type": "template",
        "id": "TuG2Zd",
        "attributes": {
            "name": "Personalized Discount Email",
            "editor_type": "CODE",
            "html": "<html>\n<head>\n<meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\"/>\n<title>Special Discount for You</title>\n<style>body {\n    background-color: #f6f6f6;\n    font-family: sans-serif;\n    margin: 20px\n    }\n.main {\n    background: #fff;\n    border-radius: 3px;\n    width: 100%\n    }\n.container {\n    margin: 0 auto !important;\n    width: 600px\n    }\n.wrapper {\n    box-sizing: border-box;\n    padding: 15px\n    }\ntable {\n    width: 100%\n    }</style></head>\n<body>\n<div class=\"container\">\n<table class=\"main\">\n<tr>\n<td class=\"wrapper\">\n<p>Hello John Doe,</p>\n<p>Thank you for your order of $49.99!</p>\n<p>As a thank you, here’s a special discount code just for you: <strong>WELCOME10</strong></p>\n<p>Use it at checkout to enjoy your discount.</p>\n</td>\n</tr>\n<tr>\n<td class=\"wrapper\"><a class=\"unsubscribe-link\" href=\"[unsubscribe_tag]\">Unsubscribe</a></td>\n</tr>\n</table>\n</div>\n</body>\n</html>",
            "text": null,
            "amp": null,
            "created": "2025-02-05T19:12:52+00:00",
            "updated": "2025-02-05T19:12:52+00:00"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/templates/TuG2Zd/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-render"
    }
}
```

## Clone a template

To clone the template we created and rendered above, your request payload for [Clone Template](https://developers.klaviyo.com/en/reference/clone_template.md) should look like the following:

```json Request
{
   "data": {
       "type": "template",
       "id": "TuG2Zd",
       "attributes": {
           "name": "Clone of Personalized Discount Email"
       }
   }
}
```
```json Response
{
    "data": {
        "type": "template",
        "id": "XRPRey",
        "attributes": {
            "name": "Clone of Personalized Discount Email",
            "editor_type": "CODE",
            "html": "<html>\n<head>\n<meta content=\"width=device-width, initial-scale=1.0\" name=\"viewport\"/>\n<title>Special Discount for You</title>\n<style>body {\n    background-color: #f6f6f6;\n    font-family: sans-serif;\n    margin: 20px\n    }\n.main {\n    background: #fff;\n    border-radius: 3px;\n    width: 100%\n    }\n.container {\n    margin: 0 auto !important;\n    width: 600px\n    }\n.wrapper {\n    box-sizing: border-box;\n    padding: 15px\n    }\ntable {\n    width: 100%\n    }</style></head>\n<body>\n<div class=\"container\">\n<table class=\"main\">\n<tr>\n<td class=\"wrapper\">\n<p>Hello {{ first_name }} {{ last_name }},</p>\n<p>Thank you for your order of ${{ order_total }}!</p>\n<p>As a thank you, here’s a special discount code just for you: <strong>{{ discount_code }}</strong></p>\n<p>Use it at checkout to enjoy your discount.</p>\n</td>\n</tr>\n<tr>\n<td class=\"wrapper\">{% unsubscribe %}</td>\n</tr>\n</table>\n</div>\n</body>\n</html>",
            "text": null,
            "amp": null,
            "created": "2025-02-05T19:35:59.752156+00:00",
            "updated": "2025-02-05T19:35:59.832098+00:00"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/templates/XRPRey/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-clone"
    }
}
```

> [!WARNING]
> Cloning and creating templates will fail if your account contains 1,000 or more templates, as the Templates API has a limit of 1,000 templates.

## Convert an HTML template to drag-and-drop

Convert a `CODE` template into a new `SYSTEM_DRAGGABLE` template with [Create Template Conversion Job](https://developers.klaviyo.com/en/reference/create_template_conversion_job.md). The conversion runs asynchronously, so the request returns a job instead of the new template. The source template does not change. The new template is named after the source template, followed by `(converted)`.

Starting a conversion requires an account on a paid plan. Requests from other accounts return a `403` error. Any account can still get and list its conversion jobs.

Only `CODE` templates can be converted. If the source template is a different editor type, the request returns a `400` error. If the source template does not exist, the request returns a `404` error.

> [!NOTE]
> Creating a conversion job requires the `templates:write` scope and is limited to 1 request/second burst and 1 request/minute steady. Reading conversion jobs requires the `templates:read` scope.

### Start a conversion

To convert the HTML template we created above, set it as the `source-template` relationship:

```json Request
{
   "data": {
       "type": "template-conversion-job",
       "relationships": {
           "source-template": {
               "data": {
                   "type": "template",
                   "id": "TuG2Zd"
               }
           }
       }
   }
}
```
```json Response
{
    "data": {
        "type": "template-conversion-job",
        "id": "XyZ123-01JA8ZQ5M0V3T7N6K2H4B9C1DE",
        "attributes": {
            "status": "queued",
            "created_at": "2026-10-15T14:00:00+00:00",
            "error": null,
            "completed_at": null
        },
        "relationships": {
            "source-template": {
                "data": {
                    "type": "template",
                    "id": "TuG2Zd"
                }
            }
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-conversion-jobs/XyZ123-01JA8ZQ5M0V3T7N6K2H4B9C1DE/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-conversion-jobs/"
    }
}
```

### Check the job status

Poll [Get Template Conversion Job](https://developers.klaviyo.com/en/reference/get_template_conversion_job.md) until the job's `status` is `complete` or `failed`. A job has one of these statuses:

* `queued` — the job is waiting to start.
* `processing` — the conversion is running.
* `complete` — the new template exists. Its ID is in the `converted-template` relationship.
* `failed` — the conversion did not finish. The `error` attribute says why.

The `converted-template` relationship is only included when the status is `complete`.

```curl Request
curl --request GET \
     --url https://a.klaviyo.com/api/template-conversion-jobs/XyZ123-01JA8ZQ5M0V3T7N6K2H4B9C1DE \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-10-15'
```
```json Response
{
    "data": {
        "type": "template-conversion-job",
        "id": "XyZ123-01JA8ZQ5M0V3T7N6K2H4B9C1DE",
        "attributes": {
            "status": "complete",
            "created_at": "2026-10-15T14:00:00+00:00",
            "error": null,
            "completed_at": "2026-10-15T14:03:00+00:00"
        },
        "relationships": {
            "source-template": {
                "data": {
                    "type": "template",
                    "id": "TuG2Zd"
                }
            },
            "converted-template": {
                "data": {
                    "type": "template",
                    "id": "Rw4pLk"
                }
            }
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-conversion-jobs/XyZ123-01JA8ZQ5M0V3T7N6K2H4B9C1DE/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-conversion-jobs/XyZ123-01JA8ZQ5M0V3T7N6K2H4B9C1DE/"
    }
}
```

Get the new template with [Get Template](https://developers.klaviyo.com/en/reference/get_template.md), using the ID from the `converted-template` relationship.

### List conversion jobs

[Get Template Conversion Jobs](https://developers.klaviyo.com/en/reference/get_template_conversion_jobs.md) returns the conversion jobs created in the last 7 days, newest first. This endpoint does not support filtering or pagination.

## Manage templates

Update and delete templates with the [Update Template](https://developers.klaviyo.com/en/reference/update_template.md) and [Delete Template](https://developers.klaviyo.com/en/reference/delete_template.md) endpoints, respectively.

## Fetch templates

All template types are returned when making a [Get Template](https://developers.klaviyo.com/en/reference/get_template.md) or [Get Templates](https://developers.klaviyo.com/en/reference/get_templates.md) request.

For **`SYSTEM_DRAGGABLE`** templates, the structured **`definition`** attribute behaves differently by endpoint:
- **[Get Template](https://developers.klaviyo.com/en/reference/get_template.md)** includes `definition` in the response for a single template
- **[Get Templates](https://developers.klaviyo.com/en/reference/get_templates.md)** omits `definition` by default

To include `definition` on each item in a list response, add `?additional-fields[template]=definition` to the URL. Learn more in the guide to [additional fields](https://developers.klaviyo.com/en/docs/sparse_fieldsets.md). `CODE` and `USER_DRAGGABLE` templates do not use `definition`.

### Get an HTML template

```json Request
curl --request GET \
     --url https://a.klaviyo.com/api/templates/U7bDHv \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-04-15'
```
```json Response
{
    "data": {
        "type": "template",
        "id": "U7bDHv",
        "attributes": {
            "name": "Clone of Monthly Newsletter Template",
            "editor_type": "CODE",
            "html": "<html><head></head><body>Template HTML content</body></html>",
            "text": null,
            "amp": null,
            "created": "2025-02-04T20:39:18+00:00",
            "updated": "2025-02-04T20:39:18+00:00"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/templates/U7bDHv/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/templates/U7bDHv"
    }
}
```

### Get a drag-and-drop template

For `SYSTEM_DRAGGABLE` templates, the response includes a structured `definition` and a rendered `html` preview. The `definition` object matches the payload in the **Create a drag-and-drop template** example earlier in this overview (under [Create a template](#create-a-template)).

```json Request
curl --request GET \
     --url https://a.klaviyo.com/api/templates/Qw8tRm \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-04-15'
```
```json Response
{
    "data": {
        "type": "template",
        "id": "Qw8tRm",
        "attributes": {
            "name": "Spring welcome (DnD)",
            "editor_type": "SYSTEM_DRAGGABLE",
            "html": "<html><head><meta charset=\"utf-8\"/><title>Spring welcome</title></head><body><p>Hi {{ person.first_name|default:'there' }}, thanks for subscribing.</p></body></html>",
            "text": "Hi there, thanks for subscribing.",
            "definition": {
                "body": {
                    "properties": {},
                    "styles": {},
                    "sections": [
                        {
                            "content_type": "section",
                            "type": "section",
                            "data": {
                                "properties": {},
                                "display_options": {},
                                "styles": {}
                            },
                            "rows": [
                                {
                                    "data": {
                                        "styles": {
                                            "column_layout": "1-column-full-width"
                                        }
                                    },
                                    "columns": [
                                        {
                                            "data": {},
                                            "blocks": [
                                                {
                                                    "content_type": "block",
                                                    "type": "text",
                                                    "data": {
                                                        "content": "<p>Hi {{ person.first_name|default:'there' }}, thanks for subscribing.</p>",
                                                        "display_options": {},
                                                        "styles": {}
                                                    }
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "styles": [
                    {"style_type": "base-styles", "properties": {}, "styles": {}},
                    {"style_type": "text-styles", "styles": {}},
                    {"style_type": "link-styles", "styles": {}},
                    {"style_type": "heading-1-styles", "styles": {}},
                    {"style_type": "heading-2-styles", "styles": {}},
                    {"style_type": "heading-3-styles", "styles": {}},
                    {"style_type": "heading-4-styles", "styles": {}},
                    {"style_type": "mobile-styles", "properties": {}, "styles": {}}
                ]
            },
            "amp": null,
            "created": "2026-04-10T14:22:00+00:00",
            "updated": "2026-04-10T14:22:00+00:00"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/templates/Qw8tRm/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/templates/Qw8tRm"
    }
}
```

## Querying templates

Querying templates with the Templates API can help you achieve many use cases, such as sorting templates by the date they were created. Check out the supported query parameters below and test them with our [latest Postman collection](https://developers.klaviyo.com/en/docs/use_klaviyos_postman_collections.md). Note that support for given operators and fields is endpoint-specific. Review the [API reference documentation](https://developers.klaviyo.com/en/reference/get_templates.md) for more information on allowed fields and query operators.

| Parameter | Description                                                                                                                                                                                    | Query example                                                                 |
| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `filter`  | Retrieve a subset of templates, e.g., templates that have been created within a given time frame. Learn about the [filter query parameter](https://developers.klaviyo.com/en/docs/filtering_.md). | `GET /api/templates?filter=greater-than(created,"2023-06-05T12:30:00+00:00")` |
| `sort`    | Sort templates, e.g., by date created in ascending order (oldest to newest). Learn about the [sort query parameter](https://developers.klaviyo.com/en/docs/sorting_.md).                          | `GET /api/templates?sort=created`                                             |
| `fields`  | Request for only specified template data, e.g., name. Learn more about [sparse fieldsets](https://developers.klaviyo.com/en/docs/sparse_fieldsets.md).                                            | `GET /api/templates?fields[template]=name`                                    |
| `additional-fields[template]` | Include the `definition` attribute for each template in [Get Templates](https://developers.klaviyo.com/en/reference/get_templates.md) responses (needed for `SYSTEM_DRAGGABLE` templates). Learn more about [additional fields](https://developers.klaviyo.com/en/docs/sparse_fieldsets.md). | `GET /api/templates?additional-fields[template]=definition` |

## Additional resources

* [Guide to the template editor](https://help.klaviyo.com/hc/en-us/articles/4407911841435-Guide-to-the-email-template-editor)
* [How to create a hybrid email template](https://help.klaviyo.com/hc/en-us/articles/115005254188-How-to-create-a-hybrid-email-template)
* [Message design overview](https://developers.klaviyo.com/en/docs/django_message_design.md)

## Endpoints

### Templates

- [Get Templates](https://developers.klaviyo.com/en/v2026-01-15/reference/get_templates.md): `GET /api/templates`
- [Get Template](https://developers.klaviyo.com/en/v2026-01-15/reference/get_template.md): `GET /api/templates/{id}`
- [Create Template](https://developers.klaviyo.com/en/v2026-01-15/reference/create_template.md): `POST /api/templates`
- [Update Template](https://developers.klaviyo.com/en/v2026-01-15/reference/update_template.md): `PATCH /api/templates/{id}`
- [Delete Template](https://developers.klaviyo.com/en/v2026-01-15/reference/delete_template.md): `DELETE /api/templates/{id}`
- [Render Template](https://developers.klaviyo.com/en/v2026-01-15/reference/render_template.md): `POST /api/template-render`
- [Clone Template](https://developers.klaviyo.com/en/v2026-01-15/reference/clone_template.md): `POST /api/template-clone`

### Universal Content

#### Before you begin

Check out our [general API overview](https://developers.klaviyo.com/en/reference.md) before getting started with specific endpoints.

Marketers can utilize [universal content](https://help.klaviyo.com/hc/en-us/articles/115005413888) to create reusable blocks of content that repeatedly appear in email marketing. Once saved as universal content, blocks can be added to any email from Klaviyo's email template editor. Any changes saved to a universal content block will propagate to all email templates using that block. Use our [Universal Content API](https://developers.klaviyo.com/en/reference/get_all_universal_content.md) to streamline the process of creating universal content that can be added to Klaviyo email templates.

#### Use cases

- Seamlessly create universal content blocks from HTML blocks present throughout your app and help documentation (e.g., product blocks and images) for repeated use in email templates.
- Retrieve universal content blocks by content type.
- Update existing universal content blocks across email templates.
- Delete universal content blocks.

> [!NOTE]
> The stable revisions of the Create and Update Universal Content APIs support the following block types: button, divider (formerly known as horizontal rule), drop shadow, HTML, image, spacer, and text. As of the `2026-10-15` revision, the API supports every block type available in Klaviyo's drag-and-drop template editor, as well as Sections.

#### Data model

A universal content block has the following structure:

- `id`

    The ID of the universal content block.

- `attributes`

  - `name`

      The name of the universal content block.

  - `definition`

    - `content_type`

        The type of universal content: `block`, or (as of the `2026-10-15` revision) `section`.

    - `type`

        The type of universal content within the block (`button`, `horizontal_rule`, `drop_shadow`, `html`, `image`, `spacer`, or `text`). As of the `2026-10-15` revision, also supports `coupon`, `header`, `product`, `review`, `social`, `split`, `table`, and `video`.

    - `data`

      - `content`

          The text or HTML content shown in the universal content block.

      - `styles`

          A set of style options to apply to the text block (see [Supported styles](https://developers.klaviyo.com/en/reference/templates.md)).

          > [!NOTE]
          > When working with HTML blocks, do not include the `styles` field.

      - `display_options`

          An object of fields that map to display options that can be set in the template editor (See [Supported display options](https://developers.klaviyo.com/en/reference/templates.md)).

  - `created`

      The timestamp of when the universal content block was created.

  - `updated`

      The timestamp of when the universal content block was last updated.

  - `screenshot_status`

      The status of a screenshot for generating the universal content block's thumbnail.

  - `screenshot_url`

      A URL of the universal content block's screenshot.

> [!NOTE]
> Use our [Universal Content Postman collection](https://drive.google.com/file/d/1Hxzwya-aGNDYidsyTiO1xjEv7igUlNcT/view?usp=sharing) to quickly get started testing and building with the Universal Content API.

#### Creating a universal content block

Use the [Create Universal Content](https://developers.klaviyo.com/en/reference/create_universal_content.md) endpoint to add a universal content block to the customer's account. Text blocks have some default padding applied; if you are creating a text block with HTML contents, you will likely want to set the block's padding to 0 (See [supported styles](https://developers.klaviyo.com/en/reference/templates.md)).

```curl Button
curl --request POST \
     --url https://a.klaviyo.com/api/template-universal-content \
     --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": "template-universal-content",
        "attributes": {
            "name": "Button block name",
            "definition": {
                "content_type": "block",
                "type": "button",
                "data": {
                    "content": "SHOP NOW",
                    "properties": {
                        "href": "http://www.klaviyo.com"
                    },
                    "styles": {
                        "background_color": "#1155CC"
                    },
                    "display_options": {
                        "show_on": "desktop"
                    }
                }
            }
        }
    }
}
'
```
```curl Divider
curl --request POST \
     --url https://a.klaviyo.com/api/template-universal-content \
     --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": "template-universal-content",
        "attributes": {
            "name": "Divider block name",
            "definition": {
                "content_type": "block",
                "type": "horizontal_rule",
                "data": {
                    "styles": {
                        "block_padding_bottom": 30,
                        "block_padding_left": 30,
                        "block_padding_right": 30,
                        "block_padding_top": 30,
                        "border_color": "#D25959",
                        "border_style": "solid",
                        "border_width": 1
                    },
                    "display_options": {
                        "show_on": "desktop"
                    }
                }
            }
        }
    }
}
'
```
```curl Drop shadow
curl --request POST \
     --url https://a.klaviyo.com/api/template-universal-content/ \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'revision: 2025-04-15' \
     --data '
{
    "data": {
        "type": "template-universal-content",
        "attributes": {
            "name": "Drop shadow block name",
            "definition": {
                "content_type": "block",
                "type": "drop_shadow",
                "data": {
                    "styles": {
                        "block_background_color": "#FFFFFF",
                        "shadow_color": "dark"
                    },
                    "display_options": {
                        "show_on": "desktop"
                    }
                }
            }
        }
    }
}
'
```
```curl HTML
curl --request POST \
     --url https://a.klaviyo.com/api/template-universal-content/ \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'revision: 2025-04-15' \
     --data '
{
    "data": {
        "type": "template-universal-content",
        "attributes": {
            "name": "HTML block name",
            "definition": {
                "content_type": "block",
                "type": "html",
                "data": {
                    "content": "INSERT_HTML_CONTENT_HERE",
                    "display_options": {}
                }
            }
        }
    }
}
'
```
```curl Image
curl --request POST \
     --url https://a.klaviyo.com/api/template-universal-content \
     --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": "template-universal-content",
        "attributes": {
            "name": "Image block name",
            "definition": {
                "content_type": "block",
                "type": "image",
                "data": {
                    "properties": {
                        "dynamic": false,
                        "alt_text": "Our bestselling blue t-shirt.",
                        "asset_id": "193828341"
                    },
                    "styles": {
                        "background_color": "#0057FF",
                        "block_background_color": "#00FF5D",
                        "height": 1000,
                        "width": 888
                    },
                    "display_options": {}
                }
            }
        }
    }
}
'
```
```curl Spacer
curl --request POST \
     --url https://a.klaviyo.com/api/template-universal-content/ \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'revision: 2025-04-15' \
     --data '
{
    "data": {
        "type": "template-universal-content",
        "attributes": {
            "name": "Spacer block name",
            "definition": {
                "content_type": "block",
                "type": "spacer",
                "data": {
                    "styles": {
                        "background_color": "#0057FF"
                    },
                    "display_options": {
                        "show_on": "desktop"
                    }
                }
            }
        }
    }
}
'
```
```curl Text
curl --request POST \
     --url https://a.klaviyo.com/api/template-universal-content/ \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'revision: 2025-04-15' \
     --data '
{
    "data": {
        "type": "template-universal-content",
        "attributes": {
            "name": "Text block name",
            "definition": {
                "content_type": "block",
                "type": "text",
                "data": {
                    "content": "INSERT_TEXT_OR_HTML_CONTENT_HERE",
                    "styles": {
                        "block_padding_bottom": 0,
                        "block_padding_top": 0,
                        "block_padding_right": 0,
                        "block_padding_left": 0
                    },
                    "display_options": {}
                }
            }
        }
    }
}
'
```

> [!NOTE]
> **Note that the screenshot in the `screenshot_url` is generated asynchronously, so it might take a few minutes before it exists.**
>

##### Referencing web feed content

You can use the Create Universal Content endpoint to create a universal content block that references a web feed to support use cases with dynamic content, such as including lists of product reviews, blog posts, or user-generated content.

1. Make a call to [Create Web Feed](https://developers.klaviyo.com/en/reference/create_web_feed.md) to create a web feed. The example request below creates a web feed of product reviews:

```curl Request
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": {
      "name": "REVIEWS",
      "url": "https://test.com/file/product_reviews.json",
      "request_method": "get",
      "content_type": "json"
    }
  }
}
'
```

Here's what the feed looks like in JSON:

```json

{
  "productId": "123456",
  "reviews": [
    {
      "reviewId": "r001",
      "rating": 5,
      "title": "Absolutely love it!",
      "body": "This product exceeded my expectations. Highly recommend to anyone looking for quality and value.",
      "author": "Jane D.",
      "date": "2025-07-10"
    },
    {
      "reviewId": "r002",
      "rating": 4,
      "title": "Very good, just a small issue",
      "body": "Overall great product, though shipping took a bit longer than expected. Still happy with the purchase.",
      "author": "Carlos M.",
      "date": "2025-06-29"
    },
    {
      "reviewId": "r003",
      "rating": 5,
      "title": "Perfect in every way",
      "body": "Works flawlessly and looks even better in person. Would definitely buy again.",
      "author": "Aisha T.",
      "date": "2025-07-01"
    }
  ]
}

```

As shown above, this web feed contains an array of objects, `reviews`, where each object represents a product review that contains review details, such as `rating` and `body`. These values can be referenced in a universal content block.

2. Make a call to Create Universal Content to create an HTML universal content block that uses Django variables to fetch and display dynamic content from your web feed. The example below uses the `content_repeat` object to include the path to the web feed data (`repeat_for`) and the alias of the repeated item (`item_alias`) to use in the block's contents.

```curl Request
curl --location 'https://a.klaviyo.com/api/template-universal-content' \
--header 'Authorization: Klaviyo-API-Key YOUR-KEY-HERE' \
--header 'accept: application/vnd.api+json' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2025-04-15'
--data '
{
  "data": {
    "type": "template-universal-content",
    "attributes": {
      "definition": {
        "content_type": "block",
        "type": "html",
        "data": {
          "display_options": {
            "content_repeat": {
              "repeat_for": "feeds.REVIEWS.reviews",
              "item_alias": "review_article"
            }
          },
          "content": "  <div class=\"review\" style=\"margin-bottom: 20px;\">     <h3>Title: {{ review_article.title }}</h3>     <p><strong>Rating:</strong> {{ review_article.rating }} star{% if review_article.rating != 1 %}s{% endif %}</p>     <p>{{ review_article.body }}</p>     <p><em>— {{ review_article.author }}, {{ review_article.date }}</em></p>   </div>"
        }
      },
      "name": "All Reviews Universal Content Block"
    }
  }
}
'
```

Now you can drive value for your customers by creating web feeds for customers with universal content they can quickly drop into their templates.

#### Retrieving universal content blocks

The [Get All Universal Content](https://developers.klaviyo.com/en/reference/get_all_universal_content.md) endpoint is useful for retrieving information such as block content and styling for all universal content blocks.

Use the [Get Universal Content](https://developers.klaviyo.com/en/reference/get_universal_content.md) endpoint to fetch this information for a specified universal content block ID.

Below are examples of how a universal content block might look in your query response:

```json Button
{
    "data": {
        "type": "template-universal-content",
        "id": "8d342cbfe638405b91ff49950af1765c",
        "attributes": {
            "name": "Button Test",
            "definition": {
                "content_type": "block",
                "type": "button",
                "data": {
                    "content": "SHOP NOW",
                    "properties": {
                        "href": "http://www.klaviyo.com"
                    },
                    "display_options": {
                        "show_on": "desktop"
                    },
                    "styles": {
                        "background_color": "#1155CC"
                    }
                }
            },
            "created": "2025-05-09T20:12:28.323582+00:00",
            "updated": "2025-05-09T20:13:34.988260+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://example.com/screenshots/8d342cbfe638405b91ff49950af1765c.png"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/8d342cbfe638405b91ff49950af1765c/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-universal-content/8d342cbfe638405b91ff49950af1765c"
    }
}
```
```json Divider
{
    "data": {
        "type": "template-universal-content",
        "id": "bab3d71d688e483f98946d9b603ef87f",
        "attributes": {
            "name": "Divider block name",
            "definition": {
                "content_type": "block",
                "type": "horizontal_rule",
                "data": {
                    "display_options": {
                        "show_on": "desktop"
                    },
                    "styles": {
                        "block_padding_bottom": 30,
                        "block_padding_left": 30,
                        "block_padding_right": 30,
                        "block_padding_top": 30,
                        "border_color": "#D25959",
                        "border_style": "solid",
                        "border_width": 1
                    }
                }
            },
            "created": "2025-05-09T20:08:37.692442+00:00",
            "updated": "2025-05-09T20:08:47.543512+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://example.com/screenshots/bab3d71d688e483f98946d9b603ef87f.png"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/bab3d71d688e483f98946d9b603ef87f/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-universal-content/bab3d71d688e483f98946d9b603ef87f"
    }
}
```
```json Drop shadow
{
    "data": {
        "type": "template-universal-content",
        "id": "6f29ee607b524e1d9f1ab6c2043ea571",
        "attributes": {
            "name": "Drop shadow block name",
            "definition": {
                "content_type": "block",
                "type": "drop_shadow",
                "data": {
                    "display_options": {
                        "show_on": "desktop"
                    },
                    "styles": {
                        "block_background_color": "#FFFFFF",
                        "shadow_color": "dark"
                    }
                }
            },
            "created": "2025-05-09T20:20:18.168163+00:00",
            "updated": "2025-05-09T20:21:03.261814+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://example.com/screenshots/6f29ee607b524e1d9f1ab6c2043ea571.png"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/6f29ee607b524e1d9f1ab6c2043ea571/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-universal-content/6f29ee607b524e1d9f1ab6c2043ea571"
    }
}
```
```json HTML
{
    "data": {
        "type": "template-universal-content",
        "id": "4fc3b48d7f404d3ebd579b0d1c9ffe5c",
        "attributes": {
            "name": "HTML block name",
            "definition": {
                "content_type": "block",
                "type": "html",
                "data": {
                    "content": "TEXT_OR_HTML_CONTENT_HERE",
                    "styles": {},
                    "display_options": {}
                }
            },
            "created": "2024-05-23T14:26:36.530847+00:00",
            "updated": "2024-05-23T14:26:39.010728+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://klaviyo-template-thumbnails.s3.amazonaws.com/saved_content/4fc3b48d7f404d3ebd579b0d1c9ffe5c"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/4fc3b48d7f404d3ebd579b0d1c9ffe5c/"
        }
    }
}
```
```json Image
{
    "data": {
        "type": "template-universal-content",
        "id": "a4c6d1b33d014b2a99e55f887fb7d17e",
        "attributes": {
            "name": "Image block name",
            "definition": {
                "content_type": "block",
                "type": "image",
                "data": {
                    "properties": {
                        "dynamic": false,
                        "alt_text": "Our famous, blue t-shirt.",
                        "asset_id": "193828341",
                        "href": "",
                        "src": "https://d3k81ch9hvuctc.cloudfront.net/company/TWQgMA/images/fe6cb7cd-6cde-49d7-8c13-0439bd9b5c8c.jpeg"
                    },
                    "display_options": {},
                    "styles": {
                        "background_color": "#0057FF",
                        "height": 1000,
                        "width": 888
                    }
                }
            },
            "created": "2025-05-09T20:25:34.272695+00:00",
            "updated": "2025-05-09T20:36:29.224052+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://example.com/screenshots/a4c6d1b33d014b2a99e55f887fb7d17e.png"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/a4c6d1b33d014b2a99e55f887fb7d17e/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-universal-content/a4c6d1b33d014b2a99e55f887fb7d17e"
    }
}
```
```json Spacer
{
    "data": {
        "type": "template-universal-content",
        "id": "99bea286e260495285dd4197710c871c",
        "attributes": {
            "name": "Spacer block name",
            "definition": {
                "content_type": "block",
                "type": "spacer",
                "data": {
                    "display_options": {
                        "show_on": "desktop"
                    },
                    "styles": {
                        "background_color": "#0057FF"
                    }
                }
            },
            "created": "2025-05-09T20:54:02.543016+00:00",
            "updated": "2025-05-09T20:54:09.947621+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://example.com/screenshots/99bea286e260495285dd4197710c871c.png"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/99bea286e260495285dd4197710c871c/"
        }
    },
    "links": {
        "self": "https://a.klaviyo.com/api/template-universal-content/99bea286e260495285dd4197710c871c"
    }
}
```
```json Text
{
    "data": {
        "type": "template-universal-content",
        "id": "4fc3b48d7f404d3ebd579b0d1c9ffe5c",
        "attributes": {
            "name": "Text block name",
            "definition": {
                "content_type": "block",
                "type": "text",
                "data": {
                    "content": "TEXT_OR_HTML_CONTENT_HERE",
                    "styles": {
                        "block_padding_left": 0,
                        "block_padding_right": 0,
                        "block_padding_top": 0,
                        "block_padding_bottom": 0
                    },
                    "display_options": {}
                }
            },
            "created": "2024-05-23T14:26:36.530847+00:00",
            "updated": "2024-05-23T14:26:39.010728+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://klaviyo-template-thumbnails.s3.amazonaws.com/saved_content/4fc3b48d7f404d3ebd579b0d1c9ffe5c"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/4fc3b48d7f404d3ebd579b0d1c9ffe5c/"
        }
    }
}
```

#### Querying templates

Querying universal content blocks with the Universal Content API can help you achieve many use cases, such as retrieving HTML for a specific block. Check out the supported query parameters below and test them with our [latest Postman collection](https://developers.klaviyo.com/en/docs/use_klaviyos_postman_collections.md). Note that support for given operators and fields is endpoint-specific. Review the [API reference documentation](https://developers.klaviyo.com/en/reference/get_all_universal_content.md) for more information on allowed fields and query operators.

| Parameter | Description                                                                                                                                                                                    | Query example                                                                 |
| :-------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- |
| `filter`  | Retrieve a subset of universal content blocks, e.g., blocks that have been created within a given time frame. Learn about the [filter query parameter](https://developers.klaviyo.com/en/docs/filtering_.md). | `GET /api/template-universal-content?filter=greater-than(created,"2023-06-05T12:30:00+00:00")` |
| `sort`    | Sort universal content blocks, e.g., by date created in ascending order (oldest to newest). Learn about the [sort query parameter](https://developers.klaviyo.com/en/docs/sorting_.md).                          | `GET /api/template-universal-content?sort=created`                                             |
| `fields`  | Request for only specified universal content block data, e.g., HTML content. Learn more about [sparse fieldsets](https://developers.klaviyo.com/en/docs/sparse_fieldsets.md).                                            | `GET /api/template-universal-content?fields[template-universal-content]=definition.data.content`                                    |

#### Updating a universal content block

> [!CAUTION]
> User confirmation is strongly recommended before updating existing universal content.

Updating a universal content block with [Update Universal Content](https://developers.klaviyo.com/en/reference/update_universal_content.md) will visually update all templates using the universal content (see example below).

> [!WARNING]
> All JSON supplied in the `definition` field will fully replace what's currently stored. For example, if you only need to update the content, you must include the `content` as well as existing `styles` and `display_options`. Otherwise, the data for those fields will be cleared. To rename a universal content block without touching its content, omit `definition` entirely from the request. Note that a block's `type` (e.g., `text`, `image`) can't be changed via `definition` — to change the type, delete and recreate the block instead.

The example request below updates an HTML block:

```curl Request
curl --request PATCH \
     --url https://a.klaviyo.com/api/template-universal-content/4fc3b48d7f404d3ebd579b0d1c9ffe5c/ \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'revision: 2024-10-15' \
     --data '
{
  "data": {
    "type": "template-universal-content",
    "id": "4fc3b48d7f404d3ebd579b0d1c9ffe5c",
    "attributes": {
      "definition": {
        "content_type": "block",
        "type": "html",
        "data": {
          "content": "UPDATED_HTML_FOR_THE_BLOCK_HERE",
          "styles": {},
          "display_options": {}
        }
      }
    }
  }
}
'
```
```json Response
{
    "data": {
        "type": "template-universal-content",
        "id": "4fc3b48d7f404d3ebd579b0d1c9ffe5c",
        "attributes": {
            "name": "NAME",
            "definition": {
                "content_type": "block",
                "type": "html",
                "data": {
                    "content": "UPDATED_HTML_FOR_THE_BLOCK_HERE",
                    "styles": {},
                    "display_options": {}
                }
            },
            "created": "2024-05-23T14:26:36.530847+00:00",
            "updated": "2024-05-23T14:26:39.010728+00:00",
            "screenshot_status": "completed",
            "screenshot_url": "https://klaviyo-template-thumbnails.s3.amazonaws.com/saved_content/4fc3b48d7f404d3ebd579b0d1c9ffe5c"
        },
        "links": {
            "self": "https://a.klaviyo.com/api/template-universal-content/4fc3b48d7f404d3ebd579b0d1c9ffe5c/"
        }
    }
}
```

#### Deleting a universal content block

> [!CAUTION]
> User confirmation is strongly recommended before deleting universal content.

Use the [Delete Universal Content](https://developers.klaviyo.com/en/reference/delete_universal_content.md) endpoint to delete a universal content block, given a universal content block ID. Once the block has been deleted, any templates using the universal content block will no longer all be attached to a universal content block instance. The templates will visually appear unchanged after the deletion of the content block, i.e., deleted blocks will be turned into a regular, non-universal block.

#### Supported styles

View the table below for the available style options for text blocks.

| Style name               | Description                                                                                                             |
| :----------------------- | :---------------------------------------------------------------------------------------------------------------------- |
| `block_background_color` | Background color of the block (e.g., `"#ffffff"`)                                                                       |
| `block_border_color`     | Border color of the block (e.g., `"#000000"`).                                                                          |
| `block_border_style`     | Border style (e.g., `"solid"`). Supports CSS border-style values.                                                       |
| `block_padding_left`     | Amount (in pixels) of left padding on the block. Defaults to 18.                                                        |
| `block_padding_right`    | Amount (in pixels) of right padding on the block. Defaults to 18.                                                       |
| `block_padding_bottom`   | Amount (in pixels) of bottom padding on the block. Defaults to 9.                                                       |
| `block_padding_top`      | Amount (in pixels) of top padding on the block. Defaults to 9.                                                          |
| `color`                  | Foreground color of text and text decoration (e.g., `"#000000"`).                                                       |
| `inner_padding_bottom`   | Bottom padding on the text area. This is additive with block-level padding.                                             |
| `inner_padding_left`     | Left padding on the text area. This is additive with block-level padding.                                               |
| `inner_padding_right`    | Right padding on the text area. This is additive with block-level padding.                                              |
| `inner_padding_top`      | Top padding on the text area. This is additive with block-level padding.                                                |
| `letter_spacing`         | Pixel-based [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) CSS property (e.g., `8`). |
| `line_height`            | Percentage-based [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) CSS property (e.g.,`150`). |
| `text_align`             | See [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) CSS property (e.g., `"center"`).          |
| `text_table_layout`      | See [table-layout](https://developer.mozilla.org/en-US/docs/Web/CSS/table-layout) CSS property (e.g., `"auto"`).        |

#### Supported display options

The `display_options` object contains fields that map to the options set for _Display_ in the template editor.

| Display option name | Description |
| --- | --- |
| `show_on` | Determines which platforms display the block. Options include: `all`, `desktop`, `mobile`. |
| `visible_check` | A check to determine whether a recipient will see the block (e.g., `"person.Country == \"Canada\""`). Maps to _Show/Hide Logic_ in the UI. |
| `content_repeat` | Options include:<br /><ul><li>`repeat_for`, the key to repeat, typically a path to an event or profile property (e.g., `"event.items"`). <li> `item_alias`, the alias of the repeated item to use in the block's contents (e.g., `"item"`). </ul> |

- [Get All Universal Content](https://developers.klaviyo.com/en/v2026-01-15/reference/get_all_universal_content.md): `GET /api/template-universal-content`
- [Get Universal Content](https://developers.klaviyo.com/en/v2026-01-15/reference/get_universal_content.md): `GET /api/template-universal-content/{id}`
- [Create Universal Content](https://developers.klaviyo.com/en/v2026-01-15/reference/create_universal_content.md): `POST /api/template-universal-content`
- [Update Universal Content](https://developers.klaviyo.com/en/v2026-01-15/reference/update_universal_content.md): `PATCH /api/template-universal-content/{id}`
- [Delete Universal Content](https://developers.klaviyo.com/en/v2026-01-15/reference/delete_universal_content.md): `DELETE /api/template-universal-content/{id}`
