> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Klaviyo Integration for AI Agents & Workflows

> Email marketing and automation platform for personalized customer experiences. Manage lists, profiles, and subscriptions for targeted email campaigns.

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img className="block dark:hidden" src="https://mintcdn.com/modulexaillc/df8MOr-hXotYLTh5/logos/klaviyo-light.svg?fit=max&auto=format&n=df8MOr-hXotYLTh5&q=85&s=03ff0ac1b33249c4412997884d5c24ad" alt="Klaviyo logo" width="72" height="72" data-path="logos/klaviyo-light.svg" />

<img className="hidden dark:block" src="https://mintcdn.com/modulexaillc/df8MOr-hXotYLTh5/logos/klaviyo-dark.svg?fit=max&auto=format&n=df8MOr-hXotYLTh5&q=85&s=28364abe274d2bb654e3d103f00925d0" alt="Klaviyo logo" width="72" height="72" data-path="logos/klaviyo-dark.svg" />

## Overview

Add **Klaviyo** to any ModuleX agent or workflow. Email-marketing list and profile management against the Klaviyo REST API (`a.klaviyo.com/api`), pinned to revision `2024-10-15`.

<Info>
  **Categories**: Marketing & Advertising · Marketing & Email · Email · Automation · Development · **Auth**: Private API Key · **Actions**: 5
</Info>

## Authentication

### Private API Key

Authenticate using your Klaviyo Private API Key. Create one in Settings > API Keys

#### Required Credentials

| Field                   | Description                                         | Required | Format                                |
| ----------------------- | --------------------------------------------------- | -------- | ------------------------------------- |
| Klaviyo Private API Key | Your Klaviyo Private API Key for API authentication | Yes      | `pk_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` |

## Available Actions

<AccordionGroup>
  <Accordion title="get_lists — Get a listing of all lists in a Klaviyo account with optional sorting and pagination">
    ### Parameters

    <ResponseField name="sort" type="string">
      Field to sort by: 'created', 'id', 'name', or 'updated' (Default: `created`)
    </ResponseField>

    <ResponseField name="sort_direction" type="string">
      Sort direction: 'asc' or 'desc' (Default: `desc`)
    </ResponseField>

    <ResponseField name="max_results" type="integer">
      Maximum number of lists to return (Default: `100`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "KlaviyoList": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "created": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created"
            },
            "updated": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated"
            },
            "opt_in_process": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Opt In Process"
            }
          },
          "title": "KlaviyoList",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "lists": {
          "items": {
            "$ref": "#/$defs/KlaviyoList"
          },
          "title": "Lists",
          "type": "array"
        },
        "count": {
          "default": 0,
          "title": "Count",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetListsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_list — Get a specific Klaviyo list by its ID">
    ### Parameters

    <ResponseField name="list_id" type="string" required>
      The ID of the Klaviyo list to retrieve
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "created": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created"
        },
        "updated": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated"
        },
        "opt_in_process": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Opt In Process"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetListOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_list — Create a new list in a Klaviyo account">
    ### Parameters

    <ResponseField name="name" type="string" required>
      The name for the new list
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "created": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created"
        },
        "updated": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated"
        },
        "opt_in_process": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Opt In Process"
        }
      },
      "required": [
        "success"
      ],
      "title": "CreateListOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_profiles — Get profiles from a Klaviyo account with optional sorting and pagination">
    ### Parameters

    <ResponseField name="max_results" type="integer">
      Maximum number of profiles to return (Default: `100`)
    </ResponseField>

    <ResponseField name="sort" type="string">
      Field to sort by: 'created', 'updated', 'email' (Default: `created`)
    </ResponseField>

    <ResponseField name="sort_direction" type="string">
      Sort direction: 'asc' or 'desc' (Default: `desc`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "KlaviyoProfile": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Id"
            },
            "email": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Email"
            },
            "first_name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "First Name"
            },
            "last_name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Last Name"
            },
            "phone_number": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Phone Number"
            },
            "created": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Created"
            },
            "updated": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Updated"
            }
          },
          "title": "KlaviyoProfile",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "profiles": {
          "items": {
            "$ref": "#/$defs/KlaviyoProfile"
          },
          "title": "Profiles",
          "type": "array"
        },
        "count": {
          "default": 0,
          "title": "Count",
          "type": "integer"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetProfilesOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="add_members_to_list — Add one or more profiles to a specific Klaviyo list">
    ### Parameters

    <ResponseField name="list_id" type="string" required>
      The ID of the list to add members to
    </ResponseField>

    <ResponseField name="profile_ids" type="array" required>
      List of profile IDs to add to the list
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "list_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "List Id"
        },
        "profiles_added": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Profiles Added"
        },
        "profile_ids": {
          "items": {
            "type": "string"
          },
          "title": "Profile Ids",
          "type": "array"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Extra"
        }
      },
      "required": [
        "success"
      ],
      "title": "AddMembersToListOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* Pagination follows JSON:API cursor links — both `get_lists` and
  `get_profiles` page through results until `max_results` is reached
  or `links.next` is exhausted.
* Failures (any non-2xx, plus exceptions) surface as `success=False`
  with an `error` string. Empty/blank API keys short-circuit before
  the HTTP call.

## Related integrations

<CardGroup cols={3}>
  <Card title="SendGrid" href="/integrations/tools/sendgrid" />

  <Card title="Pinterest" href="/integrations/tools/pinterest" />

  <Card title="AgentMail" href="/integrations/tools/agentmail" />
</CardGroup>

## Links

* [Klaviyo](https://www.klaviyo.com)
