Evaluate Experiments
Evaluates and records an exposure without requiring authentication. When credentials resolve, their authentication method, API key ID, and signed-in user ID are recorded on the exposure event. Pass subject for bucketing identity and account_id for experiment ownership.
Pass flag_key to check a single flag, or omit it to fetch active flags in the account and related resource scope. Internal anonymous callers may use the x-whop-anonymous-id header or ajs_anonymous_id cookie; explicit subject[anonymous_id] takes precedence.
Assignments use exactly the configured bucket_by: subject[user_id], subject[account_id], or subject[anonymous_id]. Internal user experiments derive identity from the signed-in session. Missing the required identity fails single evaluation and omits the experiment from batch evaluation. Subjects outside all treatment ranges receive control.
Pass subject[account_id] to enable account-level targeting rules. Pass properties as a JSON object to supply the values that property targeting conditions match against.
Pass log_exposure=false to read an assignment without recording an exposure, for a client that caches assignments up front and records the exposure when the arm is actually rendered. Omitted records the exposure, so pinned callers are unchanged.
Query parameters
Bucketing subject. Ownership is the top-level account_id. Account experiments accept caller-supplied subject IDs; internal experiments derive the user from the session.
Restricts batch evaluation to this related resource; omitted batches contain only unbound experiments.
{
"object": "app"
}Flag or experiment to evaluate — the flag_key handle or the expt_ id. Omit to return all flags the caller qualifies for.
Owning account ID or internal. Required when evaluating by flag_key or in a batch; optional for an expt_ ID.
JSON-encoded scalar values that property targeting conditions match against. Numeric and boolean strings are coerced. Nested query keys such as properties[plan]=pro remain accepted for existing callers. For internal experiments, is_internal_user is derived from the session and cannot be overridden.
Set false to evaluate without recording an exposure. Omitted records it.
Response
single flag evaluated
Example response
{
"enabled": true,
"flag_key": "checkout_redesign",
"related_resource": {
"object": "app"
},
"variant": "treatment"
}Changes
Changed in 1 of the 74 revisions of this API.1
- ○
added the new optional
queryrequest parameterlog_exposurenew-optional-request-parameter
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
Of the 74 revisions, 1 has no diff computed.