Segment events check submitted consent preferences.
Calls to the Segment HTTP Tracking API, single or batched under `batch`.
Consent category names remain open. Optional metadata receives type advice without inferring consent policy or destination delivery.
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. Native JSON type: string. Fix: Send the source write key in the body or as the basic auth username. | vendor.segment.body.writeKey.emptyvendor.segment.body.writeKey.invalid |
docs |
batch |
optional | Segment accepts a nonempty batch of at most 2500 event records. An oversized batch can receive HTTP 200 while its events are rejected. Native JSON type: array. Minimum array items: 1. Maximum array items: 2500. Fix: Split the request into batches of at most 2500 records while retaining each record and its identity. | vendor.segment.body.batch.invalid |
docs |
batch[] |
optional | The vendor documents `batch[]` in the request contract. Native JSON type: object. | vendor.segment.body.batch[].invalid |
docs |
root |
optional | The vendor documents `` in the request contract. Native JSON type: object. | vendor.segment.body.root.invalid |
docs |
body.write_key_placeholder |
recommended | `writeKey` contains a recognized installation placeholder instead of a configured source key. Evidence: heuristic. Fix: Copy the source write key from Settings > API Keys. Offline validation cannot verify whether other keys are active. | vendor.segment.body.write_key_placeholder |
docs |
type |
required | Segment documents that each call in a batch must carry a `type` naming a valid method. Body scope: batch[]. Native JSON type: string. 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. Body scope: batch[]. Native JSON type: string. Fix: Name the event, such as `Item Purchased`. | vendor.segment.body.event.emptyvendor.segment.body.event.invalid |
docs |
groupId |
optional | It identifies the group. Segment documents it as required on a group call. Body scope: batch[]. Native JSON type: string. Fix: Set `groupId` to the group in your database. | vendor.segment.body.groupId.emptyvendor.segment.body.groupId.invalid |
docs |
previousId |
optional | It is the previous unique identifier. Segment documents it as required on an alias call. Body scope: batch[]. Native JSON type: string. Fix: Set `previousId` to the id being merged. | vendor.segment.body.previousId.emptyvendor.segment.body.previousId.invalid |
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. Body scope: batch[]. Fix: Add the event name to the call. | vendor.segment.body.track_requires_an_event_name |
docs |
body.group_requires_group_id |
required | A `group` call carries no `groupId`. Segment documents the group id as required. Body scope: batch[]. Fix: Set `groupId` to the group in your database. | vendor.segment.body.group_requires_group_id |
docs |
body.alias_requires_previous_id |
required | An `alias` call carries no `previousId`. Segment documents the previous unique identifier as required. Body scope: batch[]. Fix: Set `previousId` to the id being merged. | vendor.segment.body.alias_requires_previous_id |
docs |
userId |
optional | It is your own identifier for the user. Segment documents that a call needs either this or `anonymousId`. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.userId.emptyvendor.segment.body.userId.invalid |
docs |
anonymousId |
optional | It stands in for a user id when there is none. Segment documents that a call needs either this or `userId`. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.anonymousId.emptyvendor.segment.body.anonymousId.invalid |
docs |
timestamp |
optional | Segment documents the timestamp as an ISO 8601 date string. Leave it out for events happening now. Body scope: ["batch[]",""]. Native JSON type: string. 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 |
sentAt |
optional | Segment documents `sentAt` as an ISO 8601 date string, the time the client sent the event. Body scope: ["batch[]",""]. Native JSON type: string. Fix: Send an ISO 8601 timestamp, such as `2026-07-26T00:30:12.984Z`. | vendor.segment.body.sentAt.emptyvendor.segment.body.sentAt.invalid |
docs |
messageId |
optional | Segment deduplicates on `messageId` and documents fewer than 100 characters. Body scope: ["batch[]",""]. Native JSON type: string. Maximum decoded characters: 99. Fix: Send a unique `messageId` of at most 99 characters. | vendor.segment.body.messageId.emptyvendor.segment.body.messageId.invalid |
docs |
context.ip |
optional | It is the visitor IP, sent unhashed. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.ip.emptyvendor.segment.body.context.ip.invalid |
docs |
context.userAgent |
optional | It is the user agent of the device making the request. Segment documents it as unhashed on `context`. Body scope: ["batch[]",""]. Native JSON type: string. Fix: Send the browser or device user agent string, or drop the empty pair. | vendor.segment.body.context.userAgent.emptyvendor.segment.body.context.userAgent.invalid |
docs |
context.page.url |
optional | It is the current page URL. Segment documents `url` on `context.page`. Body scope: ["batch[]",""]. Native JSON type: string. Fix: Send an absolute URL in `context.page.url`, including the scheme. | vendor.segment.body.context.page.url.emptyvendor.segment.body.context.page.url.invalid |
docs |
properties.currency |
optional | It is the ISO 4217 currency of `properties.revenue`. Segment documents it as a reserved track property. Body scope: ["batch[]",""]. Native JSON type: string. Fix: Send a three-letter code such as `USD`, or omit the field and Segment assumes US dollars. | vendor.segment.body.properties.currency.emptyvendor.segment.body.properties.currency.invalid |
docs |
properties.revenue |
optional | It is the dollar amount an event resulted in. Segment documents a reserved decimal number, such as `19.99`. Body scope: ["batch[]",""]. Native JSON type: number. Fix: Send a number such as `19.99`, with no currency symbol. | vendor.segment.body.properties.revenue.emptyvendor.segment.body.properties.revenue.invalid |
docs |
properties.value |
optional | It is an abstract value for an event that does not generate dollar revenue. Segment documents a reserved number. Body scope: ["batch[]",""]. Native JSON type: number. Fix: Send a number such as `1`, with no unit suffix. | vendor.segment.body.properties.value.emptyvendor.segment.body.properties.value.invalid |
docs |
properties.url |
optional | It is the page's full URL. Segment documents `url` as a reserved page property. Body scope: ["batch[]",""]. Native JSON type: string. Fix: Send an absolute URL in `properties.url`, including the scheme. | vendor.segment.body.properties.url.emptyvendor.segment.body.properties.url.invalid |
docs |
context.locale |
optional | It is the locale of the current user. Segment documents a string such as `en-US`. Body scope: ["batch[]",""]. Native JSON type: string. Fix: Send a locale tag such as `en-US`, or omit the field. | vendor.segment.body.context.locale.emptyvendor.segment.body.context.locale.invalid |
docs |
context |
optional | The vendor documents `context` in the request contract. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.invalid |
docs |
context.library |
optional | The vendor documents `context.library` in the request contract. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.library.invalid |
docs |
context.page |
optional | The vendor documents `context.page` in the request contract. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.page.invalid |
docs |
properties |
optional | The vendor documents `properties` in the request contract. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.properties.invalid |
docs |
traits |
optional | The vendor documents `traits` in the request contract. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.traits.invalid |
docs |
integrations |
optional | The vendor documents `integrations` in the request contract. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.integrations.invalid |
docs |
type |
optional | Body scope: ["batch[]",""]. | docs | |
context.app |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.app.invalid |
docs |
context.campaign |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.campaign.invalid |
docs |
context.device |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.device.invalid |
docs |
context.network |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.network.invalid |
docs |
context.os |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.os.invalid |
docs |
context.screen |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.screen.invalid |
docs |
context.traits |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.traits.invalid |
docs |
context.referrer |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.referrer.invalid |
docs |
context.location |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.location.invalid |
docs |
context.userAgentData |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.userAgentData.invalid |
docs |
context.app.name |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.app.name.invalid |
docs |
context.app.version |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.app.version.invalid |
docs |
context.app.build |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.app.build.invalid |
docs |
context.app.namespace |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.app.namespace.invalid |
docs |
context.campaign.name |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.campaign.name.invalid |
docs |
context.campaign.source |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.campaign.source.invalid |
docs |
context.campaign.medium |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.campaign.medium.invalid |
docs |
context.campaign.term |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.campaign.term.invalid |
docs |
context.campaign.content |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.campaign.content.invalid |
docs |
context.device.id |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.device.id.invalid |
docs |
context.device.advertisingId |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.device.advertisingId.invalid |
docs |
context.device.manufacturer |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.device.manufacturer.invalid |
docs |
context.device.model |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.device.model.invalid |
docs |
context.device.name |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.device.name.invalid |
docs |
context.device.type |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.device.type.invalid |
docs |
context.device.version |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.device.version.invalid |
docs |
context.os.name |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.os.name.invalid |
docs |
context.os.version |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.os.version.invalid |
docs |
context.page.path |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.page.path.invalid |
docs |
context.page.referrer |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.page.referrer.invalid |
docs |
context.page.search |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.page.search.invalid |
docs |
context.page.title |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.page.title.invalid |
docs |
context.library.name |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.library.name.invalid |
docs |
context.library.version |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.library.version.invalid |
docs |
context.device.adTrackingEnabled |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.context.device.adTrackingEnabled.invalid |
docs |
context.network.carrier |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.network.carrier.invalid |
docs |
context.network.bluetooth |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.context.network.bluetooth.invalid |
docs |
context.network.cellular |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.context.network.cellular.invalid |
docs |
context.network.wifi |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.context.network.wifi.invalid |
docs |
context.screen.density |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: number. | vendor.segment.body.context.screen.density.invalid |
docs |
context.screen.height |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: number. | vendor.segment.body.context.screen.height.invalid |
docs |
context.screen.width |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: number. | vendor.segment.body.context.screen.width.invalid |
docs |
context.timezone |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.timezone.invalid |
docs |
category |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.category.invalid |
docs |
name |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.name.invalid |
docs |
originalTimestamp |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.originalTimestamp.emptyvendor.segment.body.originalTimestamp.invalid |
docs |
receivedAt |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.receivedAt.emptyvendor.segment.body.receivedAt.invalid |
docs |
integrations.All |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.integrations.All.invalid |
docs |
destination_settings… |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean or object. | vendor.segment.body.destination_settings.invalid |
docs |
context.active |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.context.active.invalid |
docs |
context.groupId |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.groupId.invalid |
docs |
context.channel |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.channel.invalid |
docs |
version |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: number. | vendor.segment.body.version.invalid |
docs |
context.referrer.type |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.referrer.type.invalid |
docs |
context.referrer.name |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.referrer.name.invalid |
docs |
context.referrer.url |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.referrer.url.invalid |
docs |
context.referrer.link |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.referrer.link.invalid |
docs |
context.referrer.id |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.referrer.id.invalid |
docs |
context.referrer.btid |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.referrer.btid.invalid |
docs |
context.referrer.urid |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.referrer.urid.invalid |
docs |
context.location.city |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.location.city.invalid |
docs |
context.location.country |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.location.country.invalid |
docs |
context.location.region |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.location.region.invalid |
docs |
context.location.latitude |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string or number. | vendor.segment.body.context.location.latitude.invalid |
docs |
context.location.longitude |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string or number. | vendor.segment.body.context.location.longitude.invalid |
docs |
context.location.speed |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: number. | vendor.segment.body.context.location.speed.invalid |
docs |
context.userAgentData.architecture |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.userAgentData.architecture.invalid |
docs |
context.userAgentData.bitness |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.userAgentData.bitness.invalid |
docs |
context.userAgentData.model |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.userAgentData.model.invalid |
docs |
context.userAgentData.platform |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.userAgentData.platform.invalid |
docs |
context.userAgentData.platformVersion |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.userAgentData.platformVersion.invalid |
docs |
context.userAgentData.uaFullVersion |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: string. | vendor.segment.body.context.userAgentData.uaFullVersion.invalid |
docs |
context.userAgentData.mobile |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.context.userAgentData.mobile.invalid |
docs |
context.userAgentData.wow64 |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: boolean. | vendor.segment.body.context.userAgentData.wow64.invalid |
docs |
context.userAgentData.brands |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: array. | vendor.segment.body.context.userAgentData.brands.invalid |
docs |
context.userAgentData.brands[] |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.userAgentData.brands[].invalid |
docs |
context.userAgentData.fullVersionList |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: array. | vendor.segment.body.context.userAgentData.fullVersionList.invalid |
docs |
context.userAgentData.fullVersionList[] |
optional | Published common context field; validated when supplied. Body scope: ["batch[]",""]. Native JSON type: object. | vendor.segment.body.context.userAgentData.fullVersionList[].invalid |
docs |
context.consent |
optional | When supplied, consent metadata follows the published object shape. Its absence does not establish configured enforcement. Body scope: ["batch[]",""]. Presence diagnostic severity: warning. Native JSON type: object. | vendor.segment.body.context.consent.invalid |
docs |
context.consent.categoryPreferences |
optional | Category IDs are configured keys in an object. Empty and absent maps retain their documented distinct meanings. Body scope: ["batch[]",""]. Presence diagnostic severity: warning. Native JSON type: object. | vendor.segment.body.context.consent.categoryPreferences.invalid |
docs |
context.consent.categoryPreferences.* |
optional | The published preference map uses native JSON booleans. Category names remain open and case-sensitive. Body scope: ["batch[]",""]. Presence diagnostic severity: warning. Native JSON type: boolean. | vendor.segment.body.context.consent.categoryPreferences.*.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. Body scope: ["batch[]",""]. Fix: Send `userId` for a known user, or `anonymousId` for an unidentified one. | vendor.segment.body.call_needs_an_identifier |
docs |
body.hashed_plaintext_field |
required | `context.ip` or `context.userAgent` looks like a SHA-256 digest, but Segment documents both as plaintext. Body scope: ["batch[]",""]. Fix: Send the raw IP address or user agent string. | vendor.segment.body.hashed_plaintext_field |
docs |
body.alias_requires_user_id |
required | The request does not satisfy the documented alias requires user id requirement. Body scope: ["batch[]",""]. | vendor.segment.body.alias_requires_user_id |
docs |
type |
optional | The vendor documents `type` in the request contract. Native JSON type: string. | vendor.segment.body.type.emptyvendor.segment.body.type.invalid |
docs |
event |
optional | The vendor documents `event` in the request contract. Native JSON type: string. | vendor.segment.body.event.invalid |
docs |
groupId |
optional | The vendor documents `groupId` in the request contract. Native JSON type: string. | vendor.segment.body.groupId.invalid |
docs |
previousId |
optional | The vendor documents `previousId` in the request contract. Native JSON type: string. | vendor.segment.body.previousId.invalid |
docs |
body.track_method_required_field |
required | The request does not satisfy the documented track method required field requirement. | vendor.segment.body.track_method_required_field |
docs |
body.group_method_required_field |
required | The request does not satisfy the documented group method required field requirement. | vendor.segment.body.group_method_required_field |
docs |
body.alias_method_required_field |
required | The request does not satisfy the documented alias method required field requirement. | vendor.segment.body.alias_method_required_field |
docs |
root |
optional | Body scope: ["batch[].context.userAgentData.brands[]","context.userAgentData.brands[]"]. Native JSON type: object. | vendor.segment.body.root.invalid |
docs |
brand |
required | Body scope: ["batch[].context.userAgentData.brands[]","context.userAgentData.brands[]"]. Native JSON type: string. | vendor.segment.body.brand.missingvendor.segment.body.brand.invalid |
docs |
version |
required | Body scope: ["batch[].context.userAgentData.brands[]","context.userAgentData.brands[]"]. Native JSON type: string. | vendor.segment.body.version.missingvendor.segment.body.version.invalid |
docs |
root |
optional | Body scope: ["batch[].context.userAgentData.fullVersionList[]","context.userAgentData.fullVersionList[]"]. Native JSON type: object. | vendor.segment.body.root.invalid |
docs |
brand |
required | Body scope: ["batch[].context.userAgentData.fullVersionList[]","context.userAgentData.fullVersionList[]"]. Native JSON type: string. | vendor.segment.body.brand.missingvendor.segment.body.brand.invalid |
docs |
version |
required | Body scope: ["batch[].context.userAgentData.fullVersionList[]","context.userAgentData.fullVersionList[]"]. Native JSON type: string. | vendor.segment.body.version.missingvendor.segment.body.version.invalid |
docs |
method |
required | This published ingestion operation uses HTTP POST. Complete HTTP capture contract. Native JSON type: string. | vendor.segment.http.method.missingvendor.segment.http.method.emptyvendor.segment.http.method.invalid |
docs |
content_type |
required | Use a published request media type. Complete HTTP capture contract. Native JSON type: string. | vendor.segment.http.content_type.missingvendor.segment.http.content_type.emptyvendor.segment.http.content_type.invalid |
docs |
body |
required | The request body is a JSON object. Complete HTTP capture contract. Native JSON type: object. | vendor.segment.http.body.missingvendor.segment.http.body.invalid |
docs |
path |
required | Endpoint identifies the single-event method or batch operation. Complete HTTP capture contract. Native JSON type: string. | vendor.segment.http.path.missingvendor.segment.http.path.emptyvendor.segment.http.path.invalid |
docs |
authorization_scheme |
optional | Published alternatives are Basic or OAuth Bearer, or writeKey in the body. Complete HTTP capture contract. Native JSON type: string. | vendor.segment.http.authorization_scheme.emptyvendor.segment.http.authorization_scheme.invalid |
docs |
headers.authorization |
optional | OAuth uses a Bearer header. Complete HTTP capture contract. Applies when {"kind":"value_in","param":"authorization_scheme","values":["bearer"]}. Native JSON type: string. | vendor.segment.http.headers.authorization.emptyvendor.segment.http.headers.authorization.invalid |
docs |
body.writeKey |
optional | Body writeKey is an authentication alternative and is required for OAuth. Complete HTTP capture contract. Native JSON type: string. | vendor.segment.http.body.writeKey.emptyvendor.segment.http.body.writeKey.invalid |
docs |
basic_auth.username |
required | The Basic username is the source write key. Complete HTTP capture contract. Applies when {"kind":"value_in","param":"authorization_scheme","values":["basic"]}. Native JSON type: string. | vendor.segment.http.basic_auth.username.missingvendor.segment.http.basic_auth.username.emptyvendor.segment.http.basic_auth.username.invalid |
docs |
basic_auth.password |
optional | The documented Basic password is empty. Complete HTTP capture contract. Applies when {"kind":"value_in","param":"authorization_scheme","values":["basic"]}. Presence diagnostic severity: warning. Value diagnostic severity: warning. Native JSON type: string. | vendor.segment.http.basic_auth.password.emptyvendor.segment.http.basic_auth.password.invalid |
docs |
basic_auth.has_colon |
optional | Legacy Basic without a colon remains backward compatible but is discouraged. Complete HTTP capture contract. Native JSON type: boolean. | vendor.segment.http.basic_auth.has_colon.invalid |
docs |
body.event |
required | Track event is required even when type is inferred from the endpoint. Complete HTTP capture contract. Applies when {"kind":"value_pattern","param":"path","pattern":"^/v1/track/?$"}. Native JSON type: string. | vendor.segment.http.body.event.missingvendor.segment.http.body.event.emptyvendor.segment.http.body.event.invalid |
docs |
body.groupId |
required | Group ID is required on the group route. Complete HTTP capture contract. Applies when {"kind":"value_pattern","param":"path","pattern":"^/v1/group/?$"}. Native JSON type: string. | vendor.segment.http.body.groupId.missingvendor.segment.http.body.groupId.emptyvendor.segment.http.body.groupId.invalid |
docs |
body.previousId |
required | Previous ID is required on the alias route. Complete HTTP capture contract. Applies when {"kind":"value_pattern","param":"path","pattern":"^/v1/alias/?$"}. Native JSON type: string. | vendor.segment.http.body.previousId.missingvendor.segment.http.body.previousId.emptyvendor.segment.http.body.previousId.invalid |
docs |
body.batch |
required | Batch endpoint requires its event array. Complete HTTP capture contract. Applies when {"kind":"value_pattern","param":"path","pattern":"^/v1/batch/?$"}. Native JSON type: array. Minimum array items: 1. | vendor.segment.http.body.batch.missingvendor.segment.http.body.batch.invalid |
docs |
basic_auth |
required | Basic credentials must decode to the published write-key username representation. Complete HTTP capture contract. Applies when {"kind":"value_in","param":"authorization_scheme","values":["basic"]}. Native JSON type: object. | vendor.segment.http.basic_auth.missingvendor.segment.http.basic_auth.invalid |
docs |
http.basic_write_key_placeholder |
recommended | The Basic authentication username contains a recognized write-key installation placeholder. Complete HTTP capture contract. Evidence: heuristic. Fix: Use the source write key as the Basic username, then append a colon before Base64 encoding. | vendor.segment.http.basic_write_key_placeholder |
docs |
http.authentication_required |
required | Authenticate with body writeKey or the Basic write-key username. Complete HTTP capture contract. | vendor.segment.http.authentication_required |
docs |
http.oauth_write_key_required |
required | OAuth requests also require the source writeKey in the JSON body. Complete HTTP capture contract. | vendor.segment.http.oauth_write_key_required |
docs |
http.basic_colon_recommended |
recommended | Append a colon to the Basic write key before Base64 encoding. The legacy form remains compatible. Complete HTTP capture contract. | vendor.segment.http.basic_colon_recommended |
docs |
Validate a payload
pixellint validate request @request.json --rulepack vendor/segment
Try this failing payload in the playground. An example with a validation finding.
{
"url": "https://api.segment.io/v1/track",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Basic c3ludGhldGljOg=="
},
"body": "{\"userId\":\"synthetic-user\",\"event\":\"Synthetic Event\",\"writeKey\":\"synthetic-write-key\",\"context\":{\"consent\":{\"categoryPreferences\":{\"Analytics\":\"false\"}}}}"
}
cargo install pixellint
·
npm install pixellint