Complete an Experiment
Complete a running experiment without selecting a winning variant. This transitions a running experiment to completed and sets the ended_at timestamp. You can’t undo this action. To complete the experiment and pick a winning variant in the same request, use the complete an experiment with a winning variant endpoint instead.
https://mapi.storyblok.com/v1/spaces/:space_id/experiments/:experiment_id/completePath parameters
Section titled “Path parameters”-
:space_idrequired numberNumeric ID of a space.
-
:experiment_idrequired numberNumeric ID of the experiment.
Response properties
Section titled “Response properties”-
experimentThe Experiment ObjectThe completed experiment object.
Examples
Section titled “Examples”curl "https://mapi.storyblok.com/v1/spaces/288868932106293/experiments/176070002766742/complete" \ -X PUT \ -H "Authorization: YOUR_OAUTH_TOKEN" \ -H "Content-Type: application/json" \ -d "{}"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",});
try { const response = await storyblok.put('spaces/288868932106293/experiments/176070002766742/complete', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$payload = [];
$client->put('spaces/288868932106293/experiments/176070002766742/complete', $payload)->getBody();HttpResponse<String> response = Unirest.put("https://mapi.storyblok.com/v1/spaces/288868932106293/experiments/176070002766742/complete") .header("Content-Type", "application/json") .header("Authorization", "YOUR_OAUTH_TOKEN") .body({}) .asString();var client = new RestClient("https://mapi.storyblok.com/v1/spaces/288868932106293/experiments/176070002766742/complete");var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");request.AddParameter("application/json", "{}", ParameterType.RequestBody);IRestResponse response = client.Execute(request);import requests
url = "https://mapi.storyblok.com/v1/spaces/288868932106293/experiments/176070002766742/complete"
querystring = {}
payload = {}headers = { 'Content-Type': "application/json", 'Authorization': "YOUR_OAUTH_TOKEN"}
response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
payload = {}
client.put('spaces/288868932106293/experiments/176070002766742/complete', payload)let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))var request = URLRequest(storyblok: storyblok, path: "spaces/288868932106293/experiments/176070002766742/complete")request.httpMethod = "PUT"request.httpBody = try JSONSerialization.data(withJSONObject: [ ])let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(MAPI)) { accessToken = OAuth("YOUR_OAUTH_TOKEN") }}
val response = client.put("spaces/288868932106293/experiments/176070002766742/complete") { setBody(buildJsonObject { })}
println(response.body<JsonElement>())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.
Get in touch with the Storyblok community