SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Why Are Custom Fields Missing From Segment Schema & Destinations?

Question

Why are my custom fields missing or dropped when sending events to Segment via the HTTP API? I see the fields in the debugger, but they do not appear in my schema or reach my destinations.

 

Product

Twilio Segment 

 

Environment

Segment Console

 

Answer

Segment enforces a strict event payload structure based on the Segment Spec. The ingestion API processes only recognized top-level fields:

  • General Top-Level Fields: userId, anonymousId, context, integrations, timestamp, messageId, sentAt, receivedAt, type, and version

  • Call-Specific Payload Objects:

    • Track calls: event and properties

    • Page and Screen calls: name and properties

    • Identify calls: traits

    • Group calls: groupId and traits

    • Alias calls: previousId

Any custom fields placed at the root level of the JSON payload (such as a top-level data object) are automatically ignored or stripped out by the ingestion API to ensure compatibility with downstream destinations.

While the full raw payload is visible in the Source Debugger’s Raw view, only fields matching the Segment Spec are ingested and routed to destinations. To ensure your custom data is processed, nest it inside the properties, traits, or context objects depending on the call type.

 

Additional Information 

If you are integrating with a third-party source that cannot modify the payload structure, you can use a Segment Source Function to transform incoming events and move custom fields into the correct location before ingestion.

Have more questions? Submit a request
Powered by Zendesk