Klaviyo Templates API

templates

Operations 12

GET /api/templates Get Templates #
POST /api/templates Create Template #
GET /api/templates/{id} Get Template #
PATCH /api/templates/{id} Update Template #
DELETE /api/templates/{id} Delete Template #
GET /api/template-universal-content Get All Universal Content #
POST /api/template-universal-content Create Universal Content #
GET /api/template-universal-content/{id} Get Universal Content #
PATCH /api/template-universal-content/{id} Update Universal Content #
DELETE /api/template-universal-content/{id} Delete Universal Content #
POST /api/template-render Render Template #
POST /api/template-clone Clone Template #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/klaviyo-templates-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

klaviyo-templates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Klaviyo Accounts Templates API
  version: '2026-04-15'
  description: The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
  contact:
    name: Klaviyo Developer Experience Team
    email: developers@klaviyo.com
    url: https://developers.klaviyo.com
  termsOfService: https://www.klaviyo.com/legal/api-terms
  license:
    name: License
    url: https://www.klaviyo.com/legal
servers:
- url: https://a.klaviyo.com
  description: Production
security:
- Klaviyo-API-Key: []
tags:
- name: Templates
  description: templates
paths:
  /api/templates:
    get:
      operationId: get_templates
      summary: Get Templates
      description: 'Get all templates in an account.


        Use `additional-fields[template]=definition` to include the full template

        definition for SYSTEM_DRAGGABLE templates.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:read`'
      parameters:
      - name: additional-fields[template]
        in: query
        description: 'Request additional fields not included by default in the response. Supported values: ''definition'''
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - definition
        explode: false
      - name: fields[template]
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - amp
            - created
            - definition
            - definition.body
            - definition.body.id
            - definition.body.properties
            - definition.body.properties.css_class
            - definition.body.properties.id
            - definition.body.sections
            - definition.body.styles
            - definition.body.styles.background_color
            - definition.body.styles.width
            - definition.id
            - definition.styles
            - definition.template_id
            - editor_type
            - html
            - name
            - text
            - updated
        explode: false
      - name: filter
        in: query
        description: 'For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `contains`, `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`'
        schema:
          type: string
          example: equals(id,['example'])
      - name: page[cursor]
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
        required: false
        schema:
          type: string
      - name: page[size]
        in: query
        description: 'Default: 10. Min: 1. Max: 10.'
        required: false
        schema:
          type: integer
          default: 10
          maximum: 10
          minimum: 1
      - name: sort
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sorting
        schema:
          type: string
          enum:
          - created
          - -created
          - id
          - -id
          - name
          - -name
          - updated
          - -updated
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/GetTemplateDndResponseCollection'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:read
    post:
      operationId: create_template
      summary: Create Template
      description: 'Create a new HTML or drag-and-drop template.


        If there are 1,000 or more templates in an account, creation will fail as there is a limit of 1,000 templates

        that can be created via the API.


        Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:write`'
      parameters:
      - name: additional-fields[template]
        in: query
        description: 'Request additional fields not included by default in the response. Supported values: ''definition'''
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - definition
        explode: false
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TemplateCreateHtmlOrDndQuery'
      responses:
        '201':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/PostTemplateDndResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:write
  /api/templates/{id}:
    get:
      operationId: get_template
      summary: Get Template
      description: 'Get a template with the given template ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:read`'
      parameters:
      - name: id
        in: path
        description: The ID of template
        required: true
        schema:
          description: The ID of template
          type: string
      - name: additional-fields[template]
        in: query
        description: 'Request additional fields not included by default in the response. Supported values: ''definition'''
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - definition
        explode: false
      - name: fields[template]
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - amp
            - created
            - definition
            - definition.body
            - definition.body.id
            - definition.body.properties
            - definition.body.properties.css_class
            - definition.body.properties.id
            - definition.body.sections
            - definition.body.styles
            - definition.body.styles.background_color
            - definition.body.styles.width
            - definition.id
            - definition.styles
            - definition.template_id
            - editor_type
            - html
            - name
            - text
            - updated
        explode: false
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/GetTemplateDndResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:read
    patch:
      operationId: update_template
      summary: Update Template
      description: 'Update a template with the given template ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:write`'
      parameters:
      - name: id
        in: path
        description: The ID of template
        required: true
        schema:
          description: The ID of template
          type: string
      - name: additional-fields[template]
        in: query
        description: 'Request additional fields not included by default in the response. Supported values: ''definition'''
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - definition
        explode: false
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TemplateUpdateHtmlOrDndQuery'
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/PatchTemplateDndResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:write
    delete:
      operationId: delete_template
      summary: Delete Template
      description: 'Delete a template with the given template ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:write`'
      parameters:
      - name: id
        in: path
        description: The ID of template
        required: true
        schema:
          description: The ID of template
          type: string
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      responses:
        '204':
          description: Success
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:write
  /api/template-universal-content:
    get:
      operationId: get_all_universal_content
      summary: Get All Universal Content
      description: 'Get all universal content in an account.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:read`'
      parameters:
      - name: fields[template-universal-content]
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - created
            - definition
            - definition.content_type
            - definition.data
            - definition.data.content
            - definition.data.display_options
            - definition.data.display_options.content_repeat
            - definition.data.display_options.content_repeat.item_alias
            - definition.data.display_options.content_repeat.repeat_for
            - definition.data.display_options.show_on
            - definition.data.display_options.visible_check
            - definition.data.styles
            - definition.data.styles.background_color
            - definition.data.styles.block_background_color
            - definition.data.styles.block_border_color
            - definition.data.styles.block_border_style
            - definition.data.styles.block_border_width
            - definition.data.styles.block_padding_bottom
            - definition.data.styles.block_padding_left
            - definition.data.styles.block_padding_right
            - definition.data.styles.block_padding_top
            - definition.data.styles.color
            - definition.data.styles.extra_css_class
            - definition.data.styles.font_family
            - definition.data.styles.font_size
            - definition.data.styles.font_style
            - definition.data.styles.font_weight
            - definition.data.styles.inner_padding_bottom
            - definition.data.styles.inner_padding_left
            - definition.data.styles.inner_padding_right
            - definition.data.styles.inner_padding_top
            - definition.data.styles.letter_spacing
            - definition.data.styles.line_height
            - definition.data.styles.mobile_stretch_content
            - definition.data.styles.text_align
            - definition.data.styles.text_decoration
            - definition.data.styles.text_table_layout
            - definition.type
            - name
            - screenshot_status
            - screenshot_url
            - updated
        explode: false
      - name: filter
        in: query
        description: 'For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`, `equals`<br>`name`: `any`, `equals`<br>`created`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`definition.content_type`: `equals`<br>`definition.type`: `equals`'
        schema:
          type: string
          example: equals(id,'01HWWWKAW4RHXQJCMW4R2KRYR4')
      - name: page[cursor]
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
        required: false
        schema:
          type: string
      - name: page[size]
        in: query
        description: 'Default: 20. Min: 1. Max: 100.'
        required: false
        schema:
          type: integer
          default: 20
          maximum: 100
          minimum: 1
      - name: sort
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sorting
        schema:
          type: string
          enum:
          - created
          - -created
          - id
          - -id
          - name
          - -name
          - updated
          - -updated
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/GetUniversalContentResponseCollection'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-operation-aliases:
      - get_template_universal_content
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:read
      x-klaviyo-subtag: Universal Content
    post:
      operationId: create_universal_content
      summary: Create Universal Content
      description: 'Create universal content. Currently supported block types are: `button`, `drop_shadow`, `horizontal_rule`, `html`, `image`, `spacer`, and `text`.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:write`'
      parameters:
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      requestBody:
        description: Create a template universal content
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/UniversalContentCreateQuery'
      responses:
        '201':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/PostUniversalContentResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-operation-aliases:
      - create_template_universal_content
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:write
      x-klaviyo-subtag: Universal Content
  /api/template-universal-content/{id}:
    get:
      operationId: get_universal_content
      summary: Get Universal Content
      description: 'Get the universal content with the given ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:read`'
      parameters:
      - name: id
        in: path
        description: The ID of the universal content
        required: true
        schema:
          description: The ID of the universal content
          type: string
          example: 01HWWWKAW4RHXQJCMW4R2KRYR4
      - name: fields[template-universal-content]
        in: query
        description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
        required: false
        schema:
          type: array
          items:
            type: string
            enum:
            - created
            - definition
            - definition.content_type
            - definition.data
            - definition.data.content
            - definition.data.display_options
            - definition.data.display_options.content_repeat
            - definition.data.display_options.content_repeat.item_alias
            - definition.data.display_options.content_repeat.repeat_for
            - definition.data.display_options.show_on
            - definition.data.display_options.visible_check
            - definition.data.styles
            - definition.data.styles.background_color
            - definition.data.styles.block_background_color
            - definition.data.styles.block_border_color
            - definition.data.styles.block_border_style
            - definition.data.styles.block_border_width
            - definition.data.styles.block_padding_bottom
            - definition.data.styles.block_padding_left
            - definition.data.styles.block_padding_right
            - definition.data.styles.block_padding_top
            - definition.data.styles.color
            - definition.data.styles.extra_css_class
            - definition.data.styles.font_family
            - definition.data.styles.font_size
            - definition.data.styles.font_style
            - definition.data.styles.font_weight
            - definition.data.styles.inner_padding_bottom
            - definition.data.styles.inner_padding_left
            - definition.data.styles.inner_padding_right
            - definition.data.styles.inner_padding_top
            - definition.data.styles.letter_spacing
            - definition.data.styles.line_height
            - definition.data.styles.mobile_stretch_content
            - definition.data.styles.text_align
            - definition.data.styles.text_decoration
            - definition.data.styles.text_table_layout
            - definition.type
            - name
            - screenshot_status
            - screenshot_url
            - updated
        explode: false
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/GetUniversalContentResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:read
      x-klaviyo-subtag: Universal Content
    patch:
      operationId: update_universal_content
      summary: Update Universal Content
      description: 'Update universal content. The `definition` field can only be updated on the following block types at this time: `button`, `drop_shadow`, `horizontal_rule`, `html`, `image`, `spacer`, and `text`.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:write`'
      parameters:
      - name: id
        in: path
        description: The ID of the template universal content
        required: true
        schema:
          description: The ID of the template universal content
          type: string
          example: 01HWWWKAW4RHXQJCMW4R2KRYR4
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      requestBody:
        description: Update a universal content by ID
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/UniversalContentPartialUpdateQuery'
      responses:
        '200':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/PatchUniversalContentResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-operation-aliases:
      - update_template_universal_content
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:write
      x-klaviyo-subtag: Universal Content
    delete:
      operationId: delete_universal_content
      summary: Delete Universal Content
      description: 'Delete the universal content with the given ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:write`'
      parameters:
      - name: id
        in: path
        description: The ID of the template universal content
        required: true
        schema:
          description: The ID of the template universal content
          type: string
          example: 01HWWWKAW4RHXQJCMW4R2KRYR4
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      responses:
        '204':
          description: Success
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-operation-aliases:
      - delete_template_universal_content
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:write
      x-klaviyo-subtag: Universal Content
  /api/template-render:
    post:
      operationId: render_template
      summary: Render Template
      description: 'Render a template with the given template ID and context attribute. Returns the AMP, HTML, and plain text versions of the email template.


        **Request body parameters** (nested under `attributes`):


        * `return_fields`: Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/reference/api_overview#sparse-fieldsets).


        * `context`: This is the context your email template will be rendered with. You must pass in a `context` object as a JSON object.


        Email templates are rendered with contexts in a similar manner to Django templates. Nested template variables can be referenced via dot notation. Template variables without corresponding `context` values are treated as `FALSE` and output nothing.


        Ex. `{ "name" : "George Washington", "state" : "VA" }`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m`


        **Scopes:**

        `templates:read`'
      parameters:
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TemplateRenderQuery'
      responses:
        '201':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/PostTemplateResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-operation-aliases:
      - create_template_render
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 3/s
        steady: 60/m
      x-klaviyo-scopes:
      - templates:read
  /api/template-clone:
    post:
      operationId: clone_template
      summary: Clone Template
      description: 'Create a clone of a template with the given template ID.


        If there are 1,000 or more templates in an account, cloning will fail as there is a limit of 1,000 templates

        that can be created via the API.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m`


        **Scopes:**

        `templates:write`'
      parameters:
      - name: revision
        in: header
        description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
        required: true
        schema:
          type: string
          default: '2026-04-15'
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/TemplateCloneQuery'
      responses:
        '201':
          description: Success
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/PostTemplateResponse'
        4XX:
          $ref: '#/components/responses/ClientError'
        5XX:
          $ref: '#/components/responses/ServerError'
      tags:
      - Templates
      x-klaviyo-operation-aliases:
      - create_template_clone
      x-klaviyo-pre-release: None
      x-klaviyo-ratelimit:
        burst: 75/s
        steady: 750/m
      x-klaviyo-scopes:
      - templates:write
components:
  schemas:
    ButtonBlockProperties:
      type: object
      properties:
        href:
          type:
          - string
          - 'null'
    TemplateEnum:
      type: string
      enum:
      - template
    HeaderLinkSubBlock:
      type: object
      properties:
        id:
          type:
          - string
          - 'null'
          readOnly: true
        type:
          type: string
          enum:
          - header_link_bar_button
        background_color:
          type:
          - string
          - 'null'
        content:
          type:
          - string
          - 'null'
        drop_shadow_color:
          type:
          - string
          - 'null'
        href:
          type:
          - string
          - 'null'
        show_on:
          description: Show on.
          type:
          - string
          - 'null'
          enum:
          - all
          - desktop
          - mobile
      required:
      - type
    ButtonBlockStyles:
      type: object
      properties:
        background_color:
          type:
          - string
          - 'null'
        block_background_color:
          type:
          - string
          - 'null'
        block_padding_bottom:
          type:
          - integer
          - 'null'
        block_padding_left:
          type:
          - integer
          - 'null'
        block_padding_right:
          type:
          - integer
          - 'null'
        block_padding_top:
          type:
          - integer
          - 'null'
        border_color:
          type:
          - string
          - 'null'
        border_radius:
          type:
          - integer
          - 'null'
        border_style:
          description: Border style.
          type:
          - string
          - 'null'
          enum:
          - dashed
          - dotted
          - groove
          - inset
          - none
          - outset
          - ridge
          - solid
        border_width:
          type:
          - integer
          - 'null'
        color:
          type:
          - string
          - 'null'
        drop_shadow_color:
          type:
          - string
          - 'null'
        font_family:
          type:
          - string
          - 'null'
        font_size:
          type:
          - integer
          - 'null'
        font_style:
          description: Font style.
          type:
          - string
          - 'null'
          enum:
          - italic
          - normal
        font_weight:
          type:
          - string
          - 'null'
        inner_padding_bottom:
          type:
          - integer
          - 'null'
        inner_padding_left:
          type:
          - integer
          - 'null'
        inner_padding_right:
          type:
          - integer
          - 'null'
        inner_padding_top:
          type:
          - integer
          - 'null'
        letter_spacing:
          type:
          - integer
          - 'null'
        mobile_stretch_content:
          type:
          - boolean
          - 'null'
        stretch:
          type:
          - boolean
          - 'null'
        text_align:
          description: Text Alignment.
          type:
          - string
          - 'null'
          enum:
          - center
          - left
          - right
        text_decoration:
          type:
          - string
          - 'null'
    TemplateRenderQueryResourceObject:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/TemplateEnum'
        id:
          description: The ID of template
          type: string
        attributes:
          type: object
          properties:
            context:
              description: The context for the template render. This must be a JSON object which has values for any tags used in the template. See [this doc](https://help.klaviyo.com/hc/en-us/articles/4408802648731) for more details.
              type: object
              example:
                first_name: Jane
                last_name: Smith
          required:
          - context
      required:
      - type
      - id
      - attributes
    BaseStyleStyles:
      type: object
      properties:
        background_asset_id:
          type:
          - string
          - 'null'
        background_format:
          description: Background format.
          type:
          - string
          - 'null'
          enum:
          - auto
          - con

# --- truncated at 32 KB (163 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/klaviyo/refs/heads/main/openapi/klaviyo-templates-api-openapi.yml