Update experiment
curl --request PUT \
--url https://api.pictify.io/experiments/api/{uid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"variants": [
{
"id": "variant-a",
"weight": 5000,
"name": "New Design",
"templateUid": "<string>",
"variables": {},
"isDefault": false,
"conditions": {
"children": "<array>",
"property": "<string>",
"value": "<unknown>"
},
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"recurrence": {
"type": "none",
"cronExpression": "<string>",
"timezone": "America/New_York"
}
}
}
],
"goalConfig": {},
"banditConfig": {},
"hypothesis": "<string>",
"confidenceThreshold": 123,
"minimumRunDays": 123,
"outputConfig": {},
"fallbackImageUrl": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
variants: [
{
id: 'variant-a',
weight: 5000,
name: 'New Design',
templateUid: '<string>',
variables: {},
isDefault: false,
conditions: {children: '<array>', property: '<string>', value: '<unknown>'},
schedule: {
startAt: '2023-11-07T05:31:56Z',
endAt: '2023-11-07T05:31:56Z',
recurrence: {type: 'none', cronExpression: '<string>', timezone: 'America/New_York'}
}
}
],
goalConfig: {},
banditConfig: {},
hypothesis: '<string>',
confidenceThreshold: 123,
minimumRunDays: 123,
outputConfig: {},
fallbackImageUrl: '<string>'
})
};
fetch('https://api.pictify.io/experiments/api/{uid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/experiments/api/{uid}"
payload = {
"name": "<string>",
"slug": "<string>",
"variants": [
{
"id": "variant-a",
"weight": 5000,
"name": "New Design",
"templateUid": "<string>",
"variables": {},
"isDefault": False,
"conditions": {
"children": "<array>",
"property": "<string>",
"value": "<unknown>"
},
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"recurrence": {
"type": "none",
"cronExpression": "<string>",
"timezone": "America/New_York"
}
}
}
],
"goalConfig": {},
"banditConfig": {},
"hypothesis": "<string>",
"confidenceThreshold": 123,
"minimumRunDays": 123,
"outputConfig": {},
"fallbackImageUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/experiments/api/{uid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"variants\": [\n {\n \"id\": \"variant-a\",\n \"weight\": 5000,\n \"name\": \"New Design\",\n \"templateUid\": \"<string>\",\n \"variables\": {},\n \"isDefault\": false,\n \"conditions\": {\n \"children\": \"<array>\",\n \"property\": \"<string>\",\n \"value\": \"<unknown>\"\n },\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"endAt\": \"2023-11-07T05:31:56Z\",\n \"recurrence\": {\n \"type\": \"none\",\n \"cronExpression\": \"<string>\",\n \"timezone\": \"America/New_York\"\n }\n }\n }\n ],\n \"goalConfig\": {},\n \"banditConfig\": {},\n \"hypothesis\": \"<string>\",\n \"confidenceThreshold\": 123,\n \"minimumRunDays\": 123,\n \"outputConfig\": {},\n \"fallbackImageUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/experiments/api/{uid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"variants\": [\n {\n \"id\": \"variant-a\",\n \"weight\": 5000,\n \"name\": \"New Design\",\n \"templateUid\": \"<string>\",\n \"variables\": {},\n \"isDefault\": false,\n \"conditions\": {\n \"children\": \"<array>\",\n \"property\": \"<string>\",\n \"value\": \"<unknown>\"\n },\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"endAt\": \"2023-11-07T05:31:56Z\",\n \"recurrence\": {\n \"type\": \"none\",\n \"cronExpression\": \"<string>\",\n \"timezone\": \"America/New_York\"\n }\n }\n }\n ],\n \"goalConfig\": {},\n \"banditConfig\": {},\n \"hypothesis\": \"<string>\",\n \"confidenceThreshold\": 123,\n \"minimumRunDays\": 123,\n \"outputConfig\": {},\n \"fallbackImageUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"experiment": {
"uid": "exp_abc123",
"slug": "homepage-hero-test",
"name": "Homepage Hero A/B Test",
"variants": [
{
"id": "variant-a",
"weight": 5000,
"name": "New Design",
"templateUid": "<string>",
"variables": {},
"isDefault": false,
"conditions": {
"children": "<array>",
"property": "<string>",
"value": "<unknown>"
},
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"recurrence": {
"type": "none",
"cronExpression": "<string>",
"timezone": "America/New_York"
}
},
"impressions": 123,
"clicks": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"templateUid": "tmpl_xyz789",
"goalConfig": {
"type": "impressions_only",
"destinationUrl": "<string>"
},
"banditConfig": {
"enabled": false,
"algorithm": "thompson_sampling",
"warmupImpressions": 50,
"recomputeIntervalMinutes": 15
},
"hypothesis": "<string>",
"minimumSampleSize": 1000,
"confidenceThreshold": 0.95,
"minimumRunDays": 7,
"winnerVariantId": "<string>",
"winnerDeclaredAt": "2023-11-07T05:31:56Z",
"fallbackImageUrl": "<string>",
"outputConfig": {
"format": "png",
"quality": 90
}
}
}{
"type": "https://docs.pictify.io/errors/invalid-api-key",
"title": "Invalid API Key",
"status": 401,
"detail": "The provided API key is invalid or has been revoked.",
"instance": "/image"
}{
"type": "https://docs.pictify.io/errors/invalid-api-key",
"title": "Invalid API Key",
"status": 401,
"detail": "The provided API key is invalid or has been revoked.",
"instance": "/image"
}Experiments
Update Experiment
Update an experiment. Available fields depend on the current status:
- draft/paused: All fields can be updated
- running: Only name, confidenceThreshold, minimumRunDays, goalConfig.destinationUrl
- completed: Only name
PUT
/
experiments
/
api
/
{uid}
Update experiment
curl --request PUT \
--url https://api.pictify.io/experiments/api/{uid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"variants": [
{
"id": "variant-a",
"weight": 5000,
"name": "New Design",
"templateUid": "<string>",
"variables": {},
"isDefault": false,
"conditions": {
"children": "<array>",
"property": "<string>",
"value": "<unknown>"
},
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"recurrence": {
"type": "none",
"cronExpression": "<string>",
"timezone": "America/New_York"
}
}
}
],
"goalConfig": {},
"banditConfig": {},
"hypothesis": "<string>",
"confidenceThreshold": 123,
"minimumRunDays": 123,
"outputConfig": {},
"fallbackImageUrl": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
slug: '<string>',
variants: [
{
id: 'variant-a',
weight: 5000,
name: 'New Design',
templateUid: '<string>',
variables: {},
isDefault: false,
conditions: {children: '<array>', property: '<string>', value: '<unknown>'},
schedule: {
startAt: '2023-11-07T05:31:56Z',
endAt: '2023-11-07T05:31:56Z',
recurrence: {type: 'none', cronExpression: '<string>', timezone: 'America/New_York'}
}
}
],
goalConfig: {},
banditConfig: {},
hypothesis: '<string>',
confidenceThreshold: 123,
minimumRunDays: 123,
outputConfig: {},
fallbackImageUrl: '<string>'
})
};
fetch('https://api.pictify.io/experiments/api/{uid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/experiments/api/{uid}"
payload = {
"name": "<string>",
"slug": "<string>",
"variants": [
{
"id": "variant-a",
"weight": 5000,
"name": "New Design",
"templateUid": "<string>",
"variables": {},
"isDefault": False,
"conditions": {
"children": "<array>",
"property": "<string>",
"value": "<unknown>"
},
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"recurrence": {
"type": "none",
"cronExpression": "<string>",
"timezone": "America/New_York"
}
}
}
],
"goalConfig": {},
"banditConfig": {},
"hypothesis": "<string>",
"confidenceThreshold": 123,
"minimumRunDays": 123,
"outputConfig": {},
"fallbackImageUrl": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/experiments/api/{uid}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"variants\": [\n {\n \"id\": \"variant-a\",\n \"weight\": 5000,\n \"name\": \"New Design\",\n \"templateUid\": \"<string>\",\n \"variables\": {},\n \"isDefault\": false,\n \"conditions\": {\n \"children\": \"<array>\",\n \"property\": \"<string>\",\n \"value\": \"<unknown>\"\n },\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"endAt\": \"2023-11-07T05:31:56Z\",\n \"recurrence\": {\n \"type\": \"none\",\n \"cronExpression\": \"<string>\",\n \"timezone\": \"America/New_York\"\n }\n }\n }\n ],\n \"goalConfig\": {},\n \"banditConfig\": {},\n \"hypothesis\": \"<string>\",\n \"confidenceThreshold\": 123,\n \"minimumRunDays\": 123,\n \"outputConfig\": {},\n \"fallbackImageUrl\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/experiments/api/{uid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"variants\": [\n {\n \"id\": \"variant-a\",\n \"weight\": 5000,\n \"name\": \"New Design\",\n \"templateUid\": \"<string>\",\n \"variables\": {},\n \"isDefault\": false,\n \"conditions\": {\n \"children\": \"<array>\",\n \"property\": \"<string>\",\n \"value\": \"<unknown>\"\n },\n \"schedule\": {\n \"startAt\": \"2023-11-07T05:31:56Z\",\n \"endAt\": \"2023-11-07T05:31:56Z\",\n \"recurrence\": {\n \"type\": \"none\",\n \"cronExpression\": \"<string>\",\n \"timezone\": \"America/New_York\"\n }\n }\n }\n ],\n \"goalConfig\": {},\n \"banditConfig\": {},\n \"hypothesis\": \"<string>\",\n \"confidenceThreshold\": 123,\n \"minimumRunDays\": 123,\n \"outputConfig\": {},\n \"fallbackImageUrl\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"experiment": {
"uid": "exp_abc123",
"slug": "homepage-hero-test",
"name": "Homepage Hero A/B Test",
"variants": [
{
"id": "variant-a",
"weight": 5000,
"name": "New Design",
"templateUid": "<string>",
"variables": {},
"isDefault": false,
"conditions": {
"children": "<array>",
"property": "<string>",
"value": "<unknown>"
},
"schedule": {
"startAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"recurrence": {
"type": "none",
"cronExpression": "<string>",
"timezone": "America/New_York"
}
},
"impressions": 123,
"clicks": 123
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"templateUid": "tmpl_xyz789",
"goalConfig": {
"type": "impressions_only",
"destinationUrl": "<string>"
},
"banditConfig": {
"enabled": false,
"algorithm": "thompson_sampling",
"warmupImpressions": 50,
"recomputeIntervalMinutes": 15
},
"hypothesis": "<string>",
"minimumSampleSize": 1000,
"confidenceThreshold": 0.95,
"minimumRunDays": 7,
"winnerVariantId": "<string>",
"winnerDeclaredAt": "2023-11-07T05:31:56Z",
"fallbackImageUrl": "<string>",
"outputConfig": {
"format": "png",
"quality": 90
}
}
}{
"type": "https://docs.pictify.io/errors/invalid-api-key",
"title": "Invalid API Key",
"status": 401,
"detail": "The provided API key is invalid or has been revoked.",
"instance": "/image"
}{
"type": "https://docs.pictify.io/errors/invalid-api-key",
"title": "Invalid API Key",
"status": 401,
"detail": "The provided API key is invalid or has been revoked.",
"instance": "/image"
}Authorizations
API key obtained from the Pictify dashboard
Path Parameters
Body
application/json
Response
Experiment updated
Show child attributes
Show child attributes
⌘I