{
  "openapi": "3.1.1",
  "info": {
    "title": "Shoplift Public API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://app.shoplift.ai"
    }
  ],
  "paths": {
    "/api/public/v1/custom-audiences": {
      "post": {
        "tags": [
          "Public API"
        ],
        "summary": "Create custom audience",
        "description": "Creates a new custom audience scoped to the store. Audiences can be referenced by ID when creating or updating tests. Names are unique per store (exact match); a duplicate returns 400.",
        "operationId": "createCustomAudience",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAudienceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Public API"
        ],
        "summary": "List custom audiences",
        "description": "Returns all custom audiences created for the store. Does not include built-in default audiences (channel, referer, country).",
        "operationId": "listCustomAudiences",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAudiencesResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tags": {
      "post": {
        "tags": [
          "Public API"
        ],
        "summary": "Create tag",
        "description": "Creates a store tag. Names are unique per store (case-insensitive); a duplicate returns 409.",
        "operationId": "createTag",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTagRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Public API"
        ],
        "summary": "List tags",
        "description": "Returns the store's tag library, ordered by name. Reference a tag's id via `tagIds` when creating or updating a test.",
        "operationId": "listTags",
        "responses": {
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalTagsResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tests": {
      "post": {
        "tags": [
          "Public API"
        ],
        "summary": "Create test",
        "description": "Creates a test in draft state with control and variant configured.",
        "operationId": "createTest",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Public API"
        ],
        "summary": "List tests",
        "description": "Returns paginated tests for the store. Filter by status.",
        "operationId": "listTests",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/NullableOfExternalTestStatus"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalTestListResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tests/{id}": {
      "delete": {
        "tags": [
          "Public API"
        ],
        "summary": "Delete test",
        "description": "Hard-deletes a draft test, or soft-deletes any non-active test (paused, suspended, incompatible, cancelled, or completed). Returns 409 if the test is active.",
        "operationId": "deleteTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Public API"
        ],
        "summary": "Get test",
        "description": "Returns the full test detail by stable public ID.",
        "operationId": "getTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalTestItem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Public API"
        ],
        "summary": "Update test",
        "description": "Partial update of test metadata. After launch, title, hypothesisDescription, controlTitle, variantTitle, priority, surfaceArea, impact, effort, and tagIds remain mutable; implemented becomes mutable once the test has ended. All other fields (goal, device, visitorOption, controlTraffic, audiences, campaignId, variant, scheduling) are locked.",
        "operationId": "updateTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tests/{id}/end": {
      "post": {
        "tags": [
          "Public API"
        ],
        "summary": "End test",
        "description": "Ends an active, paused, suspended, or incompatible test by transitioning it to cancelled.",
        "operationId": "endTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/campaigns/active": {
      "get": {
        "tags": [
          "Public API"
        ],
        "summary": "List active campaigns",
        "description": "Returns all active campaigns for the store.",
        "operationId": "listActiveCampaigns",
        "responses": {
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalActiveCampaignsResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tests/{id}/results": {
      "get": {
        "tags": [
          "Public API"
        ],
        "summary": "Get test results",
        "description": "Returns analytics and statistical significance data for a launched test.",
        "operationId": "getTestResults",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalTestResultsResponse"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tests/{id}/launch": {
      "post": {
        "tags": [
          "Public API"
        ],
        "summary": "Launch test",
        "description": "Transitions a draft test to active. Fails if the test isn't fully configured (missing template, theme, or redirect URL) or its control/variant Shopify template was removed.",
        "operationId": "launchTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tests/{id}/pause": {
      "post": {
        "tags": [
          "Public API"
        ],
        "summary": "Pause test",
        "description": "Transitions an active test to paused.",
        "operationId": "pauseTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/tests/{id}/resume": {
      "post": {
        "tags": [
          "Public API"
        ],
        "summary": "Resume test",
        "description": "Transitions a paused test back to active.",
        "operationId": "resumeTest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "404": {
            "description": "Not Found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "204": {
            "description": "No Content"
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CampaignStatus": {
        "enum": [
          "active",
          "completed"
        ]
      },
      "CreateAudienceRequest": {
        "required": [
          "name",
          "rules"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomAudienceRule"
            }
          }
        },
        "additionalProperties": false
      },
      "CreateTagRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CreateTestControlRequest": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "suffix": {
            "type": "string",
            "default": ""
          },
          "redirectUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "themeId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "CreateTestRequest": {
        "required": [
          "title",
          "type",
          "control",
          "variant",
          "goal",
          "device",
          "visitorOption",
          "controlTraffic",
          "hypothesisDescription",
          "defaultAudiences",
          "customAudienceIds",
          "automaticallyStartAt",
          "automaticallyEndAt"
        ],
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "control": {
            "$ref": "#/components/schemas/CreateTestControlRequest"
          },
          "variant": {
            "$ref": "#/components/schemas/CreateTestVariantRequest"
          },
          "goal": {
            "type": [
              "null",
              "string"
            ]
          },
          "device": {
            "type": [
              "null",
              "string"
            ]
          },
          "visitorOption": {
            "type": [
              "null",
              "string"
            ]
          },
          "controlTraffic": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "hypothesisDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "defaultAudiences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "customAudienceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "automaticallyStartAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "automaticallyEndAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endWhenSignificant": {
            "type": "boolean",
            "default": false
          },
          "campaignId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "surfaceArea": {
            "type": [
              "null",
              "string"
            ]
          },
          "impact": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "effort": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "tagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "additionalProperties": false
      },
      "CreateTestVariantRequest": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "mode": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": "string",
            "default": ""
          },
          "themeId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "redirectUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "granular": {
            "type": "boolean",
            "default": false
          }
        },
        "additionalProperties": false
      },
      "CustomAudienceRule": {
        "required": [
          "dimension",
          "operator",
          "values"
        ],
        "type": "object",
        "properties": {
          "dimension": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "selector": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "additionalProperties": false
      },
      "ExperienceStage": {
        "enum": [
          "idea",
          "ready",
          "scheduled",
          "live",
          "paused",
          "ended"
        ]
      },
      "ExternalActiveCampaignsResponse": {
        "required": [
          "campaigns"
        ],
        "type": "object",
        "properties": {
          "campaigns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalCampaignItem"
            }
          }
        }
      },
      "ExternalAudienceItem": {
        "required": [
          "id",
          "name",
          "rules"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalAudienceRuleItem"
            }
          }
        }
      },
      "ExternalAudienceRuleItem": {
        "required": [
          "dimension",
          "operator",
          "values"
        ],
        "type": "object",
        "properties": {
          "dimension": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "selector": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ExternalAudiencesResponse": {
        "required": [
          "customAudiences"
        ],
        "type": "object",
        "properties": {
          "customAudiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalAudienceItem"
            }
          }
        }
      },
      "ExternalCampaignItem": {
        "required": [
          "id",
          "name",
          "objective",
          "goal",
          "status",
          "createdAt",
          "progress"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "objective": {
            "type": [
              "null",
              "string"
            ]
          },
          "goal": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NullableOfCampaignGoal"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/CampaignStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "progress": {
            "$ref": "#/components/schemas/ExternalCampaignProgress"
          }
        }
      },
      "ExternalCampaignProgress": {
        "required": [
          "total",
          "live",
          "paused",
          "draft",
          "ended"
        ],
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "format": "int32"
          },
          "live": {
            "type": "integer",
            "format": "int32"
          },
          "paused": {
            "type": "integer",
            "format": "int32"
          },
          "draft": {
            "type": "integer",
            "format": "int32"
          },
          "ended": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ExternalCampaignRef": {
        "required": [
          "id",
          "name",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/CampaignStatus"
          }
        }
      },
      "ExternalDailyEntry": {
        "required": [
          "performance"
        ],
        "type": "object",
        "properties": {
          "performance": {
            "$ref": "#/components/schemas/ExternalDailyPerformance"
          }
        }
      },
      "ExternalDailyPerformance": {
        "required": [
          "control",
          "variant"
        ],
        "type": "object",
        "properties": {
          "control": {
            "$ref": "#/components/schemas/ExternalTestSideStats"
          },
          "variant": {
            "$ref": "#/components/schemas/ExternalTestSideStats"
          }
        }
      },
      "ExternalDefaultAudienceItem": {
        "required": [
          "id",
          "name",
          "dimension",
          "operator",
          "value"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "dimension": {
            "type": "string"
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "ExternalLiftByMetric": {
        "required": [
          "value"
        ],
        "type": "object",
        "properties": {
          "value": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "ExternalPaginationMeta": {
        "required": [
          "page",
          "perPage",
          "totalPages",
          "totalCount"
        ],
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "perPage": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ExternalTagItem": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "ExternalTagsResponse": {
        "required": [
          "tags"
        ],
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalTagItem"
            }
          }
        }
      },
      "ExternalTestControlItem": {
        "required": [
          "id",
          "type",
          "suffix",
          "themeId",
          "redirectUrl",
          "screenshotUrl",
          "title",
          "traffic"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "suffix": {
            "type": "string"
          },
          "themeId": {
            "type": "integer",
            "format": "int64"
          },
          "redirectUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "screenshotUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "traffic": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ExternalTestItem": {
        "required": [
          "id",
          "title",
          "control",
          "variant",
          "status",
          "goal",
          "device",
          "visitorOption",
          "hypothesisDescription",
          "campaign",
          "handle",
          "duration",
          "period",
          "createdAt",
          "updatedAt",
          "startAt",
          "endAt",
          "appliedAt",
          "automaticallyStartAt",
          "automaticallyEndAt",
          "automaticallyPauseAt",
          "automaticallyResumeAt",
          "endWhenSignificant",
          "estimatedCompletionDate",
          "customAudiences",
          "defaultAudiences",
          "stage",
          "tags",
          "priority",
          "surfaceArea",
          "impact",
          "effort",
          "implemented"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "control": {
            "$ref": "#/components/schemas/ExternalTestControlItem"
          },
          "variant": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalTestVariantItem"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ExternalTestStatus"
          },
          "goal": {
            "type": "string"
          },
          "device": {
            "type": "string"
          },
          "visitorOption": {
            "type": "string"
          },
          "hypothesisDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "campaign": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalCampaignRef"
              }
            ]
          },
          "handle": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "period": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "startAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "appliedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "automaticallyStartAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "automaticallyEndAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "automaticallyPauseAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "automaticallyResumeAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endWhenSignificant": {
            "type": "boolean"
          },
          "estimatedCompletionDate": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "customAudiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalAudienceItem"
            }
          },
          "defaultAudiences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalDefaultAudienceItem"
            }
          },
          "stage": {
            "$ref": "#/components/schemas/ExperienceStage"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalTagItem"
            }
          },
          "priority": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NullableOfPriority"
              }
            ]
          },
          "surfaceArea": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NullableOfSurfaceArea"
              }
            ]
          },
          "impact": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "effort": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "implemented": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "ExternalTestListResponse": {
        "required": [
          "data",
          "pagination"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalTestItem"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/ExternalPaginationMeta"
          }
        }
      },
      "ExternalTestResultsResponse": {
        "required": [
          "id",
          "status",
          "totalSessions",
          "controlSplit",
          "variantSplit",
          "winner",
          "bayesianModelStatus",
          "bayesianModelTrend",
          "hasSufficientSamples",
          "progress",
          "lift",
          "changeRevenue",
          "controlProbabilityWin",
          "variantProbabilityWin",
          "liftByMetric",
          "control",
          "variant",
          "daily"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/ExternalTestStatus"
          },
          "totalSessions": {
            "type": "integer",
            "format": "int32"
          },
          "controlSplit": {
            "type": "integer",
            "format": "int32"
          },
          "variantSplit": {
            "type": "integer",
            "format": "int32"
          },
          "winner": {
            "type": [
              "null",
              "string"
            ]
          },
          "bayesianModelStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "bayesianModelTrend": {
            "type": [
              "null",
              "string"
            ]
          },
          "hasSufficientSamples": {
            "type": "boolean"
          },
          "progress": {
            "type": "number",
            "format": "float"
          },
          "lift": {
            "type": "number",
            "format": "float"
          },
          "changeRevenue": {
            "type": "number",
            "format": "float"
          },
          "controlProbabilityWin": {
            "type": "number",
            "format": "float"
          },
          "variantProbabilityWin": {
            "type": "number",
            "format": "float"
          },
          "liftByMetric": {
            "$ref": "#/components/schemas/IReadOnlyDictionaryOfInt32AndExternalLiftByMetric"
          },
          "control": {
            "$ref": "#/components/schemas/ExternalTestSideStats"
          },
          "variant": {
            "$ref": "#/components/schemas/ExternalTestSideStats"
          },
          "daily": {
            "$ref": "#/components/schemas/IReadOnlyDictionaryOfStringAndExternalDailyEntry"
          }
        }
      },
      "ExternalTestSideStats": {
        "required": [
          "visitors",
          "visits",
          "clicks",
          "carts",
          "conversions",
          "orders",
          "totalOrders",
          "totalConversions",
          "initialSubscriptionConversions",
          "initialSubscriptionOrders",
          "initialSubscriptionRevenue",
          "cnv",
          "aov",
          "rps",
          "ctr",
          "acr",
          "revenue",
          "totalRevenue",
          "mobile",
          "desktop",
          "new",
          "returning"
        ],
        "type": "object",
        "properties": {
          "visitors": {
            "type": "integer",
            "format": "int32"
          },
          "visits": {
            "type": "integer",
            "format": "int32"
          },
          "clicks": {
            "type": "integer",
            "format": "int32"
          },
          "carts": {
            "type": "integer",
            "format": "int32"
          },
          "conversions": {
            "type": "integer",
            "format": "int32"
          },
          "orders": {
            "type": "integer",
            "format": "int32"
          },
          "totalOrders": {
            "type": "integer",
            "format": "int32"
          },
          "totalConversions": {
            "type": "integer",
            "format": "int32"
          },
          "initialSubscriptionConversions": {
            "type": "integer",
            "format": "int32"
          },
          "initialSubscriptionOrders": {
            "type": "integer",
            "format": "int32"
          },
          "initialSubscriptionRevenue": {
            "type": "number",
            "format": "double"
          },
          "cnv": {
            "type": "number",
            "format": "double"
          },
          "aov": {
            "type": "number",
            "format": "double"
          },
          "rps": {
            "type": "number",
            "format": "double"
          },
          "ctr": {
            "type": "number",
            "format": "double"
          },
          "acr": {
            "type": "number",
            "format": "double"
          },
          "revenue": {
            "type": "number",
            "format": "double"
          },
          "totalRevenue": {
            "type": "number",
            "format": "double"
          },
          "mobile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalTestSideStats"
              }
            ]
          },
          "desktop": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalTestSideStats"
              }
            ]
          },
          "new": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalTestSideStats"
              }
            ]
          },
          "returning": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ExternalTestSideStats"
              }
            ]
          }
        }
      },
      "ExternalTestStatus": {
        "enum": [
          "draft",
          "scheduled",
          "active",
          "paused",
          "suspended",
          "incompatible",
          "cancelled",
          "completed"
        ]
      },
      "ExternalTestVariantItem": {
        "required": [
          "id",
          "type",
          "suffix",
          "themeId",
          "redirectUrl",
          "screenshotUrl",
          "title",
          "traffic"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "suffix": {
            "type": "string"
          },
          "themeId": {
            "type": "integer",
            "format": "int64"
          },
          "redirectUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "screenshotUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "traffic": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "IdResponse": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "IReadOnlyDictionaryOfInt32AndExternalLiftByMetric": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/ExternalLiftByMetric"
        }
      },
      "IReadOnlyDictionaryOfStringAndExternalDailyEntry": {
        "type": "object",
        "additionalProperties": {
          "$ref": "#/components/schemas/ExternalDailyEntry"
        }
      },
      "NullableOfCampaignGoal": {
        "enum": [
          "aov",
          "cvr",
          "rpv",
          "ctr",
          "atc",
          null
        ]
      },
      "NullableOfExternalTestStatus": {
        "enum": [
          "draft",
          "scheduled",
          "active",
          "paused",
          "suspended",
          "incompatible",
          "cancelled",
          "completed",
          null
        ]
      },
      "NullableOfPriority": {
        "enum": [
          "low",
          "medium",
          "high",
          "critical",
          null
        ]
      },
      "NullableOfSurfaceArea": {
        "enum": [
          "global",
          "homepage",
          "pdp",
          "plp",
          "cart",
          "landingPage",
          "navigation",
          "other",
          null
        ]
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateTestRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "hypothesisDescription": {
            "type": [
              "null",
              "string"
            ]
          },
          "controlTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "variantTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "goal": {
            "type": [
              "null",
              "string"
            ]
          },
          "device": {
            "type": [
              "null",
              "string"
            ]
          },
          "visitorOption": {
            "type": [
              "null",
              "string"
            ]
          },
          "controlTraffic": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "defaultAudiences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "customAudienceIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "campaignId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "variant": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UpdateTestVariantRequest"
              }
            ]
          },
          "automaticallyStartAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "automaticallyEndAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "endWhenSignificant": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "priority": {
            "type": [
              "null",
              "string"
            ]
          },
          "surfaceArea": {
            "type": [
              "null",
              "string"
            ]
          },
          "impact": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "effort": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "implemented": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "tagIds": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "additionalProperties": false
      },
      "UpdateTestVariantRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": [
              "null",
              "string"
            ]
          },
          "source": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "themeId": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int64"
          },
          "redirectUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "granular": {
            "type": [
              "null",
              "boolean"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "description": "All requests require `Authorization: Bearer sl_live_<your_api_key>`. Generate a key from the Shoplift admin's API Keys settings page.",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Public API"
    }
  ]
}