Update a website test
curl --request PATCH \
--url https://api.revdesk.com/v1/optimize/tests/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"hypothesis": "<string>",
"page_url": "<string>",
"traffic_split": 0.525
}
'import requests
url = "https://api.revdesk.com/v1/optimize/tests/{id}"
payload = {
"name": "<string>",
"hypothesis": "<string>",
"page_url": "<string>",
"traffic_split": 0.525
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
hypothesis: '<string>',
page_url: '<string>',
traffic_split: 0.525
})
};
fetch('https://api.revdesk.com/v1/optimize/tests/{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://api.revdesk.com/v1/optimize/tests/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'hypothesis' => '<string>',
'page_url' => '<string>',
'traffic_split' => 0.525
]),
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.revdesk.com/v1/optimize/tests/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"hypothesis\": \"<string>\",\n \"page_url\": \"<string>\",\n \"traffic_split\": 0.525\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.revdesk.com/v1/optimize/tests/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"hypothesis\": \"<string>\",\n \"page_url\": \"<string>\",\n \"traffic_split\": 0.525\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revdesk.com/v1/optimize/tests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"hypothesis\": \"<string>\",\n \"page_url\": \"<string>\",\n \"traffic_split\": 0.525\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"hypothesis": "<string>",
"status": "draft",
"kind": "variation",
"page_url": "<string>",
"url_match_type": "exact",
"goal": {
"id": "<string>",
"type": "form_submit",
"selector": "<string>",
"url_pattern": "<string>"
},
"traffic_split": 123,
"variants": [
{
"id": "<string>",
"name": "<string>",
"is_control": true,
"weight": 123,
"ops": [
{
"selector": "<string>",
"op": "setText",
"value": "<string>",
"nth": 4503599627370495
}
],
"redirect_url": "<string>"
}
],
"started_at": "<string>",
"completed_at": "<string>",
"shipped_at": "<string>",
"winner_variant_id": "<string>",
"created_at": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}Optimize
Update a website test
Changes a test’s name, hypothesis, page, or traffic split, and starts or pauses it through status. Fields left out are unchanged. Shipped and archived tests cannot be edited.
PATCH
/
v1
/
optimize
/
tests
/
{id}
Update a website test
curl --request PATCH \
--url https://api.revdesk.com/v1/optimize/tests/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"hypothesis": "<string>",
"page_url": "<string>",
"traffic_split": 0.525
}
'import requests
url = "https://api.revdesk.com/v1/optimize/tests/{id}"
payload = {
"name": "<string>",
"hypothesis": "<string>",
"page_url": "<string>",
"traffic_split": 0.525
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
hypothesis: '<string>',
page_url: '<string>',
traffic_split: 0.525
})
};
fetch('https://api.revdesk.com/v1/optimize/tests/{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://api.revdesk.com/v1/optimize/tests/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'hypothesis' => '<string>',
'page_url' => '<string>',
'traffic_split' => 0.525
]),
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.revdesk.com/v1/optimize/tests/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"hypothesis\": \"<string>\",\n \"page_url\": \"<string>\",\n \"traffic_split\": 0.525\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.revdesk.com/v1/optimize/tests/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"hypothesis\": \"<string>\",\n \"page_url\": \"<string>\",\n \"traffic_split\": 0.525\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revdesk.com/v1/optimize/tests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"hypothesis\": \"<string>\",\n \"page_url\": \"<string>\",\n \"traffic_split\": 0.525\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"hypothesis": "<string>",
"status": "draft",
"kind": "variation",
"page_url": "<string>",
"url_match_type": "exact",
"goal": {
"id": "<string>",
"type": "form_submit",
"selector": "<string>",
"url_pattern": "<string>"
},
"traffic_split": 123,
"variants": [
{
"id": "<string>",
"name": "<string>",
"is_control": true,
"weight": 123,
"ops": [
{
"selector": "<string>",
"op": "setText",
"value": "<string>",
"nth": 4503599627370495
}
],
"redirect_url": "<string>"
}
],
"started_at": "<string>",
"completed_at": "<string>",
"shipped_at": "<string>",
"winner_variant_id": "<string>",
"created_at": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"resolution_hint": "<string>",
"fields": {},
"doc_url": "<string>"
}
}Authorizations
Organization-scoped RevDesk API key. Each operation declares its required permissions in x-required-scopes.
Headers
UUID — when present, deduplicates repeat submissions. See /api-reference/idempotency.
Path Parameters
Body
application/json
Response
Success
Show child attributes
Show child attributes