Skip to main content
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",
  "type": "ab_test",
  "slug": "homepage-hero-test",
  "variants": [
    {
      "id": "variant-a",
      "weight": 5000,
      "name": "New Design",
      "templateUid": "<string>",
      "variables": {},
      "isDefault": false,
      "conditions": {
        "type": "group",
        "operator": "AND",
        "children": "<array>",
        "property": "<string>",
        "ruleOperator": "equals",
        "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>"
}
'
{
  "experiment": {
    "uid": "exp_abc123",
    "slug": "homepage-hero-test",
    "type": "ab_test",
    "name": "Homepage Hero A/B Test",
    "status": "draft",
    "variants": [
      {
        "id": "variant-a",
        "weight": 5000,
        "name": "New Design",
        "templateUid": "<string>",
        "variables": {},
        "isDefault": false,
        "conditions": {
          "type": "group",
          "operator": "AND",
          "children": "<array>",
          "property": "<string>",
          "ruleOperator": "equals",
          "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
    }
  }
}

Authorizations

Authorization
string
header
required

API key obtained from the Pictify dashboard

Body

application/json
name
string
required

Experiment name

Maximum string length: 255
Example:

"Homepage Hero A/B Test"

type
enum<string>
required

Experiment type

Available options:
ab_test,
smart_link,
scheduled
slug
string
required

URL-friendly identifier (3-60 chars)

Pattern: ^[a-z0-9][a-z0-9-]{1,58}[a-z0-9]$
Example:

"homepage-hero-test"

variants
object[]
required

Variants with weights summing to 10000

Minimum array length: 2
templateUid
string

Default template UID (optional if each variant has its own)

Example:

"tmpl_xyz789"

goalConfig
object
banditConfig
object
hypothesis
string
Maximum string length: 500
minimumSampleSize
integer
default:1000
confidenceThreshold
number
default:0.95
minimumRunDays
integer
default:7
outputConfig
object
fallbackImageUrl
string<uri>
fallbackTemplateUid
string

Response

Experiment created

experiment
object