Segment User
This endpoint accepts a list of events for a given user and combines them with any pre-existing state for the user to determine the full list of cohorts of which they are a member. State is also persisted, to be applied to subsequent requests for the same user.
Events provided to this endpoint are published to the Permutive Events API, meaning that they will be reflected in other areas of Permutive, for example Insights.
User Identification
You must provide exactly one of the following to identify the user:user_id: The Permutive User ID (UUID)alias: A single custom alias withtagandidaliases: A list of prioritized aliases, each withpriority,tag, andid
Events
Events should match the schema defined in your Permutive workspace. Each event requires:name: The event name (e.g., “Pageview”)time: ISO 8601 timestampproperties: Event properties as a JSON object
view_id: UUID to group events within a single page viewsession_id: UUID to group events within a session
Response
The response includes:user_id: The Permutive User IDcohorts: List of cohort IDs the user is currently a member ofactivations: (Optional) Map of activation platform to cohort IDs, ifactivations=truewas set
Example Usage
Authorizations
Query Parameters
Return a list of activated cohorts in the response
Validate provided event(s) against their schema before proceeding with segmentation.
By default validation is performed asynchronously after segmentation has been performed and the response has been returned. This can make it difficult to debug issues with invalid events.
It is recommended to use this option only during development and debugging, as validation can be expensive and slow.
Body
A user identifier together with a list of events to be used for segmentation.
The user identifier must be either a user_id, an alias, or a list of prioritised aliases.
The largest number of events that can currently be included in a single request is 10.