Experiments

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.

get/experiments/exposures

Query parameters

account_idstring
anonymous_idstring
user_idstring

Bucketing subject. Ownership is the top-level account_id. Account experiments accept caller-supplied subject IDs; internal experiments derive the user from the session.

idstring required

Referenced resource tag, belonging to the experiment owner.

object'app' | 'app_build' | 'product' | 'plan' required

Restricts batch evaluation to this related resource; omitted batches contain only unbound experiments.

{
  "object": "app"
}
flag_keystring

Flag or experiment to evaluate — the flag_key handle or the expt_ id. Omit to return all flags the caller qualifies for.

account_idstring

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.

log_exposureboolean

Set false to evaluate without recording an exposure. Omitted records it.

Response

single flag evaluated

OR

Example response

{
  "enabled": true,
  "flag_key": "checkout_redesign",
  "related_resource": {
    "object": "app"
  },
  "variant": "treatment"
}

Changes