Klaviyo Core Workflow A -- Profiles, Lists & Subscriptions

SkillDev tools

'Execute Klaviyo primary workflow: profiles, lists, and subscriptions.

Use Klaviyo Core Workflow A -- Profiles, Lists & Subscriptions in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add Klaviyo Core Workflow A -- Profiles, Lists & Subscriptions and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the Klaviyo Core Workflow A -- Profiles, Lists & Subscriptions skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Klaviyo Core Workflow A -- Profiles, Lists & SubscriptionsStart free

What this skill tells your AI

The instructions your AI receives, as published by jeremylongshore/tons-of-skills-marketplace in skills/.curated/klaviyo-core-workflow-a/SKILL.md and read by Ahel’s review.

Overview

Primary money-path workflow: create/update profiles, manage lists, and subscribe contacts for email and SMS marketing via the klaviyo-api SDK. This skill covers the six-step path from a raw customer record to a consented, segmentable subscriber. High-level flow lives here; the full code for every step is in references/implementation.md.

Prerequisites

  • Completed the klaviyo-install-auth setup so KLAVIYO_PRIVATE_KEY is available in the environment.
  • A Klaviyo private API key scoped to profiles:read, profiles:write, lists:read, and lists:write.
  • The klaviyo-api npm package installed in the project (npm install klaviyo-api).
  • Node.js with TypeScript configured, since all examples use the typed SDK.

Instructions

Every call authenticates through a single ApiKeySession built from the private key:

import { ApiKeySession, ProfilesApi, ListsApi } from 'klaviyo-api';

const session = new ApiKeySession(process.env.KLAVIYO_PRIVATE_KEY!);
const profilesApi = new ProfilesApi(session);
const listsApi = new ListsApi(session);

The workflow runs in six steps. Use the linked walkthrough for the complete code of each:

  1. Create or update a profile — prefer createOrUpdateProfile (upsert) over createProfile so re-syncs don't 409 on an existing email.
  2. Create a list — listsApi.createList(...) returns the listId you use downstream; getLists() enumerates existing lists.
  3. Add profiles to a list — createListRelationships adds membership only; it does NOT grant marketing consent.
  4. Subscribe profiles — subscribeProfiles records email/SMS marketing consent with a consentTimestamp. This is the correct way to create real subscribers.
  5. Query profiles with filters — getProfiles({ filter, sort }) supports equals, greater-than, and contains for segmentation.
  6. Bulk import — batch upserts in groups of 100 to stay within rate limits.

Full code for all six steps: references/implementation.md.

Output

  • Profiles created/updated in Klaviyo
  • Lists created and populated
  • Subscribers opted in with consent timestamps
  • Queryable customer data for segmentation

Error Handling

ErrorStatusCauseSolution
Duplicate profile409Email existsUse createOrUpdateProfile (upsert)
Invalid phone400Wrong formatUse E.164 format: +15551234567
List not found404Wrong list IDVerify list ID via getLists()
Missing consent400No consent timestampAlways include consentTimestamp
Rate limited429>75 req/s burstSee klaviyo-rate-limits

Examples

Three end-to-end scenarios that string the six steps into complete flows are in references/examples.md:

  • Sync a new signup into a newsletter list with consent — upsert the profile, ensure the list exists, then subscribe with email + SMS consent in one pass.
  • Segment pro-plan customers — filter by a custom property and export the audience emails for a targeted campaign.
  • Bulk-import a customer CSV — map records to upsert payloads and process in batches of 100.

Minimal upsert-then-subscribe skeleton:

const upserted = await profilesApi.createOrUpdateProfile({
  data: { type: ProfileEnum.Profile, attributes: { email: 'customer@example.com' } },
});
await profilesApi.subscribeProfiles({
  data: {
    type: 'profile-subscription-bulk-create-job',
    attributes: { profiles: { data: [{ type: ProfileEnum.Profile, attributes: {
      email: 'customer@example.com',
      subscriptions: { email: { marketing: { consent: 'SUBSCRIBED', consentTimestamp: new Date().toISOString() } } },
    } }] } },
    relationships: { list: { data: { type: ListEnum.List, id: listId } } },
  },
});

Resources

Next Steps

For event tracking and campaign triggers, see klaviyo-core-workflow-b. To harden against burst limits during bulk imports, see klaviyo-rate-limits.

Signals

GitHub stars
3k
Forks
415
Last commit
Oct 2026

Ahel review

  • K1binfo
    installs-packages

Automated review, not a security audit. Ruleset v1+k2.

Advanced
Item type
skill
Key
klaviyo-core-workflow-a
Source
github.com/jeremylongshore/tons-of-skills-marketplace