pixellint

vendor/klaviyo · vendor documented

Klaviyo events are JSON:API, not a flat track call

data.type has to be event. The metric name lives at data.attributes.metric.data.attributes.name. Copying a Segment or Mixpanel body here fails the resource type before anything else runs.

A profile identifier is required: id, email, phone number, or external id. An event with a metric and no person is not attributable.

What this pack matches

Hosts
klaviyo.com
Paths
…/api/events…
Vendor docs
developers.klaviyo.com/en/reference/create_event

Rules

Codes are stable. A finding in CI, MCP, or the playground lands on the same id.

Field Required What it checks Rule ids Source
data.type required JSON:API resource type, which Klaviyo documents as `event` for this endpoint. Fix: Set `data.type` to `event`. vendor.klaviyo.body.data.type.missing
vendor.klaviyo.body.data.type.empty
vendor.klaviyo.body.data.type.invalid
docs
data.attributes.metric.data.type optional The nested metric resource is typed `metric`. Fix: Set the metric's `type` to `metric`. vendor.klaviyo.body.data.attributes.metric.data.type.empty
vendor.klaviyo.body.data.attributes.metric.data.type.invalid
docs
data.attributes.metric.data.attributes.name required It is the name of the metric the event is recorded against. Fix: Name the metric, such as `Placed Order`. vendor.klaviyo.body.data.attributes.metric.data.attributes.name.missing
vendor.klaviyo.body.data.attributes.metric.data.attributes.name.empty
docs
data.attributes.profile.data.attributes.email optional One of email, phone number, external id, or id identifies the profile. vendor.klaviyo.body.data.attributes.profile.data.attributes.email.empty docs
data.attributes.profile.data.attributes.phone_number optional One of email, phone number, external id, or id identifies the profile. vendor.klaviyo.body.data.attributes.profile.data.attributes.phone_number.empty docs
data.attributes.profile.data.attributes.external_id optional One of email, phone number, external id, or id identifies the profile. vendor.klaviyo.body.data.attributes.profile.data.attributes.external_id.empty docs
data.attributes.profile.data.id optional One of email, phone number, external id, or id identifies the profile. vendor.klaviyo.body.data.attributes.profile.data.id.empty docs
data.attributes.unique_id optional Klaviyo deduplicates on it, so a retried request is not counted twice. vendor.klaviyo.body.data.attributes.unique_id.empty docs
body.profile_needs_an_identifier required The event carries no profile identifier. Klaviyo documents at least one of id, email, phone number, or external id as required. Fix: Add an identifier under `data.attributes.profile.data`. vendor.klaviyo.body.profile_needs_an_identifier docs

Validate a payload

pixellint validate json @payload.json --rulepack vendor/klaviyo

Or paste it into the playground. Same engine, in the browser, nothing sent anywhere.

cargo install pixellint · npm install pixellint