Create experiment
curl --request POST \
--url https://api.pictify.io/experiments/api \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Homepage Hero A/B Test",
"slug": "homepage-hero-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"
}
}
}
],
"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,
"outputConfig": {
"format": "png",
"quality": 90
},
"fallbackImageUrl": "<string>",
"fallbackTemplateUid": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Homepage Hero A/B Test',
slug: 'homepage-hero-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'}
}
}
],
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,
outputConfig: {format: 'png', quality: 90},
fallbackImageUrl: '<string>',
fallbackTemplateUid: '<string>'
})
};
fetch('https://api.pictify.io/experiments/api', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/experiments/api"
payload = {
"name": "Homepage Hero A/B Test",
"slug": "homepage-hero-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"
}
}
}
],
"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,
"outputConfig": {
"format": "png",
"quality": 90
},
"fallbackImageUrl": "<string>",
"fallbackTemplateUid": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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"
payload := strings.NewReader("{\n \"name\": \"Homepage Hero A/B Test\",\n \"slug\": \"homepage-hero-test\",\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 \"templateUid\": \"tmpl_xyz789\",\n \"goalConfig\": {\n \"type\": \"impressions_only\",\n \"destinationUrl\": \"<string>\"\n },\n \"banditConfig\": {\n \"enabled\": false,\n \"algorithm\": \"thompson_sampling\",\n \"warmupImpressions\": 50,\n \"recomputeIntervalMinutes\": 15\n },\n \"hypothesis\": \"<string>\",\n \"minimumSampleSize\": 1000,\n \"confidenceThreshold\": 0.95,\n \"minimumRunDays\": 7,\n \"outputConfig\": {\n \"format\": \"png\",\n \"quality\": 90\n },\n \"fallbackImageUrl\": \"<string>\",\n \"fallbackTemplateUid\": \"<string>\"\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))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/experiments/api")
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 \"name\": \"Homepage Hero A/B Test\",\n \"slug\": \"homepage-hero-test\",\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 \"templateUid\": \"tmpl_xyz789\",\n \"goalConfig\": {\n \"type\": \"impressions_only\",\n \"destinationUrl\": \"<string>\"\n },\n \"banditConfig\": {\n \"enabled\": false,\n \"algorithm\": \"thompson_sampling\",\n \"warmupImpressions\": 50,\n \"recomputeIntervalMinutes\": 15\n },\n \"hypothesis\": \"<string>\",\n \"minimumSampleSize\": 1000,\n \"confidenceThreshold\": 0.95,\n \"minimumRunDays\": 7,\n \"outputConfig\": {\n \"format\": \"png\",\n \"quality\": 90\n },\n \"fallbackImageUrl\": \"<string>\",\n \"fallbackTemplateUid\": \"<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"
}{
"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
Create Experiment
Create a new experiment. Requires at least 2 variants with weights summing to exactly 10000.
Slug must be unique among active experiments, 3-60 characters, lowercase alphanumeric and hyphens. Reserved slugs: events, api, admin, health, status, pixel, track, sdk.
POST
/
experiments
/
api
Create experiment
curl --request POST \
--url https://api.pictify.io/experiments/api \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Homepage Hero A/B Test",
"slug": "homepage-hero-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"
}
}
}
],
"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,
"outputConfig": {
"format": "png",
"quality": 90
},
"fallbackImageUrl": "<string>",
"fallbackTemplateUid": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Homepage Hero A/B Test',
slug: 'homepage-hero-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'}
}
}
],
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,
outputConfig: {format: 'png', quality: 90},
fallbackImageUrl: '<string>',
fallbackTemplateUid: '<string>'
})
};
fetch('https://api.pictify.io/experiments/api', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/experiments/api"
payload = {
"name": "Homepage Hero A/B Test",
"slug": "homepage-hero-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"
}
}
}
],
"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,
"outputConfig": {
"format": "png",
"quality": 90
},
"fallbackImageUrl": "<string>",
"fallbackTemplateUid": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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"
payload := strings.NewReader("{\n \"name\": \"Homepage Hero A/B Test\",\n \"slug\": \"homepage-hero-test\",\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 \"templateUid\": \"tmpl_xyz789\",\n \"goalConfig\": {\n \"type\": \"impressions_only\",\n \"destinationUrl\": \"<string>\"\n },\n \"banditConfig\": {\n \"enabled\": false,\n \"algorithm\": \"thompson_sampling\",\n \"warmupImpressions\": 50,\n \"recomputeIntervalMinutes\": 15\n },\n \"hypothesis\": \"<string>\",\n \"minimumSampleSize\": 1000,\n \"confidenceThreshold\": 0.95,\n \"minimumRunDays\": 7,\n \"outputConfig\": {\n \"format\": \"png\",\n \"quality\": 90\n },\n \"fallbackImageUrl\": \"<string>\",\n \"fallbackTemplateUid\": \"<string>\"\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))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/experiments/api")
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 \"name\": \"Homepage Hero A/B Test\",\n \"slug\": \"homepage-hero-test\",\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 \"templateUid\": \"tmpl_xyz789\",\n \"goalConfig\": {\n \"type\": \"impressions_only\",\n \"destinationUrl\": \"<string>\"\n },\n \"banditConfig\": {\n \"enabled\": false,\n \"algorithm\": \"thompson_sampling\",\n \"warmupImpressions\": 50,\n \"recomputeIntervalMinutes\": 15\n },\n \"hypothesis\": \"<string>\",\n \"minimumSampleSize\": 1000,\n \"confidenceThreshold\": 0.95,\n \"minimumRunDays\": 7,\n \"outputConfig\": {\n \"format\": \"png\",\n \"quality\": 90\n },\n \"fallbackImageUrl\": \"<string>\",\n \"fallbackTemplateUid\": \"<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"
}{
"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
Body
application/json
Experiment name
Maximum string length:
255Example:
"Homepage Hero A/B Test"
Experiment type
Available options:
ab_test, smart_link, scheduled URL-friendly identifier (3-60 chars)
Pattern:
^[a-z0-9][a-z0-9-]{1,58}[a-z0-9]$Example:
"homepage-hero-test"
Variants with weights summing to 10000
Minimum array length:
2Show child attributes
Show child attributes
Default template UID (optional if each variant has its own)
Example:
"tmpl_xyz789"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum string length:
500Show child attributes
Show child attributes
Response
Experiment created
Show child attributes
Show child attributes
⌘I