Klaviyo icon

Klaviyo

Interact with the Klaviyo API

Actions17

Overview

The node interacts with the Klaviyo API to retrieve detailed information about a specific email template. When using the "Get One" operation under the "Template" resource, it fetches data for a single template identified by its unique Template ID. This is useful in scenarios where you want to programmatically access and utilize the content or metadata of an existing email template within your workflows, such as for dynamic email generation, auditing templates, or integrating template data into other systems.

Practical examples include:

  • Fetching the HTML content of a particular email template to send customized emails.
  • Retrieving metadata like creation or update timestamps for reporting purposes.
  • Accessing different fields of a template selectively to optimize data usage.

Properties

Name Meaning
Template ID The unique identifier of the email template to retrieve. This is required to specify which template to get.
Template Fields Select which fields of the template to return. Options include: name, editor_type, html, text, amp, created, updated. If none are selected, all fields may be returned by default.

Output

The output JSON contains the requested template data fields as specified by the "Template Fields" property. These fields correspond to the properties of the email template in Klaviyo, such as:

  • name: The name of the template.
  • editor_type: The type of editor used for the template.
  • html: The HTML content of the template.
  • text: The plain text version of the template.
  • amp: AMP (Accelerated Mobile Pages) version of the template if available.
  • created: Timestamp when the template was created.
  • updated: Timestamp when the template was last updated.

The node does not output binary data; all data is returned as JSON.

Dependencies

  • Requires an active connection to the Klaviyo API.
  • Needs an API authentication token credential configured in n8n to authorize requests.
  • The base URL for API requests is https://a.klaviyo.com/api.
  • Requests use JSON API format with appropriate headers set (Accept and Content-Type).

Troubleshooting

  • Missing or invalid Template ID: The node requires a valid Template ID; ensure this is provided and correct.
  • API authentication errors: Verify that the API key credential is correctly configured and has sufficient permissions.
  • Field selection issues: If no fields are selected, the API might return default fields or an error depending on Klaviyo's API behavior. Select at least one field to avoid ambiguity.
  • Network or connectivity problems: Ensure that the n8n instance can reach the Klaviyo API endpoint.
  • Unexpected API responses: Check if the template exists and the Template ID is accurate; non-existent IDs will result in errors.

Links and References

Discussion