Access Winning Variant programmatically from anywhere (including outside of Snowflake) to get or make experiment assignments.
POST /experiment-assignments
Use this endpoint to get or set assignments for a list of subject IDs in a given experiment. If an assignment already exists, it is returned, otherwise a new one is created and returned.
Parameter | Type | Required | Description |
---|---|---|---|
experiment_id | string | Yes | The ID of the experiment to get/set assignments for. |
subject_ids | string[] | Yes | List of subject IDs to get/set assignments for within the given experiment. |
assignments
, itself another object with key-value pairs. The key is the subject ID originally provided and the value is the variant it’s assigned within the experiment.
user_123
in experiment MY-EXPERIMENT
. The response indicates that the subject is assigned the CONTROL
variant.
proxy
application role, you can deploy your own simple reverse proxy that appends the Authentication
header or use a forwarding service, such as one through Cloudflare.
WVPROXY
in our examples:
PROXY
application role created by the app. This will give it usage of the service that serves the Variant API.
/experiment-assignments
and /healthz
endpoints only.
Health Checks
A health check is available at /healthz
, which returns a 200
status code if the service is alive and able to communicate with the appropriate Snowflake database. This health check is used by Snowpark Container Services, but may also be used by you to monitor uptime.
Winning Variant would also like to monitor the uptime of your reverse proxy, so please provide the hostname of the service, when live, and add this list of IP addresses to your allowlist.