vendor/segment · vendor documented
A Segment track call needs an event name
A server posts to api.segment.io/v1/batch. The response is 200. Downstream destinations never see the event. The HTTP API is a collector, not a schema checker.
The track spec marks event as required. The collector still takes a call that omits it. It does not invent a name. Every call also needs userId or anonymousId.
track requires an event name
identify, page, screen, group, and alias do not. The rule is scoped to type: track. A mixed batch only flags the track rows.
Every call needs a person
userId for a known user, anonymousId for an unidentified one. A track with properties and no identity is associated with nobody.
What this pack matches
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 |
|---|---|---|---|---|
writeKey |
optional | It identifies the source the data lands in. Segment also accepts it as HTTP basic auth, so it is not required in the body. Fix: Send the source write key in the body or as the basic auth username. | vendor.segment.body.writeKey.empty |
docs |
type |
required | Segment documents that each call in a batch must carry a `type` naming a valid method. Fix: Set `type` to one of identify, track, page, screen, group, or alias. | vendor.segment.body.type.missingvendor.segment.body.type.emptyvendor.segment.body.type.invalid |
docs |
event |
optional | It is the name of the action the user performed, and Segment documents it as required on a track call. Fix: Name the event, such as `Item Purchased`. | vendor.segment.body.event.empty |
docs |
body.track_requires_an_event_name |
required | A `track` call carries no `event`. Segment documents the event name as required, and drops the call without it. Fix: Add the event name to the call. | vendor.segment.body.track_requires_an_event_name |
docs |
userId |
optional | It is your own identifier for the user. Segment documents that a call needs either this or `anonymousId`. | vendor.segment.body.userId.empty |
docs |
anonymousId |
optional | It stands in for a user id when there is none. Segment documents that a call needs either this or `userId`. | vendor.segment.body.anonymousId.empty |
docs |
timestamp |
optional | Segment documents the timestamp as an ISO 8601 date string. Leave it out for events happening now. Fix: Send an ISO 8601 timestamp, or omit it and let Segment stamp the call. | vendor.segment.body.timestamp.emptyvendor.segment.body.timestamp.invalid |
docs |
body.call_needs_an_identifier |
required | The call carries neither `userId` nor `anonymousId`. Segment documents one of the two as required on every call. Fix: Send `userId` for a known user, or `anonymousId` for an unidentified one. | vendor.segment.body.call_needs_an_identifier |
docs |
Validate a payload
pixellint validate json @payload.json --rulepack vendor/segment
Or paste it into the playground. Same engine, in the browser, nothing sent anywhere.
cargo install pixellint
·
npm install pixellint