Skip to main content
POST
/
console
/
v1
/
autotunes
Create Autotune
curl --request POST \
  --url https://statsigapi.net/console/v1/autotunes \
  --header 'Content-Type: application/json' \
  --header 'STATSIG-API-KEY: <api-key>' \
  --data '{
  "description": "<string>",
  "variants": [
    {
      "name": "<string>",
      "json": "<any>",
      "size": 123
    }
  ],
  "successEvent": "<string>",
  "successEventValue": "<string>",
  "explorationWindow": "1hr",
  "attributionWindow": "1hr",
  "attributionWindowUnit": "min",
  "explorationWindowRate": 0.5005,
  "longtermExplorationAllocation": 0.5005,
  "winnerThreshold": "80%",
  "metadataField": "<string>",
  "higherIsBetter": true,
  "isContextual": true,
  "metricSourceID": "<string>",
  "linkedExperimentName": "<string>",
  "goalRichText": "<string>",
  "optimizationParameter": "occurrence",
  "valueColumn": "<string>",
  "featureList": [
    "<string>"
  ],
  "name": "<string>",
  "idType": "<string>"
}'
{
  "message": "Autotune Experiments created successfully.",
  "data": {
    "id": "button_color_test",
    "isStarted": false,
    "description": "Which color button gets the most clicks.",
    "lastModifierID": "ajv762klv9nx9hca",
    "lastModifierName": "CONSOLE API",
    "variants": [
      {
        "name": "red",
        "json": {
          "color": "red"
        }
      },
      {
        "name": "blue",
        "json": {
          "color": "blue"
        }
      }
    ],
    "successEvent": "click",
    "successEventValue": "",
    "explorationWindow": "1hr",
    "attributionWindow": "2hrs",
    "winnerThreshold": "99%"
  }
}

Authorizations

STATSIG-API-KEY
string
header
required

Headers

x-respect-review-settings
string

Optional header to respect review settings for mutation endpoints.

Body

application/json
variants
object[]
required

An array of Variant objects.

Minimum length: 2
successEvent
string
required

The event you are trying to optimize for.

explorationWindow
enum<string>
required

The initial time period where Autotune will equally split the traffic.

Available options:
1hr,
24hr,
48hr,
168hr,
336hr,
1,
24,
48,
168,
336,
1hrs,
24hrs,
48hrs,
168hrs,
336hrs
attributionWindow
enum<string>
required

The maximum duration between the exposure and success event that counts as a success.

Available options:
1hr,
2hr,
4hr,
24hr,
1hrs,
2hrs,
4hrs,
24hrs,
1,
2,
4,
24
winnerThreshold
enum<string>
required

The "probability of best" threshold a variant needs to achieve for Autotune to declare it the winner, stop collecting data, and direct all traffic.

Available options:
80%,
90%,
95%,
98%,
99%
name
string
required

The name that was originally given to the autotune on creation but formatted as an ID ("A Autotune" -> "a_autotune").

description
string

A brief summary of what the autotune is being used for.

successEventValue
string

The value that should come with the event for it to be considered successful.

attributionWindowUnit
enum<string>

Time unit of attribution window

Available options:
min,
hour,
day
explorationWindowRate
number

Exploration window rate

Required range: 0.001 <= x <= 1
longtermExplorationAllocation
number

Long term exploration allocation

Required range: 0.001 <= x <= 1
metadataField
string

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.

higherIsBetter
boolean

Whether to optimize for an increase or decrease in the metadata field value. Default is true. This is only used for contextual autotunes.

isContextual
boolean

Makes this autotune contextual

metricSourceID
string

Metric source to pull success event data from

linkedExperimentName
string

Linked experiment to measure the success of the Autotune

goalRichText
string

Autotune goal

optimizationParameter
enum<string>

Optimize for event occurrence vs value

Available options:
occurrence,
value
valueColumn
string

Metric source column to optimize for

featureList
string[]

List of features that should be included in the analysis

idType
string

idType of the autotune (userID, stableID, or a customID). Defaults to userID if not provided

Response

Create Autotune Success

message
string
required

A simple string explaining the result of the operation.

data
object
required

A single result.

I