Enrich profiles with Flex interaction data
Flex uses customer interaction data to enrich user profiles in Segment. For each customer interaction, Flex sends two enrichment events:
To send enrichment events, you must have the source flex-unify-server-source
configured in your Segment workspace. This source is created when you connect a Segment workspace, and you can confirm it's configured by navigating to Unify > Unify settings > Profile sources in Segment.

Flex sends the Flex - Engagement Initiated
event to Segment when an agent ends the call or conversation and the task enters wrap-up mode. This event has the following properties:
Property | Description |
---|---|
customerStartTime | The start time of the interaction. |
Duration | The duration of the interaction in seconds. |
lastKnownAgentWorkerSid | Worker SID (WKxxxxx) for the last agent handling the interaction. |
firstKnownAgentWorkerSid | Worker SID (WKxxxxx) for the first agent handling the interaction. |
interactionSid | The interaction SID (KDxxxxx). |
channelSid | The channel SID (UOxxxxx). |
channelType | The channel type of the interaction. (For example, Email , SMS , or WhatsApp ) |
Direction | Indicates whether the interaction was inbound or outbound. |
Flex sends the Flex - Engagement Completed
event to Segment when an agent completes the wrapup phase, and the task is completed. If you're using Copilot, wrap-up notes are also available at this point.
Flex - Engagement Completed
has the following properties:
Property | Description |
---|---|
channelSid | The channel SID. |
interactionSid | The interaction SID. |
codes | Topic and disposition code from the Agent Copilot wrap-up notes. (For example, {"dispositionCode":"Scheduled test drive", "topic":"Used vehicles"} ) |
sentiment | The sentiment of the end-customer, as detected by Agent Copilot. (Can be positive , neutral , or negative ) |
After each customer interaction, the following profile traits are also updated based on the Flex-to-Segment enrichment:
flex_last-interaction-duration
flex_last-interaction-outcome
flex_last-interaction-sentiment
flex_last-interaction-start-time
flex_last-interaction-topics
flex_last-known-agent
Learn more about using profile enrichment data for creating computed traits in Segment.
You can view enriched events associated with a user profile in Segment:
- In Segment, navigate to the Profile explorer (Unify > Profile explorer).
- Select a user profile.
- Click Events.
You can use enriched Segment profile data for intelligent routing. With Twilio Studio's Search for a Profile widget, you can look up customer profile information when handling an inbound call.
You can then configure your Studio Flow to branch out based on the values of the enriched profile traits. For example:
- If a customer's last interaction sentiment is negative, route the caller to a higher-priority queue.
- If a customer's last interaction occurred less than 24 hours ago for a specific topic, route them to the appropriate queue for follow-up.
Learn more about intelligent routing in Studio where you can use real-time, enriched profile data for each customer.