ByteChef LogoByteChef

Klaviyo

Klaviyo is a marketing automation platform primarily used for email and SMS marketing, especially by e-commerce businesses.

Categories: Marketing Automation

Type: klaviyo/v1


Connections

Version: 1

API Key

Properties

NameLabelTypeDescriptionRequired
keyKeySTRINGtrue

Connection Setup

  1. Login to the dashboard at https://www.klaviyo.com/login?next=/account.
  2. Click on your account.
  3. Click on Settings.
  4. Click on API keys.
  5. Under the Private API Keys section, select Create Private API Key.
  6. Name your API key and select Full Access Key.
  7. Click Create.
  8. Copy the API key. Use these credentials to create a connection in ByteChef.

Actions

Get Lists

Name: getLists

Get all lists in an account.

Properties

NameLabelTypeDescriptionRequired
listFieldsList FieldsARRAY
Items [STRING]
List of fields to include for each related list object.true

Example JSON Structure

{
  "label" : "Get Lists",
  "name" : "getLists",
  "parameters" : {
    "listFields" : [ "" ]
  },
  "type" : "klaviyo/v1/getLists"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataARRAY
Items [{STRING(type), STRING(id), {STRING(name), STRING(created), STRING(updated), STRING(opt_in_process)}(attributes), {STRING(self)}(links), {{{STRING(self), STRING(related)}(links)}(profiles), {[{STRING(type), STRING(id)}](data), {STRING(self), STRING(related)}(links)}(tags), {[{STRING(type), STRING(id)}](data), {STRING(self), STRING(related)}(links)}(flow-triggers)}(relationships)}]
linksOBJECT
Properties {STRING(self), STRING(first), STRING(last), STRING(prev), STRING(next)}

Output Example

{
  "data" : [ {
    "type" : "",
    "id" : "",
    "attributes" : {
      "name" : "",
      "created" : "",
      "updated" : "",
      "opt_in_process" : ""
    },
    "links" : {
      "self" : ""
    },
    "relationships" : {
      "profiles" : {
        "links" : {
          "self" : "",
          "related" : ""
        }
      },
      "tags" : {
        "data" : [ {
          "type" : "",
          "id" : ""
        } ],
        "links" : {
          "self" : "",
          "related" : ""
        }
      },
      "flow-triggers" : {
        "data" : [ {
          "type" : "",
          "id" : ""
        } ],
        "links" : {
          "self" : "",
          "related" : ""
        }
      }
    }
  } ],
  "links" : {
    "self" : "",
    "first" : "",
    "last" : "",
    "prev" : "",
    "next" : ""
  }
}

Subscribe Profiles

Name: subscribeProfiles

Subscribe one or more profiles to email marketing, SMS marketing or both.

Properties

NameLabelTypeDescriptionRequired
profileIdProfile IDARRAY
Items [STRING]
The IDs of the profile to subscribe.true
subscriptionSubscriptionARRAY
Items [STRING]
The subscription parameters to subscribe to on the email or sms channel.true

Example JSON Structure

{
  "label" : "Subscribe Profiles",
  "name" : "subscribeProfiles",
  "parameters" : {
    "profileId" : [ "" ],
    "subscription" : [ "" ]
  },
  "type" : "klaviyo/v1/subscribeProfiles"
}

Output

This action does not produce any output.

Find Profile ID

To find the Profile ID, click here.

Update Profile

Name: updateProfile

Update the profile with the given profile ID.

Properties

NameLabelTypeDescriptionRequired
profileIdProfile IDSTRINGPrimary key that uniquely identifies this profile.true
emailEmailSTRINGIndividual's email address.false
phone_numberPhone NumberSTRINGIndividual's phone number in E.164 format.false
first_nameFirst NameSTRINGIndividual's first name.false
last_nameLast NameSTRINGIndividual's last name.false
organizationOrganizationSTRINGName of the company or organization within the company for whom the individual works.false
localeLocaleSTRINGThe locale of the profile, in the IETF BCP 47 language tag format like (ISO 639-1/2)-(ISO 3166 alpha-2).false
titleTitleSTRINGIndividual's job title.false
imageImageSTRINGURL pointing to the location of a profile image.false
address1Address1STRINGFirst line of street address.false
address2Address2STRINGSecond line of street address.false
cityCitySTRINGCity name.false
countryCountrySTRINGCountry name.false
regionRegionSTRINGRegion within a country, such as state or province.false
zipZipSTRINGZip code.false
timezoneTimezoneSTRINGTime zone name. We recommend using time zones from the IANA Time Zone Database..false
ipIPSTRINGIP address.false

Example JSON Structure

{
  "label" : "Update Profile",
  "name" : "updateProfile",
  "parameters" : {
    "profileId" : "",
    "email" : "",
    "phone_number" : "",
    "first_name" : "",
    "last_name" : "",
    "organization" : "",
    "locale" : "",
    "title" : "",
    "image" : "",
    "address1" : "",
    "address2" : "",
    "city" : "",
    "country" : "",
    "region" : "",
    "zip" : "",
    "timezone" : "",
    "ip" : ""
  },
  "type" : "klaviyo/v1/updateProfile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
dataOBJECT
Properties {STRING(type), STRING(id), {STRING(email), STRING(phone_number), STRING(external_id), STRING(anonymous_id), STRING(first_name), STRING(last_name), STRING(organization), STRING(locale), STRING(title), STRING(image), STRING(created), STRING(updated), STRING(last_event_date), {STRING(address1), STRING(address2), STRING(city), STRING(country), {}(latitude), {}(longitude), STRING(region), STRING(zip), STRING(timezone), STRING(ip)}(location), {}(properties), {{{BOOLEAN(can_receive_email_marketing), STRING(consent), DATE_TIME(consent_timestamp), DATE_TIME(last_updated), STRING(method), STRING(method_detail), STRING(custom_method_detail), BOOLEAN(double_optin), [STRING(reason), DATE_TIME\(timestamp)](suppression), [STRING(list_id), STRING\(reason), DATE_TIME($timestamp)](list_suppressions)}(marketing)}(email), {{BOOLEAN(can_receive_sms_marketing), STRING(consent), DATE_TIME(consent_timestamp), STRING(method), STRING(method_detail), DATE_TIME(last_updated)}(marketing), {BOOLEAN(can_receive_sms_transactional), STRING(consent), DATE_TIME(consent_timestamp), STRING(method), STRING(method_detail), DATE_TIME(last_updated)}(transactional)}(sms), {{BOOLEAN(can_receive_push_marketing), STRING(consent), DATE_TIME(consent_timestamp)}(marketing)}(mobile_push)}(subscriptions), {NUMBER(historic_clv), NUMBER(predicted_clv), NUMBER(total_clv), NUMBER(historic_number_of_orders), NUMBER(predicted_number_of_orders), NUMBER(average_days_between_orders), NUMBER(average_order_value), NUMBER(churn_probability), DATE_TIME(expected_date_of_next_order)}(predictive_analytics)}(attributes), {STRING(self)}(links), {{{STRING(type), STRING(id)}(data), {STRING(self), STRING(related)}(links)}(lists), {{STRING(type), STRING(id)}(data), {STRING(self), STRING(related)}(links)}(segments), {{STRING(type), STRING(id)}(data), {STRING(self), STRING(related)}(links)}(push-tokens)}(relationships)}
linksOBJECT
Properties {STRING(self)}
Links.

Output Example

{
  "data" : {
    "type" : "",
    "id" : "",
    "attributes" : {
      "email" : "",
      "phone_number" : "",
      "external_id" : "",
      "anonymous_id" : "",
      "first_name" : "",
      "last_name" : "",
      "organization" : "",
      "locale" : "",
      "title" : "",
      "image" : "",
      "created" : "",
      "updated" : "",
      "last_event_date" : "",
      "location" : {
        "address1" : "",
        "address2" : "",
        "city" : "",
        "country" : "",
        "latitude" : { },
        "longitude" : { },
        "region" : "",
        "zip" : "",
        "timezone" : "",
        "ip" : ""
      },
      "properties" : { },
      "subscriptions" : {
        "email" : {
          "marketing" : {
            "can_receive_email_marketing" : false,
            "consent" : "",
            "consent_timestamp" : "2021-01-01T00:00:00",
            "last_updated" : "2021-01-01T00:00:00",
            "method" : "",
            "method_detail" : "",
            "custom_method_detail" : "",
            "double_optin" : false,
            "suppression" : [ "", "2021-01-01T00:00:00" ],
            "list_suppressions" : [ "", "", "2021-01-01T00:00:00" ]
          }
        },
        "sms" : {
          "marketing" : {
            "can_receive_sms_marketing" : false,
            "consent" : "",
            "consent_timestamp" : "2021-01-01T00:00:00",
            "method" : "",
            "method_detail" : "",
            "last_updated" : "2021-01-01T00:00:00"
          },
          "transactional" : {
            "can_receive_sms_transactional" : false,
            "consent" : "",
            "consent_timestamp" : "2021-01-01T00:00:00",
            "method" : "",
            "method_detail" : "",
            "last_updated" : "2021-01-01T00:00:00"
          }
        },
        "mobile_push" : {
          "marketing" : {
            "can_receive_push_marketing" : false,
            "consent" : "",
            "consent_timestamp" : "2021-01-01T00:00:00"
          }
        }
      },
      "predictive_analytics" : {
        "historic_clv" : 0.0,
        "predicted_clv" : 0.0,
        "total_clv" : 0.0,
        "historic_number_of_orders" : 0.0,
        "predicted_number_of_orders" : 0.0,
        "average_days_between_orders" : 0.0,
        "average_order_value" : 0.0,
        "churn_probability" : 0.0,
        "expected_date_of_next_order" : "2021-01-01T00:00:00"
      }
    },
    "links" : {
      "self" : ""
    },
    "relationships" : {
      "lists" : {
        "data" : {
          "type" : "",
          "id" : ""
        },
        "links" : {
          "self" : "",
          "related" : ""
        }
      },
      "segments" : {
        "data" : {
          "type" : "",
          "id" : ""
        },
        "links" : {
          "self" : "",
          "related" : ""
        }
      },
      "push-tokens" : {
        "data" : {
          "type" : "",
          "id" : ""
        },
        "links" : {
          "self" : "",
          "related" : ""
        }
      }
    }
  },
  "links" : {
    "self" : ""
  }
}

Find Profile ID

To find the Profile ID, click here.

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.


Additional Instructions

How to find Profile ID

  • Method 1: Via API

Use the GET /api/profiles endpoint to retrieve a list of all profiles and their IDs.

  • Method 2: Via UI

Go to the Klaviyo dashboard. On the left bar, go to Audience and then Profiles. Open the profile that you want to use and you can find Unique ID under Information/Profile details. You can also find the same ID in the URL when you open the profile. For example in https://www.klaviyo.com/profile/123, profile ID is 123.

The Profile ID can also be found in the output of the following actions:

  • Update Profile

How is this guide?

Last updated on

On this page