---
title: Partially Update Autotune
description: Update selected properties of the experiment
product: general
token_estimate: 3680
---
# Partially Update Autotune

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## Partially Update Autotune

**PATCH** `/console/v1/autotunes/{id}`

Full URL: `https://statsigapi.net/console/v1/autotunes/{id}`

Partially Update Autotune

Update selected properties of the experiment

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| id (path) | string | Yes | — | id |

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| description | string | No | — | A brief summary of what the autotune is being used for. |
| variants | object[] | No | — | An array of Variant objects. |
| variants.name | string | Yes | — | Variant name |
| variants.json | unknown | Yes | — | Variant JSON data |
| variants.size | number | No | — | Variant size |
| successEvent | string | No | — | The event you are trying to optimize for. |
| successEventValue | string | No | — | The value that should come with the event for it to be considered successful. |
| explorationWindow | string | No | — | The initial time period where Autotune will equally split the traffic. Allowed values: 1hr, 24hr, 48hr, 168hr, 336hr, 1, 24, 48, 168, 336, 1hrs, 24hrs, 48hrs, 168hrs, 336hrs |
| attributionWindow | string | No | — | The maximum duration between the exposure and success event that counts as a success. Allowed values: 1hr, 2hr, 4hr, 24hr, 1hrs, 2hrs, 4hrs, 24hrs, 1, 2, 4, 24 |
| attributionWindowUnit | string | No | — | Time unit of attribution window Allowed values: min, hour, day |
| explorationWindowRate | number | No | — | Exploration window rate Constraints: format: double, min: 0.001, max: 1 |
| longtermExplorationAllocation | number | No | — | Long term exploration allocation Constraints: format: double, min: 0.001, max: 1 |
| winnerThreshold | string | No | — | The "probability of best" threshold a variant needs to achieve for Autotune to declare it the winner, stop collecting data, and direct all traffic. Allowed values: 80%, 90%, 95%, 98%, 99% |
| metadataField | string | No | — | 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 | No | — | 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 | No | — | Whether this is a contextual autotune |
| metricSourceID | string | No | — | Metric source to pull success event data from |
| linkedExperimentName | string | No | — | Linked experiment to measure the success of the Autotune |
| goalRichText | string | No | — | Autotune goal |
| optimizationParameter | string | No | — | Optimize for event occurrence vs value Allowed values: occurrence, value |
| valueColumn | string | No | — | Metric source column to optimize for |
| featureList | string[] | No | — | List of features that should be included in the analysis |

## Response (application/json)

**200** — Partially Update Autotune Success

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.description | string | Yes | — | Detailed description of the configuration’s purpose. |
| data.variants | object[] | Yes | — | — |
| data.variants.name | string | Yes | — | Variant name |
| data.variants.json | unknown | Yes | — | Variant JSON data |
| data.variants.size | number | No | — | Variant size |
| data.variants.id | string | Yes | — | The name that was originally given to the autotune on creation but formatted as an ID ("A Autotune" -> "a_autotune"). |
| data.successEvent | string | Yes | — | The event you are trying to optimize for. |
| data.successEventValue | string | Yes | — | The value that should come with the event for it to be considered successful. |
| data.explorationWindow | string | Yes | — | The initial time period where Autotune will equally split the traffic. Allowed values: 1hr, 24hr, 48hr, 168hr, 336hr, 1, 24, 48, 168, 336, 1hrs, 24hrs, 48hrs, 168hrs, 336hrs |
| data.attributionWindow | string | Yes | — | The maximum duration between the exposure and success event that counts as a success. Allowed values: 1hr, 2hr, 4hr, 24hr, 1hrs, 2hrs, 4hrs, 24hrs, 1, 2, 4, 24 |
| data.attributionWindowUnit | string | No | — | Time unit of attribution window Allowed values: min, hour, day |
| data.explorationWindowRate | number | No | — | Exploration window rate Constraints: format: double, min: 0.001, max: 1 |
| data.longtermExplorationAllocation | number | No | — | Long term exploration allocation Constraints: format: double, min: 0.001, max: 1 |
| data.winnerThreshold | string | Yes | — | The "probability of best" threshold a variant needs to achieve for Autotune to declare it the winner, stop collecting data, and direct all traffic. Allowed values: 80%, 90%, 95%, 98%, 99% |
| data.metadataField | string | No | — | 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. |
| data.higherIsBetter | boolean | No | — | Whether to optimize for an increase or decrease in the metadata field value. Default is true. This is only used for contextual autotunes. |
| data.isContextual | boolean | No | — | Whether this is a contextual autotune |
| data.metricSourceID | string | No | — | Metric source to pull success event data from |
| data.linkedExperimentName | string | No | — | Linked experiment to measure the success of the Autotune |
| data.goalRichText | string | No | — | Autotune goal |
| data.optimizationParameter | string | No | — | Optimize for event occurrence vs value Allowed values: occurrence, value |
| data.valueColumn | string | No | — | Metric source column to optimize for |
| data.featureList | string[] | No | — | List of features that should be included in the analysis |
| data.inlineTargetingRulesJSON | string | No | — | A raw JSON string of the inline targeting rules Constraints: nullable |
| data.inlineTargetingRules | object[] | No | — | A formatted array of the inline targeting rules |
| data.inlineTargetingRules.name | string | Yes | — | The name of this rule. |
| data.inlineTargetingRules.passPercentage | number | Yes | — | Of the users that meet the conditions of this rule, what percent should return true. Constraints: min: 0, max: 100 |
| data.inlineTargetingRules.conditions | object[] | Yes | — | An array of Condition objects. |
| data.inlineTargetingRules.conditions.targetValue | oneOf | No | — | Constraints: nullable, string[], number[], string, number |
| data.inlineTargetingRules.conditions.operator | string | No | — | — |
| data.inlineTargetingRules.conditions.field | string | No | — | Constraints: nullable |
| data.inlineTargetingRules.conditions.customID | string | No | — | Constraints: nullable |
| data.inlineTargetingRules.conditions.type | string | Yes | — | Allowed values: app_version, browser_name, browser_version, country, custom_field, email, environment_tier, fails_gate, fails_segment, ip_address, locale, os_name, os_version, passes_gate, passes_segment, public, time, unit_id, user_id, user_agent, url, javascript, device_model, target_app, experiment_group |
| data.inlineTargetingRules.environments | string[] | No | — | The environments this rule is enabled for. Constraints: nullable |
| data.inlineTargetingRules.id | string | No | — | The Statsig ID of this rule. |
| data.inlineTargetingRules.baseID | string | No | — | The base ID of this rule, i.e. without any added metadata. Will remain the exact same throughout |
| data.inlineTargetingRules.returnValue | object | No | — | The return value of the rule. |
| data.inlineTargetingRules.completedAutomatedRollouts | object[] | No | — | Read-only: Automated rollout phases that have already completed. |
| data.inlineTargetingRules.completedAutomatedRollouts.time | number | No | — | — |
| data.inlineTargetingRules.completedAutomatedRollouts.passPercent | number | Yes | — | — |
| data.inlineTargetingRules.pendingAutomatedRollouts | object[] | No | — | Read-only: Automated rollout phases that are scheduled but not yet complete. |
| data.inlineTargetingRules.pendingAutomatedRollouts.time | number | No | — | — |
| data.inlineTargetingRules.pendingAutomatedRollouts.passPercent | number | Yes | — | — |
| data.id | string | Yes | — | ID |
| data.name | string | No | — | Optional name for the configuration. |
| data.idType | string | Yes | — | Type of ID |
| data.lastModifierID | string | Yes | — | ID of the last modifier. Constraints: nullable |
| data.lastModifiedTime | number | Yes | — | Time of the last modification. Constraints: format: double, nullable |
| data.lastModifierEmail | string | Yes | — | Email of the last modifier. Constraints: nullable |
| data.lastModifierName | string | Yes | — | Name of the last modifier. Constraints: nullable |
| data.creatorID | string | Yes | — | ID of the user who created the entity. Constraints: nullable |
| data.createdTime | number | Yes | — | Timestamp when the entity was created. Constraints: format: double |
| data.creatorName | string | Yes | — | Name of the creator. Constraints: nullable |
| data.creatorEmail | string | Yes | — | Email of the creator. Constraints: nullable |
| data.tags | string[] | No | — | Optional tags for categorization. |
| data.targetApps | string[] | No | — | List of target applications associated with this configuration. |
| data.holdoutIDs | string[] | No | — | Holdouts applied to this configuration. |
| data.team | string | No | — | Optional name for the responsible team. Constraints: nullable |
| data.teamID | string | No | — | Optional ID of the responsible team. Constraints: nullable |
| data.version | number | No | — | Version number Constraints: format: double |
| data.isStarted | boolean | Yes | — | Is the autotune experiment currently running. |
| data.winner | object | Yes | — | Constraints: nullable |
| data.winner.id | string | Yes | — | The Statsig ID of the winner group. |
| data.winner.name | string | Yes | — | The name of the winner group. |

```json
{
  "message": "Autotune Experiment updated successfully.",
  "data": {
    "id": "a_autotune",
    "isStarted": false,
    "description": "helpful summary of what this Autotune is",
    "lastModifierID": "jd93DGSnvkauH9FijdGiajh",
    "lastModifierName": "CONSOLE API",
    "inlineTargetingRulesJSON": "{}",
    "inlineTargetingRules": [],
    "variants": [
      {
        "name": "red",
        "json": {
          "color": "red"
        }
      },
      {
        "name": "blue",
        "json": {
          "color": "blue"
        }
      }
    ],
    "successEvent": "purchase_item",
    "successEventValue": "",
    "explorationWindow": "1hr",
    "attributionWindow": "2hrs",
    "winnerThreshold": "99%"
  }
}
```

**400** — Invalid request. Please check the request input and try again.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 400 |
| message | string | Yes | — | — |

```json
{
  "status": 400,
  "message": "Invalid request. Please check the request input and try again."
}
```

**401** — This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 401 |
| message | string | Yes | — | — |

```json
{
  "status": 401,
  "message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}
```

**404** — Not Found. The requested resource could not be found.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 404 |
| message | string | Yes | — | — |

```json
{
  "status": 404,
  "message": "Not Found. The requested resource could not be found."
}
```

## Code samples

### cURL

```bash
curl -X PATCH "https://statsigapi.net/console/v1/autotunes/{id}" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.patch(
    "https://statsigapi.net/console/v1/autotunes/{id}",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/autotunes/{id}", {
  method: "PATCH",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/autotunes/{id}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("PATCH", "https://statsigapi.net/console/v1/autotunes/{id}", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/autotunes/{id}"))
      .method("PATCH", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/autotunes/{id}")
request = Net::HTTP::Patch.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

