curl --request POST \
--url https://statsigapi.net/console/v1/autotunes/{id} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"id": "my_autotunes_are_best",
"isStarted": false,
"description": "helpful summary of what this Autotune is",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"lastModifierName": "CONSOLE API",
"variants": [
{
"name": "red",
"json": {
"foo": "boo"
}
},
{
"name": "blue",
"json": {}
}
],
"successEvent": "purchase_item",
"successEventValue": "",
"explorationWindow": "1hr",
"attributionWindow": "2hrs",
"winnerThreshold": "99%",
"idType": "userID"
}
'import requests
url = "https://statsigapi.net/console/v1/autotunes/{id}"
payload = {
"id": "my_autotunes_are_best",
"isStarted": False,
"description": "helpful summary of what this Autotune is",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"lastModifierName": "CONSOLE API",
"variants": [
{
"name": "red",
"json": { "foo": "boo" }
},
{
"name": "blue",
"json": {}
}
],
"successEvent": "purchase_item",
"successEventValue": "",
"explorationWindow": "1hr",
"attributionWindow": "2hrs",
"winnerThreshold": "99%",
"idType": "userID"
}
headers = {
"STATSIG-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'STATSIG-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'my_autotunes_are_best',
isStarted: false,
description: 'helpful summary of what this Autotune is',
lastModifierID: 'ahKwUoaNauHu9AmJPc2',
lastModifierName: 'CONSOLE API',
variants: [{name: 'red', json: {foo: 'boo'}}, {name: 'blue', json: {}}],
successEvent: 'purchase_item',
successEventValue: '',
explorationWindow: '1hr',
attributionWindow: '2hrs',
winnerThreshold: '99%',
idType: 'userID'
})
};
fetch('https://statsigapi.net/console/v1/autotunes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://statsigapi.net/console/v1/autotunes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'my_autotunes_are_best',
'isStarted' => false,
'description' => 'helpful summary of what this Autotune is',
'lastModifierID' => 'ahKwUoaNauHu9AmJPc2',
'lastModifierName' => 'CONSOLE API',
'variants' => [
[
'name' => 'red',
'json' => [
'foo' => 'boo'
]
],
[
'name' => 'blue',
'json' => [
]
]
],
'successEvent' => 'purchase_item',
'successEventValue' => '',
'explorationWindow' => '1hr',
'attributionWindow' => '2hrs',
'winnerThreshold' => '99%',
'idType' => 'userID'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"STATSIG-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://statsigapi.net/console/v1/autotunes/{id}"
payload := strings.NewReader("{\n \"id\": \"my_autotunes_are_best\",\n \"isStarted\": false,\n \"description\": \"helpful summary of what this Autotune is\",\n \"lastModifierID\": \"ahKwUoaNauHu9AmJPc2\",\n \"lastModifierName\": \"CONSOLE API\",\n \"variants\": [\n {\n \"name\": \"red\",\n \"json\": {\n \"foo\": \"boo\"\n }\n },\n {\n \"name\": \"blue\",\n \"json\": {}\n }\n ],\n \"successEvent\": \"purchase_item\",\n \"successEventValue\": \"\",\n \"explorationWindow\": \"1hr\",\n \"attributionWindow\": \"2hrs\",\n \"winnerThreshold\": \"99%\",\n \"idType\": \"userID\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("STATSIG-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://statsigapi.net/console/v1/autotunes/{id}")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"my_autotunes_are_best\",\n \"isStarted\": false,\n \"description\": \"helpful summary of what this Autotune is\",\n \"lastModifierID\": \"ahKwUoaNauHu9AmJPc2\",\n \"lastModifierName\": \"CONSOLE API\",\n \"variants\": [\n {\n \"name\": \"red\",\n \"json\": {\n \"foo\": \"boo\"\n }\n },\n {\n \"name\": \"blue\",\n \"json\": {}\n }\n ],\n \"successEvent\": \"purchase_item\",\n \"successEventValue\": \"\",\n \"explorationWindow\": \"1hr\",\n \"attributionWindow\": \"2hrs\",\n \"winnerThreshold\": \"99%\",\n \"idType\": \"userID\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/autotunes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"my_autotunes_are_best\",\n \"isStarted\": false,\n \"description\": \"helpful summary of what this Autotune is\",\n \"lastModifierID\": \"ahKwUoaNauHu9AmJPc2\",\n \"lastModifierName\": \"CONSOLE API\",\n \"variants\": [\n {\n \"name\": \"red\",\n \"json\": {\n \"foo\": \"boo\"\n }\n },\n {\n \"name\": \"blue\",\n \"json\": {}\n }\n ],\n \"successEvent\": \"purchase_item\",\n \"successEventValue\": \"\",\n \"explorationWindow\": \"1hr\",\n \"attributionWindow\": \"2hrs\",\n \"winnerThreshold\": \"99%\",\n \"idType\": \"userID\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Autotune Experiment read successfully.",
"data": {
"id": "my_autotunes_are_best",
"isStarted": false,
"description": "helpful summary of what this Autotune is",
"lastModifierID": "jd93DGSnvkauH9FijdGiajh",
"lastModifierName": "CONSOLE API",
"variants": [
{
"name": "red",
"json": {
"color": "red"
}
},
{
"name": "blue",
"json": {
"color": "blue"
}
}
],
"successEvent": "purchase_item",
"successEventValue": "",
"explorationWindow": "1hr",
"attributionWindow": "2hrs",
"winnerThreshold": "99%"
}
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}{
"status": 404,
"message": "Not Found. The requested resource could not be found."
}Fully Update Autotune
Update all properties of the experiment
curl --request POST \
--url https://statsigapi.net/console/v1/autotunes/{id} \
--header 'Content-Type: application/json' \
--header 'STATSIG-API-KEY: <api-key>' \
--data '
{
"id": "my_autotunes_are_best",
"isStarted": false,
"description": "helpful summary of what this Autotune is",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"lastModifierName": "CONSOLE API",
"variants": [
{
"name": "red",
"json": {
"foo": "boo"
}
},
{
"name": "blue",
"json": {}
}
],
"successEvent": "purchase_item",
"successEventValue": "",
"explorationWindow": "1hr",
"attributionWindow": "2hrs",
"winnerThreshold": "99%",
"idType": "userID"
}
'import requests
url = "https://statsigapi.net/console/v1/autotunes/{id}"
payload = {
"id": "my_autotunes_are_best",
"isStarted": False,
"description": "helpful summary of what this Autotune is",
"lastModifierID": "ahKwUoaNauHu9AmJPc2",
"lastModifierName": "CONSOLE API",
"variants": [
{
"name": "red",
"json": { "foo": "boo" }
},
{
"name": "blue",
"json": {}
}
],
"successEvent": "purchase_item",
"successEventValue": "",
"explorationWindow": "1hr",
"attributionWindow": "2hrs",
"winnerThreshold": "99%",
"idType": "userID"
}
headers = {
"STATSIG-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'STATSIG-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'my_autotunes_are_best',
isStarted: false,
description: 'helpful summary of what this Autotune is',
lastModifierID: 'ahKwUoaNauHu9AmJPc2',
lastModifierName: 'CONSOLE API',
variants: [{name: 'red', json: {foo: 'boo'}}, {name: 'blue', json: {}}],
successEvent: 'purchase_item',
successEventValue: '',
explorationWindow: '1hr',
attributionWindow: '2hrs',
winnerThreshold: '99%',
idType: 'userID'
})
};
fetch('https://statsigapi.net/console/v1/autotunes/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://statsigapi.net/console/v1/autotunes/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 'my_autotunes_are_best',
'isStarted' => false,
'description' => 'helpful summary of what this Autotune is',
'lastModifierID' => 'ahKwUoaNauHu9AmJPc2',
'lastModifierName' => 'CONSOLE API',
'variants' => [
[
'name' => 'red',
'json' => [
'foo' => 'boo'
]
],
[
'name' => 'blue',
'json' => [
]
]
],
'successEvent' => 'purchase_item',
'successEventValue' => '',
'explorationWindow' => '1hr',
'attributionWindow' => '2hrs',
'winnerThreshold' => '99%',
'idType' => 'userID'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"STATSIG-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://statsigapi.net/console/v1/autotunes/{id}"
payload := strings.NewReader("{\n \"id\": \"my_autotunes_are_best\",\n \"isStarted\": false,\n \"description\": \"helpful summary of what this Autotune is\",\n \"lastModifierID\": \"ahKwUoaNauHu9AmJPc2\",\n \"lastModifierName\": \"CONSOLE API\",\n \"variants\": [\n {\n \"name\": \"red\",\n \"json\": {\n \"foo\": \"boo\"\n }\n },\n {\n \"name\": \"blue\",\n \"json\": {}\n }\n ],\n \"successEvent\": \"purchase_item\",\n \"successEventValue\": \"\",\n \"explorationWindow\": \"1hr\",\n \"attributionWindow\": \"2hrs\",\n \"winnerThreshold\": \"99%\",\n \"idType\": \"userID\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("STATSIG-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://statsigapi.net/console/v1/autotunes/{id}")
.header("STATSIG-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"my_autotunes_are_best\",\n \"isStarted\": false,\n \"description\": \"helpful summary of what this Autotune is\",\n \"lastModifierID\": \"ahKwUoaNauHu9AmJPc2\",\n \"lastModifierName\": \"CONSOLE API\",\n \"variants\": [\n {\n \"name\": \"red\",\n \"json\": {\n \"foo\": \"boo\"\n }\n },\n {\n \"name\": \"blue\",\n \"json\": {}\n }\n ],\n \"successEvent\": \"purchase_item\",\n \"successEventValue\": \"\",\n \"explorationWindow\": \"1hr\",\n \"attributionWindow\": \"2hrs\",\n \"winnerThreshold\": \"99%\",\n \"idType\": \"userID\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://statsigapi.net/console/v1/autotunes/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["STATSIG-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"my_autotunes_are_best\",\n \"isStarted\": false,\n \"description\": \"helpful summary of what this Autotune is\",\n \"lastModifierID\": \"ahKwUoaNauHu9AmJPc2\",\n \"lastModifierName\": \"CONSOLE API\",\n \"variants\": [\n {\n \"name\": \"red\",\n \"json\": {\n \"foo\": \"boo\"\n }\n },\n {\n \"name\": \"blue\",\n \"json\": {}\n }\n ],\n \"successEvent\": \"purchase_item\",\n \"successEventValue\": \"\",\n \"explorationWindow\": \"1hr\",\n \"attributionWindow\": \"2hrs\",\n \"winnerThreshold\": \"99%\",\n \"idType\": \"userID\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Autotune Experiment read successfully.",
"data": {
"id": "my_autotunes_are_best",
"isStarted": false,
"description": "helpful summary of what this Autotune is",
"lastModifierID": "jd93DGSnvkauH9FijdGiajh",
"lastModifierName": "CONSOLE API",
"variants": [
{
"name": "red",
"json": {
"color": "red"
}
},
{
"name": "blue",
"json": {
"color": "blue"
}
}
],
"successEvent": "purchase_item",
"successEventValue": "",
"explorationWindow": "1hr",
"attributionWindow": "2hrs",
"winnerThreshold": "99%"
}
}{
"status": 401,
"message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}{
"status": 404,
"message": "Not Found. The requested resource could not be found."
}Authorizations
Headers
Optional header to respect review settings for mutation endpoints.
Path Parameters
id
Body
Autotune object
An array of Variant objects.
2Show child attributes
Show child attributes
The event you are trying to optimize for.
The initial time period where Autotune will equally split the traffic.
1hr, 24hr, 48hr, 1, 24, 48, 1hrs, 24hrs, 48hrs The maximum duration between the exposure and success event that counts as a success.
1hr, 2hr, 4hr, 24hr, 1hrs, 2hrs, 4hrs, 24hrs, 1, 2, 4, 24 The "probability of best" threshold a variant needs to achieve for Autotune to declare it the winner, stop collecting data, and direct all traffic.
80%, 90%, 95%, 98%, 99% A brief summary of what the autotune is being used for.
The value that should come with the event for it to be considered successful.
Metadata field containing the numeric value to optimize for. If this field is null, autotune optimizes for the existence of a follow-up event. This is only used for contextual autotunes.
Whether to optimize for an increase or decrease in the metadata field value. Default is true. This is only used for contextual autotunes.

