Klaviyo
Sync e-commerce customer profiles and trigger email/SMS flows via the Klaviyo API.
- Base URL:
https://a.klaviyo.com/api - Auth:
Authorization: Klaviyo-API-Key <private-api-key>(no OAuth, single key) - Revision header: every request sends a
revisionheader (a date-stamped API version, e.g.2024-10-15). The tool sends a stable default; override it with therevisioninput.
What it does
Klaviyo flows (automations) are triggered by events: when you post an event
(a metric like Placed Order) for a profile, any flow whose trigger is that
metric fires and delivers its configured email/SMS. This tool lets InTouch jobs
upsert profiles, fire those triggering events, and inspect campaigns — all with
the credential held in InTouch, never in the AI context.
Operations
| operation | method / endpoint | purpose |
|---|---|---|
get-profiles |
GET /api/profiles/ |
List profiles; optional email filter / pageSize |
upsert-profile |
POST /api/profile-import/ |
Create or update a profile (matched on email/phone) |
create-event |
POST /api/events/ |
Fire an event/metric for a profile → triggers matching flows |
get-campaigns |
GET /api/campaigns/ |
List campaigns (filtered by channel, default email) |
Inputs
apiKey(required) — Klaviyo private API key.operation(required) — one of the four above.revision— optional API revision date (header).email,phoneNumber— profile identifiers.firstName,lastName— profile name (upsert).metric— event name (create-event), e.g.Placed Order.value— optional numeric event value (e.g. order total).properties— optional JSON object of custom properties.channel—emailorsms(get-campaigns).pageSize— optional page size (get-profiles).
Output
Publishes result (the Klaviyo JSON response body as a string) and status
(the HTTP status code). create-event returns 202 Accepted with an empty
body on success; the tool emits {"accepted": true, "metric": "..."}.
API key setup
- In Klaviyo, go to Settings → API keys.
- Click Create Private API Key, name it (e.g.
intouch), and grant the scopes you need (Profiles, Events, Campaigns). - Copy the key (starts with
pk_…) and pass it as theapiKeyinput.
Examples
Upsert a profile:
{
"apiKey": "pk_xxx",
"operation": "upsert-profile",
"email": "[email protected]",
"firstName": "Jane",
"properties": "{\"plan\":\"pro\"}"
}
Trigger a flow by firing an event:
{
"apiKey": "pk_xxx",
"operation": "create-event",
"email": "[email protected]",
"metric": "Placed Order",
"value": "129.00",
"properties": "{\"order_id\":\"A-1001\"}"
}
List email campaigns:
{ "apiKey": "pk_xxx", "operation": "get-campaigns", "channel": "email" }
Look up a profile by email:
{ "apiKey": "pk_xxx", "operation": "get-profiles", "email": "[email protected]" }
Publishes
The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.
errorresultstatus
Input Properties
Every property this tool accepts, from its own tool.iml.
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey |
string | yes | — | DEPRECATED — bind an API Key credential to the task with credentialName instead. A key pasted here is stored in the workflow definition in clear and appears in every export of it. Still honoured for workflows built before the change. |
operation |
string | yes | — | One of: get-profiles, upsert-profile, create-event, get-campaigns |
revision |
string | no | — | Optional Klaviyo API revision date sent in the required 'revision' header (e.g. 2024-10-15). Defaults to a stable revision when blank. |
email |
string | no | — | Profile email. Required (or phoneNumber) for upsert-profile and create-event; optional filter for get-profiles. |
phoneNumber |
string | no | — | Profile phone number in E.164 (e.g. +15551234567). Used for upsert-profile and create-event when no email. |
firstName |
string | no | — | upsert-profile: profile first name. |
lastName |
string | no | — | upsert-profile: profile last name. |
metric |
string | no | — | create-event: the metric/event name to fire (e.g. 'Placed Order'). Flows triggered by this metric will run. |
value |
string | no | — | create-event: optional numeric monetary value for the event (e.g. order total). |
properties |
string | no | — | upsert-profile / create-event: optional JSON object of custom properties, e.g. {"plan":"pro"}. |
channel |
string | no | — | get-campaigns: channel to filter on, 'email' or 'sms'. Defaults to email (Klaviyo requires a channel filter). |
pageSize |
string | no | — | get-profiles: optional page size (cursor pagination). |