Klaviyo icon

Klaviyo

Interact with the Klaviyo API

Actions17

Overview

This node interacts with the Klaviyo API to retrieve multiple email templates. It is designed to fetch a list of templates with support for pagination, sorting, and filtering based on various template attributes. This functionality is useful when you want to automate workflows that involve managing or analyzing your email templates in Klaviyo, such as syncing templates to another system, auditing template usage, or dynamically selecting templates for campaigns.

Practical examples:

  • Retrieve all templates created after a certain date to review recent changes.
  • Fetch templates sorted by name to display them alphabetically in a dashboard.
  • Use pagination cursors to process large numbers of templates in batches.

Properties

Name Meaning
Page Cursor A string cursor used for pagination to fetch the next page of templates.
Sort Defines the order in which templates are returned. Options include: created (Oldest First), created (Newest First), id (A-Z), id (Z-A), name (A-Z), name (Z-A), updated (Oldest First), updated (Newest First).
Filters Allows filtering templates by specific fields or dates. You can add multiple filters:
- Field filter: Filter by id or name with a specific value.
- Date filter: Filter by created or updated date using operators like equals, greater-than, less-than, etc.
Template Fields Select which template fields to include in the response. Options include: name, editor_type, html, text, amp, created, updated. If none selected, defaults to all fields.

Output

The node outputs JSON data representing the retrieved templates. Each item in the output contains the requested template fields such as name, editor type, HTML content, text content, AMP content, creation date, and last updated date depending on the selected fields.

If pagination is used, the output may also include metadata for fetching subsequent pages via the page cursor.

No binary data output is produced by this node.

Dependencies

  • Requires an API key credential for authenticating with the Klaviyo API.
  • The node uses the base URL https://a.klaviyo.com/api and expects JSON API formatted requests and responses.
  • No additional external dependencies beyond the Klaviyo API and proper credential configuration in n8n.

Troubleshooting

  • Invalid API Key or Authentication Errors: Ensure the API key credential is correctly configured and has sufficient permissions to access templates.
  • Pagination Issues: If no results appear when using a page cursor, verify the cursor value is correct and not expired.
  • Filter Syntax Errors: Filters must be properly constructed; invalid field names or date formats can cause errors. Use the provided options to avoid mistakes.
  • Empty Results: May occur if filters exclude all templates or if the account has no templates matching criteria.
  • API Rate Limits: Excessive requests may trigger rate limiting by Klaviyo. Implement delays or error handling to manage this.

Links and References

Discussion