/klaviyo-pack:klaviyo-common-errorsfrom klaviyo-pack
Diagnoses and fixes common Klaviyo API errors (4xx/5xx) with real payloads, root causes, and remedies. Use when encountering Klaviyo API failures or SDK integration issues.
Ships in klaviyo-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Quick reference for the most common Klaviyo API errors with real error payloads,
root causes, and solutions. Because Klaviyo returns JSON:API errors (a status
code plus a structured errors[] array), this skill walks you from a raw
exception to a targeted fix: extract the status code, match it against the
catalog, apply the documented remedy.
The full per-status-code catalog and the SDK-level failure table live in
references/ to keep this workflow scannable — drill in once you know which
status code you are chasing.
klaviyo-api SDK installed (npm install klaviyo-api — note: not @klaviyo/sdk)pk_*) exported as KLAVIYO_PRIVATE_KEYRead the stack trace and Grep for the status code and error codeExtract the status code and error detail from the caught exception. Read the
log line or wrap the call so the structured payload is visible:
try {
await profilesApi.createProfile(payload);
} catch (error: any) {
console.error('Status:', error.status);
console.error('Errors:', JSON.stringify(error.body?.errors, null, 2));
// error.body.errors[] has: { id, code, title, detail, source }
}
If you only have raw logs, Grep for the status code (grep -E "40[0-9]|429|50[0-9]")
and the code field to isolate the failing request.
Map the status code to its root cause and remedy. Each row links into the full catalog, which carries the actual response payload and the fix code block:
| Status | Meaning | Most common root cause |
|---|---|---|
| 400 | Bad Request | Missing field, non-E.164 phone, or snake_case instead of camelCase |
| 401 | Unauthorized | Missing KLAVIYO_PRIVATE_KEY, or a public key used as a private key |
| 403 | Forbidden | API key lacks the required scope (e.g. profiles:write) |
| 404 | Not Found | Wrong resource ID or a dead /api/v2/ path |
| 409 | Conflict | Duplicate — use createOrUpdateProfile upsert |
| 429 | Rate Limited | Exceeded burst (75/s) or steady (700/min); honor Retry-After |
| 500/503 | Server Error | Klaviyo-side — check status page, retry with backoff |
The most common one, 400, is almost always a casing mismatch (the SDK expects
camelCase):
// Wrong: snake_case // Right: camelCase (SDK convention)
{ first_name: 'Jane' } { firstName: 'Jane' }
See the full error catalog for every status
code's real payload, complete cause list, and fix. For client-side failures that
never reach the network (wrong import, response.data vs response.body.data,
bad filter syntax) plus copy-paste diagnostic commands, see
diagnostics & SDK errors.
Working through this skill produces a diagnosis and a fix, not a generated artifact:
code identifying the failure classecho $KLAVIYO_PRIVATE_KEY | head -c 3 (must print pk_).RateLimit-Remaining header — expected. On a 429 Klaviyo returns
only Retry-After; do not depend on the reset headers, honor Retry-After.klaviyo-debug-bundle,
check status.klaviyo.com, then open a support
ticket with the request IDs from the error responses.Example — 403 permission_denied on profile create. The exception shows
status: 403, detail: "...required scope: profiles:write". Match to the 403 row:
the key lacks a scope. Fix: mint a new key with profiles:write at
Settings > API Keys. Full payload and the endpoint→scope table are in
the error catalog under the 403 section.
Example — intermittent 429 under load. Requests fail once traffic exceeds
700/min. Honor the Retry-After header and back off instead of tight-retrying:
if (error.status === 429) {
const retryAfter = parseInt(error.headers?.['retry-after'] || '10'); // seconds
await new Promise(r => setTimeout(r, retryAfter * 1000));
// then retry
}
More worked cases (400 casing, 404 stale ID, 409 upsert) are in the error catalog.
klaviyo-debug-bundle skillWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin klaviyo-pack24 skills in this plugin
/klaviyo-ci-integrationConfigure CI/CD pipelines for Klaviyo integrations with GitHub Actions.
Use when setting up automated testing, configuring CI secrets,
or integrating Klaviyo SDK tests into your build pipeline.
Trigger with phrases like "klaviyo CI", "klaviyo GitHub Actions",
"klaviyo automated tests", "CI klaviyo", "klaviyo pipeline".
/klaviyo-core-workflow-aExecute Klaviyo primary workflow: profiles, lists, and subscriptions.
Use when creating/updating profiles, managing lists, subscribing contacts,
or syncing customer data to Klaviyo for email/SMS marketing.
Trigger with phrases like "klaviyo profiles", "klaviyo lists",
"klaviyo subscribe", "add contacts to klaviyo", "klaviyo customer data".
/klaviyo-core-workflow-bExecute the Klaviyo secondary workflow: event tracking, segments, and campaigns.
Use when you need to track customer events, query or size segments, build and send
email campaigns, or inspect metric-triggered flows through the Klaviyo API.
Trigger with phrases like "klaviyo events", "klaviyo segments", "klaviyo campaigns",
"track klaviyo event", "klaviyo flow trigger".
/klaviyo-cost-tuningOptimize Klaviyo costs through plan selection, contact management, and usage monitoring.
Use when analyzing Klaviyo billing, reducing active profile costs,
or implementing usage monitoring and budget alerts.
Trigger with phrases like "klaviyo cost", "klaviyo billing",
"reduce klaviyo costs", "klaviyo pricing", "klaviyo expensive", "klaviyo budget".
/klaviyo-data-handlingImplement Klaviyo data privacy, GDPR/CCPA compliance, and PII handling patterns.
Use when handling profile data, implementing right-to-deletion, configuring
data retention, or ensuring compliance with privacy regulations.
Trigger with phrases like "klaviyo data", "klaviyo PII",
"klaviyo GDPR", "klaviyo data retention", "klaviyo privacy", "klaviyo CCPA",
"klaviyo delete profile", "klaviyo data privacy".
/klaviyo-debug-bundleCollect Klaviyo debug evidence for support tickets and troubleshooting.
Use when a Klaviyo integration is failing, when preparing a support ticket,
or when collecting diagnostic information for a Klaviyo API problem.
Trigger with phrases like "klaviyo debug", "klaviyo support bundle",
"collect klaviyo logs", "klaviyo diagnostic", "klaviyo troubleshoot".
Other plugins' skills for the same job