This endpoint accepts a list of events for a given user and optionally some pre-existing state for the user. It uses these to determine the full list of cohorts of which they are a member, and returns these along with the updated state for the user. State is not persisted, so will not be used in the next request unless it is passed back in as part of that request.
It is likely that this endpoint is more performant than the stateful segmentation endpoint, since it does not need to read state for the user from a database. It is also useful for testing purposes.
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_id: The Permutive User IDstate: The updated user state (including cohort memberships)state and include it in your next request to maintain continuity.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.
A user identifier and a list of events to be used for segmentation, plus optional pre-existing state for the user.
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.
State is in the JSON format returned by this endpoint. It is not intended to be parsed or understood outside the context of this API or a Permutive SDK.