/klaviyo-pack:klaviyo-enterprise-rbacfrom klaviyo-pack
Configures Klaviyo enterprise access control with scoped API keys and OAuth for least-privilege per-service roles and permission layers.
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.
Enterprise access control for Klaviyo: API key scoping with granular read/write permissions, OAuth app authorization flows, and application-level RBAC built on top of Klaviyo's scope system. Klaviyo has no built-in roles, so you compose least-privilege access from scoped keys plus an application permission layer.
Klaviyo uses scoped API keys and OAuth for access control. There are no built-in "roles" in Klaviyo's API -- you implement RBAC by creating multiple API keys with different scopes.
| Scope | Read | Write | What It Controls |
|---|---|---|---|
accounts | Account info | N/A | Organization name, timezone |
campaigns | List campaigns | Create/send campaigns | Email, SMS, push campaigns |
catalogs | Browse items | CRUD catalog items | Product catalog management |
coupons | List coupons | Create coupons | Coupon/discount codes |
data-privacy | N/A | Delete profiles | GDPR/CCPA deletion requests |
events | Query events | Track events | Server-side event tracking |
flows | List flows | Create/update flows | Flow automation |
images | List images | Upload images | Email template images |
lists | List lists | CRUD lists/members | List management |
metrics | Query metrics | N/A | Metric aggregations |
profiles | Read profiles | Create/update profiles | Profile management |
segments | Read segments | N/A | Segment queries |
tags | Read tags | CRUD tags | Resource tagging |
templates | Read templates | Create/update templates | Email templates |
webhooks | List webhooks | CRUD webhooks | Webhook subscriptions |
The full, copy-ready code for every step lives in the implementation walkthrough. At a high level the workflow is five steps:
profiles:* + lists:*; a reporting dashboard
gets *:read only; the admin key gets everything and is used sparingly.The essential skeleton — a least-privilege key plus the permission check — looks like this:
// One scoped key per service — reporting is read-only
const reportingSession = new ApiKeySession(process.env.KLAVIYO_KEY_REPORTING!);
// App-level guard: refuse before the handler runs
app.post('/api/klaviyo/campaigns/send',
requireKlaviyoPermission('canSendCampaigns'),
campaignSendHandler
);
See the implementation walkthrough for the role
permission matrix, getSessionForRole, the middleware, the OAuth exchange, the
audit logger, and the full environment variable layout in
the implementation walkthrough.
Applying this skill produces:
src/klaviyo/rbac.ts) exporting checkPermission and
getSessionForRole, mapping the five app roles to permissions and keys.src/middleware/klaviyo-auth.ts) that returns 401
when no role is assigned and 403 when a role lacks the requested permission.src/klaviyo/audit.ts) that records access and alerts on
destructive actions.A blocked request returns a structured 403, e.g.:
{ "error": "Forbidden", "message": "Role 'marketer' does not have permission: canDeleteProfiles" }
Grounded, end-to-end scenarios — least-privilege keys, route gating by permission, resolving a session from a role, OAuth scope minimization, and alerting on a destructive action — are collected in the examples reference.
Quick illustration — a marketer is allowed to send campaigns but blocked from deleting profiles, purely from the role permission set:
// canSendCampaigns: true -> allowed
app.post('/api/klaviyo/campaigns/send', requireKlaviyoPermission('canSendCampaigns'), campaignSendHandler);
// canDeleteProfiles: false -> 403 Forbidden
app.delete('/api/klaviyo/profiles/:id', requireKlaviyoPermission('canDeleteProfiles'), profileDeleteHandler);
| Error | Status | Cause | Solution |
|---|---|---|---|
permission_denied | 403 | API key missing required scope | Create new key with correct scopes |
| OAuth code expired | 400 | User took too long to authorize | Retry authorization flow |
| Token refresh failed | 401 | Refresh token revoked | Re-authorize the app |
| Role not assigned | 401 | User missing klaviyoRole | Assign role in your user management |
klaviyo-migration-deep-dive skill.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
klaviyo, access-control, rbac, oauth, scoped-keys, enterprise
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-common-errorsDiagnose and fix common Klaviyo API errors and exceptions.
Use when encountering Klaviyo 4xx/5xx errors, debugging failed requests,
or troubleshooting SDK integration issues.
Trigger with phrases like "klaviyo error", "fix klaviyo",
"klaviyo not working", "debug klaviyo", "klaviyo 400", "klaviyo 429".
/klaviyo-Other plugins' skills for the same job