Diff a revision against another revision
Returns a schema-keyed JSON diff between this revision and a baseline. The same shapes the in-app review surface produces under Copy as → Minimal JSON / Full JSON: minimal lists only what changed (with id-keyed arrays bucketed into added/removed/modified items and reorder detection), while full returns the complete before/after content of the revision. Lifecycle fields (version, status, comment, date, createdBy, publishedBy) are excluded from the diff body and echoed via from / to instead. Defaults to diffing against the revision’s own baseVersion; pass ?base=live to diff against the current live revision, or ?base=<version> for an arbitrary historical one.
curl -X GET 'https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff' \
-H 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff', 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/v2/features/{id}/revisions/{version}/diff",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"diff": {
"name": "<string>",
"type": "feature",
"from": 123,
"to": 123,
"changes": [
{
"field": "<string>",
"change": "added"
}
],
"supplemental": [
{
"name": "<string>",
"type": "<string>",
"change": "added"
}
]
}
}Authorizations
If using Bearer auth, pass the Secret Key as the token:
curl https://api.growthbook.io/api/v1/features -H "Authorization: Bearer secret_abc123DEF456"
Query Parameters
minimal (default) returns only what changed, with id-keyed arrays bucketed into added/removed/modified items. full returns the complete before/after content of the revision.
minimal, full Compare against: baseVersion (default — the revision's own baseVersion, matches the in-app review view), live (the currently-live revision), or an integer version (an arbitrary historical revision).
"baseVersion"Response
Successful response
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?
curl -X GET 'https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff' \
-H 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff', 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/v2/features/{id}/revisions/{version}/diff",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.growthbook.io/api/v2/features/{id}/revisions/{version}/diff")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"diff": {
"name": "<string>",
"type": "feature",
"from": 123,
"to": 123,
"changes": [
{
"field": "<string>",
"change": "added"
}
],
"supplemental": [
{
"name": "<string>",
"type": "<string>",
"change": "added"
}
]
}
}
