Retrieve Running Experiments
Retrieve all running experiments from your Storyblok space, with their variants and tested stories. The response has no pagination.
https://api.storyblok.com/v2/cdn/experimentsQuery parameters
Section titled “Query parameters”cvintegerCached version Unix timestamp. Learn more in the Caching concept.
by_story_idsstringRetrieve the experiments that test the original stories by story
id. Supports a comma-separated string.by_story_uuidsstringRetrieve the experiments that test the original stories by story
uuid. Supports a comma-separated string.by_story_full_slugsstringRetrieve the experiments that test the original stories by story
full_slug, for examplecampaigns/home. Supports a comma-separated string of exact matches. Matches only the default-language slug, so translated slugs return no experiments. With more than oneby_story_*parameter, a story must match every parameter.tokenrequired stringA preview or public access token configured in a space.
Response properties
Section titled “Response properties”experimentsarray<Experiment>An array of running experiment objects.
Show child properties
idintegerNumeric ID of the experiment.
namestringInternal name (lowercase letters, numbers, and underscores).
display_namestringHuman-readable display name.
story_idsarray<integer>An array of IDs of the original stories tested in the experiment, the same for every variant.
variantsarray<ExperimentVariant>Variants belonging to the experiment.
Show child properties
namestringInternal name (lowercase letters, numbers, and underscores).
display_namestringHuman-readable display name.
public_idstringPublic identifier for stable bucketing.
weightintegerTraffic weight percentage (0-100).
is_controlbooleanWhether the variant is the control variant. Visitors assigned to the control variant view the original stories.
story_mappingsarray<object>Pairs each original story in the experiment with the story copy that replaces it in this variant. The list is empty for the control variant and for variants without copies. When a story has no entry, the variant shows the original story.
Show child properties
original_story_idintegerNumeric ID of the original story.
original_uuidstring | nullUUID of the original story.
original_slugstring | nullSlug of the original story without the folder path, for example
postfor a story atblog/post.variant_story_idinteger | nullNumeric ID of the story copy shown in this variant.
variant_uuidstring | nullUUID of the story copy.
variant_slugstring | nullFull slug of the story copy, for example
blog/post-variant-a.
storiesarray<object>An array of the original stories tested in the experiment, the same stories as
story_ids, with theiridandfull_slug.Show child properties
idintegerNumeric ID of the story.
full_slugstringThe story’s full slug, including parent folder and language paths.
cvinteger | nullCached version Unix timestamp. Learn more in the Caching concept.
Examples
Section titled “Examples”curl "https://api.storyblok.com/v2/cdn/experiments\?token=YOUR_ACCESS_TOKEN"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ accessToken: "ask9soUkv02QqbZgmZdeDAtt",});
try { const response = await storyblok.get('cdn/experiments', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\Client('YOUR_STORYBLOK_SPACE_ACCESS_TOKEN');
$client->get('experiments')->getBody();HttpResponse<String> response = Unirest.get("https://api.storyblok.com/v2/cdn/experiments?token=YOUR_ACCESS_TOKEN") .asString();var client = new RestClient("https://api.storyblok.com/v2/cdn/experiments?token=YOUR_ACCESS_TOKEN");var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);import requests
url = "https://api.storyblok.com/v2/cdn/experiments"
querystring = {"token":"YOUR_ACCESS_TOKEN"}
payload = ""headers = {}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(token: 'YOUR_TOKEN')
client.get('experiments')// .package(url: "https://github.com/storyblok/storyblok-swift.git", from: "1.1.0")let storyblok = URLSession(storyblok: .cdn(accessToken: "YOUR_ACCESS_TOKEN"))let request = URLRequest(storyblok: storyblok, path: "experiments")let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))// implementation("com.storyblok:ktor-client-storyblok:0.7.1")val client = HttpClient { install(Storyblok(CDN)) { accessToken = "YOUR_ACCESS_TOKEN" }}
val response = client.get("experiments")
println(response.body<JsonElement>()){"experiments": [ { "id": 501, "name": "homepage_hero_test", "display_name": "Homepage Hero Test", "story_ids": [ 371891025 ], "stories": [ { "id": 371891025, "full_slug": "home" } ], "variants": [ { "name": "control", "display_name": "Control", "public_id": "var_abc123def456", "weight": 50, "is_control": true, "story_mappings": [] }, { "name": "variant_a", "display_name": "Variant A", "public_id": "var_789ghi012jkl", "weight": 50, "is_control": false, "story_mappings": [ { "original_story_id": 371891025, "original_uuid": "73a1d66c-3f1e-4b6a-9d2e-5c8f0a1b2c3d", "original_slug": "home", "variant_story_id": 371891777, "variant_uuid": "9f2b4c1a-6d3e-4f7a-8b9c-0d1e2f3a4b5c", "variant_slug": "home-variant-a" } ] } ] }],"cv": 1709500000}Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window).Terms of Service (opens in a new window) apply.
- Need help?Contact support (opens in a new window)
- Something isn’t right?Check system status (opens in a new window)
Get in touch with the Storyblok community