Create Experiment Snapshot
curl -X POST 'https://api.growthbook.io/api/v1/experiments/{id}/snapshot' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"triggeredBy":"schedule"}'import requests
url = "https://api.growthbook.io/api/v1/experiments/{id}/snapshot"
payload = {
"dimension": "<string>",
"phase": 1,
"ignoreWarnings": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dimension: '<string>', phase: 1, ignoreWarnings: true})
};
fetch('https://api.growthbook.io/api/v1/experiments/{id}/snapshot', 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://api.growthbook.io/api/v1/experiments/{id}/snapshot",
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([
'dimension' => '<string>',
'phase' => 1,
'ignoreWarnings' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.growthbook.io/api/v1/experiments/{id}/snapshot"
payload := strings.NewReader("{\n \"dimension\": \"<string>\",\n \"phase\": 1,\n \"ignoreWarnings\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.growthbook.io/api/v1/experiments/{id}/snapshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dimension\": \"<string>\",\n \"phase\": 1,\n \"ignoreWarnings\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growthbook.io/api/v1/experiments/{id}/snapshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dimension\": \"<string>\",\n \"phase\": 1,\n \"ignoreWarnings\": true\n}"
response = http.request(request)
puts response.read_body{
"snapshot": {
"id": "<string>",
"experiment": "<string>",
"status": "running",
"updateScope": "all_metrics",
"error": "<string>"
}
}{
"confirmation": {
"id": "<string>",
"status": "pending",
"actions": [
{
"action": "feature.create",
"environments": [
"<string>"
]
}
],
"summary": "<string>",
"url": "<string>",
"expiresAt": "<string>",
"response": {
"status": 123,
"body": "<unknown>"
},
"note": "<string>"
},
"message": "<string>"
}{
"message": "<string>",
"code": "requires_full_refresh",
"details": {
"reason": "<string>"
}
}Authorizations
Pass your API key as the Bearer token. See Authentication.
Body
Dimension to break results down by. For Unit Dimensions, use the dimension id (e.g. "dim_abc123"). For Experiment Dimensions, use "exp:" (e.g. "exp:country"). Built-in pre-exposure dimensions include "pre:date" and, when configured, "pre:activation". Use "cutoff:" (e.g. "cutoff:2026-01-15T00:12:00.000Z") to split units by whether they were first exposed before or after the cutoff; it must fall within the phase dates. Use "combo:::" (e.g. "combo:exp:country::dim_abc123") to break down by the intersection of two dimensions, each an Experiment Dimension or Unit Dimension id; values beyond the top 20 combined slices are merged into "(other)". Omit this field to create a standard snapshot.
Which metrics the update computes. "auto" (default) computes only the metrics added since the latest results when nothing else changed and those results are recent, otherwise all metrics. "new_metrics" computes only the added metrics and returns a 409 when it cannot. "all_metrics" computes every metric.
auto, new_metrics, all_metrics Set to true to acknowledge the warnings listed in a blocked response and continue. This covers experiment guards, locked dependents, and references affected by an archive. When the organization treats schema failures as warnings, it also covers schema and invariant warnings. It never bypasses a rejected Custom Hook. On revision publish endpoints, it can also force-publish an out-of-date draft when the caller has Bypass draft approvals access. Only set this when a person has explicitly asked you to. If a check blocks you, stop and ask a person instead of working around it.
Was this page helpful?
curl -X POST 'https://api.growthbook.io/api/v1/experiments/{id}/snapshot' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"triggeredBy":"schedule"}'import requests
url = "https://api.growthbook.io/api/v1/experiments/{id}/snapshot"
payload = {
"dimension": "<string>",
"phase": 1,
"ignoreWarnings": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({dimension: '<string>', phase: 1, ignoreWarnings: true})
};
fetch('https://api.growthbook.io/api/v1/experiments/{id}/snapshot', 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://api.growthbook.io/api/v1/experiments/{id}/snapshot",
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([
'dimension' => '<string>',
'phase' => 1,
'ignoreWarnings' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.growthbook.io/api/v1/experiments/{id}/snapshot"
payload := strings.NewReader("{\n \"dimension\": \"<string>\",\n \"phase\": 1,\n \"ignoreWarnings\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.growthbook.io/api/v1/experiments/{id}/snapshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dimension\": \"<string>\",\n \"phase\": 1,\n \"ignoreWarnings\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growthbook.io/api/v1/experiments/{id}/snapshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dimension\": \"<string>\",\n \"phase\": 1,\n \"ignoreWarnings\": true\n}"
response = http.request(request)
puts response.read_body{
"snapshot": {
"id": "<string>",
"experiment": "<string>",
"status": "running",
"updateScope": "all_metrics",
"error": "<string>"
}
}{
"confirmation": {
"id": "<string>",
"status": "pending",
"actions": [
{
"action": "feature.create",
"environments": [
"<string>"
]
}
],
"summary": "<string>",
"url": "<string>",
"expiresAt": "<string>",
"response": {
"status": 123,
"body": "<unknown>"
},
"note": "<string>"
},
"message": "<string>"
}{
"message": "<string>",
"code": "requires_full_refresh",
"details": {
"reason": "<string>"
}
}
