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

# Klaviyo Integration

> Connect Klaviyo with ChatbotX to create or update a profile and add it to a selected list from a Flow.

The **Klaviyo** integration creates or updates a Profile from ChatbotX contact data directly within a Flow. The action uses the email address to identify the Profile, can add it to a List, and can sync Title, Organization, and Custom Properties.

For example, after a customer provides an email address for product advice, ChatbotX sends their contact details and interests to Klaviyo for Profile segmentation and content personalization.

## Prepare your Private API Key

Create a Klaviyo **Private API Key** before connecting the integration. Do not use the **Public API Key / site ID**, because it does not grant permission to create or update Profiles.

<Steps>
  <Step title="Sign in to Klaviyo">
    Sign in to the Klaviyo account that you want to connect to ChatbotX.
  </Step>

  <Step title="Open API keys">
    Open **Settings**, select the **General** tab, then select **API keys** from the left menu.
  </Step>

  <Step title="Create a Private API Key">
    In **Private API Keys**, select **Create Private API Key** and enter a name that identifies the key.
  </Step>

  <Step title="Grant the required permissions">
    Grant read and write access to **Profiles** and **Lists**. You can use **Full Access**, but you should grant only the permissions ChatbotX needs.
  </Step>

  <Step title="Copy the Private API Key">
    Finish creating the key, copy its value, and store it securely. Klaviyo does not display the complete Private API Key again after you close the creation window.

    See the official [Obtain API credentials](https://developers.klaviyo.com/en/docs/retrieve_api_credentials) guide.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/f4ikNOBcEIN2hXqg/images/create_klaviyo_private_api_key.png?fit=max&auto=format&n=f4ikNOBcEIN2hXqg&q=85&s=7bdc8778b8609a16f62470c68399e98f" alt="Create a Klaviyo Private API Key" width="2979" height="1569" data-path="images/create_klaviyo_private_api_key.png" />
    </Frame>
  </Step>
</Steps>

<Warning>
  A Private API Key can read or change data according to its assigned permissions. Do not share it in emails, messages, public screenshots, or customer-facing documents.
</Warning>

## Connect Klaviyo to ChatbotX

<Steps>
  <Step title="Open Settings">
    In your ChatbotX workspace, select **Settings** from the left menu.
  </Step>

  <Step title="Select Integrations">
    Select the **Integrations** tab, then open **Klaviyo**.
  </Step>

  <Step title="Open the connection window">
    Select **Connect** to open the **Connect Klaviyo** window.
  </Step>

  <Step title="Enter the API Key">
    Paste the Private API Key into the **API Key** field, then select **Confirm**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/f4ikNOBcEIN2hXqg/images/connect_klaviyo_in_chatbotx_integrations.png?fit=max&auto=format&n=f4ikNOBcEIN2hXqg&q=85&s=39fa7bab7191bc8578e2e65909ccdcdf" alt="Connect Klaviyo in ChatbotX Integrations" width="3185" height="1557" data-path="images/connect_klaviyo_in_chatbotx_integrations.png" />
    </Frame>
  </Step>
</Steps>

After the key is verified and has the required permissions, ChatbotX saves the connection and loads Klaviyo Lists for use in Flows.

## Add Klaviyo to a Flow

Place the Klaviyo action after collecting the email address and other data that you want to sync. The email address must be valid so Klaviyo can create or identify the Profile.

<Steps>
  <Step title="Open the Flow">
    Select **Flows**, then open the Flow that you want to use to collect contacts.
  </Step>

  <Step title="Add Actions">
    In the Send Message node, select **+ Create**, then select **Actions**.
  </Step>

  <Step title="Select Email Actions">
    Open **Email Actions** and select **Add Contact to Klaviyo**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/f4ikNOBcEIN2hXqg/images/select_add_contact_to_klaviyo_action.png?fit=max&auto=format&n=f4ikNOBcEIN2hXqg&q=85&s=b917643bc88b282a20202a3ae53618ef" alt="Select Add Contact to Klaviyo Action" width="3185" height="1880" data-path="images/select_add_contact_to_klaviyo_action.png" />
    </Frame>
  </Step>

  <Step title="Open the configuration">
    Select **Edit** on the action to choose a List and sync Profile data.
  </Step>
</Steps>

## Configure Add Contact to Klaviyo

Configure the fields in the **Add Contact to Klaviyo** window, then select **Save**.

| Field                        | Configuration                                                                                                                                                                  |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Klaviyo List**             | Select the List that receives the Profile. If you leave this field empty, the action still creates or updates the Profile without adding it to a List. This field is optional. |
| **Email Field**              | Select the ChatbotX field that stores the customer's email address. Klaviyo uses the email address to create a new Profile or identify an existing Profile.                    |
| **Title Field**              | Select the field that stores the customer's job title or role. This field is optional.                                                                                         |
| **Organization Field**       | Select the field that stores the customer's company or organization. This field is optional.                                                                                   |
| **Custom Fields in Klaviyo** | Select a contact field on the left and enter the Klaviyo property key on the right. Select **Add mapping** to add another sync row.                                            |

<Frame>
  <img src="https://mintcdn.com/chatbotx/f4ikNOBcEIN2hXqg/images/configure_add_contact_to_klaviyo.png?fit=max&auto=format&n=f4ikNOBcEIN2hXqg&q=85&s=b61dac58c9d968d1492ea9219b35b147" alt="Configure Add Contact to Klaviyo" width="3183" height="1885" data-path="images/configure_add_contact_to_klaviyo.png" />
</Frame>

The action provides two outcomes that you can connect to the next nodes in the Flow:

* **Success**: Klaviyo processed the request to create or update the Profile and add it to a List if you selected one.
* **Error**: The request failed because the email address, API Key, permissions, List, or synced data is invalid.

Connect each outcome to a different node to send a confirmation or handle the error.

<Warning>
  **Add Contact to Klaviyo** does not subscribe the Profile to email marketing or change its consent status. Add a Profile to a List only after the customer agrees to receive the relevant content.
</Warning>

## Sync Custom Properties

Custom Properties store data specific to each Profile for segmentation, Template personalization, or Flow conditions in Klaviyo.

Each sync row has two parts:

* Left: the ChatbotX contact field that contains the data to send.
* Right: the property key that Klaviyo uses to store the data on the Profile.

Use short, recognizable, and consistent property keys. If you change the spelling of a property key, Klaviyo might save the value to a new property instead of updating the existing one.

## Example: Collect customers who need product advice

A fashion retailer wants to save customers who are interested in its products and segment them by their needs.

<Steps>
  <Step title="Collect customer information">
    Use Get User Data to ask for the customer's email address, job title, company, and product interest.
  </Step>

  <Step title="Add the Profile to Klaviyo">
    Run **Add Contact to Klaviyo**, then select the **Email** field and a relevant List if the customer has agreed to receive messages.
  </Step>

  <Step title="Sync additional data">
    Select the **Title Field** and **Organization Field**, then sync the product interest to a Custom Property.
  </Step>

  <Step title="Handle the result">
    Connect **Success** to a confirmation message. Connect **Error** to a branch that asks the customer to check their information or transfers the conversation to a team member.
  </Step>
</Steps>

## Test the integration

Before you Publish the Flow, test it with an email address that you can access.

* Open **Audience > Profiles** in Klaviyo and confirm that the Profile appears.
* Confirm that the email address, Title, Organization, and Custom Properties contain the correct data.
* If you selected a List, confirm that the Profile appears in the correct List.
* Confirm that the Flow follows the **Success** branch for a valid email address.
* Enter an invalid email address to test the **Error** branch.
* If Lists do not appear, review the Private API Key's Profiles and Lists permissions and reconnect the integration.

<Warning>
  Deleting or revoking the Private API Key stops the current connection from working. Create a new key and update the connection in ChatbotX before running the Flow again.
</Warning>
