Klaviyo

Create profiles, manage lists, and track events in Klaviyo.

MarketingAPI key11 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (11)
  4. createProfile
  5. addProfileToList
  6. createList
  7. custom_api_call
  8. findListByName
  9. findProfileByEmailPhone
  10. findTagByName
  11. removeProfileFromList
  12. subscribeProfile
  13. unsubscribeProfile
  14. updateProfile
  15. Details

Connect

Auth type: API key (secret_text). Pass the provider's API key or token as the connection's credential. It is sealed at rest and only opened on the server when an action runs.

  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("klaviyo", action, input) resolves with the provider's answer and rejects when Klaviyo isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "klaviyo"} says whether yours can call it.

Workflow
// workflows/notify.ts: call Klaviyo when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellKlaviyo = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Klaviyo isn't connected.
  const output = await step.run("Klaviyo", () =>
    step.ctx.integrations.invoke("klaviyo", "createProfile", {}),
  );
  step.ctx.log("Klaviyo answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "klaviyo",
    "piece_action": "createProfile",
    "input": {},
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/klaviyo/createProfile" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{}}'

Actions

createProfile

Create Profile. Add new user profile with email/SMS subscription options

InputTypeDescription
emailoptionaltextEmail address (recommended identifier)
phone_numberoptionaltextPhone number in E.164 format (e.g., +15005550006)
external_idoptionaltextUnique identifier from external system
first_nameoptionaltextFirst Name
last_nameoptionaltextLast Name
organizationoptionaltextCompany name
localeoptionaltextLanguage tag (e.g., en-US)
titleoptionaltextJob Title
imageoptionaltextProfile image URL
address1optionaltextStreet address line 1
address2optionaltextStreet address line 2
cityoptionaltextCity
countryoptionaltextCountry
regionoptionaltextRegion/State
zipoptionaltextZip Code
timezoneoptionaltextIANA timezone (e.g., America/New_York)
ipoptionaltextIP Address
latitudeoptionalnumberLatitude coordinate (4 decimal places recommended)
longitudeoptionalnumberLongitude coordinate (4 decimal places recommended)
custom_propertiesoptionalobjectKey-value pairs for segmentation and personalization

addProfileToList

Add Profile to List. Add profiles to a specific list without changing subscription status.

InputTypeDescription
list_idrequiredid (picked from your account)List Id
profile_idrequiredids (picked from your account)Select one or more Klaviyo profiles

createList

Create List. Create a new subscriber list.

InputTypeDescription
namerequiredtextName for the new list

custom_api_call

Custom API Call. Make a custom API call to a specific endpoint

InputTypeDescription
urlrequiredobject (depends on other props)url
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
headersrequiredobjectAuthorization headers are injected automatically from your connection.
queryParamsrequiredobjectQuery Parameters
body_typeoptionalone of "none" | "json" | "form_data" | "raw"Body Type
bodyoptionalobject (depends on other props)Body
response_is_binaryoptionalbooleanEnable for files like PDFs, images, etc.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)
followRedirectsoptionalbooleanFollow redirects

findListByName

Find List by Name. Find lists by name with optional additional data

InputTypeDescription
search_queryrequiredlong textEnter list name
include_additional_dataoptionalbooleanInclude related flow and tag information

findProfileByEmailPhone

Find Profile by Email/Phone. Find a profile using email or phone number.

InputTypeDescription
search_queryrequiredtextEnter an email address or phone number (E.164 format recommended)
include_additional_dataoptionalbooleanInclude subscriptions and predictive analytics data

findTagByName

Find Tag by Name. Find tags whose name contains the search query.

InputTypeDescription
search_queryrequiredtextSearch for tags whose name contains this value.

removeProfileFromList

Remove Profile from List. Remove profiles from a specific list.

InputTypeDescription
list_idrequiredid (picked from your account)List Id
profile_idsrequiredids (picked from your account)Select one or more Klaviyo profiles

subscribeProfile

Subscribe Profile. Subscribe profiles to email or SMS marketing on a list.

InputTypeDescription
list_idrequiredid (picked from your account)List Id
profile_idsrequiredids (picked from your account)Select one or more Klaviyo profiles
subscribe_emailoptionalbooleanSubscribe selected profiles to email marketing.
subscribe_smsoptionalbooleanSubscribe selected profiles to SMS marketing.
historical_importoptionalbooleanBypass double opt-in and mark as a historical import.
consented_atoptionaltextISO 8601 datetime when consent was given (required for historical import, e.g. 2024-01-15T10:00:00Z).
custom_sourceoptionaltextLabel for the subscription source (e.g. "Website Form").

unsubscribeProfile

Unsubscribe Profile. Unsubscribe profiles from email or SMS marketing on a list.

InputTypeDescription
list_idrequiredid (picked from your account)List Id
profile_idsrequiredids (picked from your account)Select one or more Klaviyo profiles
unsubscribe_emailoptionalbooleanUnsubscribe selected profiles from email marketing.
unsubscribe_smsoptionalbooleanUnsubscribe selected profiles from SMS marketing.
unsubscribe_sms_transactionaloptionalbooleanUnsubscribe selected profiles from SMS transactional messages.

updateProfile

Update Profile. Update existing profile data and preferences.

InputTypeDescription
profile_idrequiredid (picked from your account)Profile Id
emailoptionaltextIndividual's email address
phone_numberoptionaltextPhone number in E.164 format (e.g., +15005550006)
external_idoptionaltextUnique identifier from external system (e.g., POS system)
anonymous_idoptionaltextAnonymous identifier for the profile
first_nameoptionaltextIndividual's first name
last_nameoptionaltextIndividual's last name
organizationoptionaltextCompany or organization name
localeoptionaltextLocale in IETF BCP 47 format (e.g., en-US)
titleoptionaltextIndividual's job title
imageoptionaltextURL pointing to profile image location
address1optionaltextFirst line of street address
address2optionaltextSecond line of street address
cityoptionaltextCity name
countryoptionaltextEnter 2-letter ISO country code. Popular: US, GB, CA, DE, FR, AU, JP, CN, IN, BR
regionoptionaltextRegion within country (state/province)
zipoptionaltextPostal/zip code
timezoneoptionaltextIANA timezone (e.g., America/New_York)
ipoptionaltextIP address of the profile
latitudeoptionalnumberLatitude coordinate (4 decimal places recommended)

Details

Id
klaviyo
Category
Marketing
Tags
email, ecommerce, sms, marketing-automation
Package
@activepieces/piece-klaviyo@0.0.1
Runs
Through the integration runner