In this article you’ll learn how to transfer leads to Klaviyo using API node.

Step 1: Add a custom field {id}

The custom field id is required for the next steps that we will be doing inside the API node. You can check this KB article for more information on How to Create and Add Custom Fields.

Step 2: Get List ID and API Key from your Klaviyo account

You can check these articles from https://help.klaviyo.com/ on how to obtain these information:

In case you have trouble finding your List ID or API Key, please contact Klaviyo Support

Step 3: Add an API node to your Decision Tree

You will find the API node on the list of nodes when you click Add New Module. For more information about using API nodes you can refer to this KB article on How to Use the API Node.

Please refer to the image and instructions below on how to setup the API node.

  • Method: POST
  • Request URL: https://a.klaviyo.com/api/v2/list/list_id/members
  • Body: JSON
  • JSON content:
{
  "api_key": "****enter your API key******",
  "profiles": [
    {
      **below is sample profile data showing key:value pairs**
      ** email or phone_number is required **
      "email": "{email}",
      "first_name": "{first_name}",
      "last_name": "{last_name}",
      "organization": "{organization}",
      "title": "{job}",
      "city": "{_geoip_city}",
      "region": "{_geoip_regionName}",
      "zip": "{zip}",
      "country": "{_geoip_countryName}",
      "phone_number": "{mobile|raw}"
    }
  ]
}
  • Headers: Accept: application/json, ContentType: application/json


Input the data you want to send to Klaviyo in the JSON code. Each object in the profiles array must have an email or phone_number. You can also provide additional properties as key-value pairs.

Step 4: Map Response Property to Custom Field {id}

Scroll down to the bottom of the API node to see Fieldmapper section.
Enter response property “id” and enter field name “id”.
This is the custom field we created on Step 1 of this article.

Step 5: Test and Save API node

You can use the Test Request button to test the API request. Save your API node and proceed to the Results node (or whichever is the next node) on your DT.

For more information about using API nodes you can refer to this KB article on How to Use the API Node.

You can also refer to Klaviyo API documentation regarding Adding Members to a List for more information.

Leave a Reply

Your email address will not be published. Required fields are marked *