# Configure Split Test

Configures an email newsletter split test's audience share, measuring period and winner criterion. Omitted settings stay unchanged. Conversions and revenue require the conversion pixel; opens and clicks do not. Refused after the test starts; sends nothing.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "campaignId": {
      "type": "integer",
      "description": "ID of the split test campaign whose settings to write",
      "minimum": 1
    },
    "testSizePercent": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Share of the audience the variants go to, 2 to 98; omit to keep",
      "default": null,
      "minimum": 2,
      "maximum": 98
    },
    "testDurationHours": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Measuring period before the winner goes to the rest, 1 to 27777 hours; omit to keep",
      "default": null,
      "minimum": 1,
      "maximum": 27777
    },
    "winnerBy": {
      "type": [
        "null",
        "string"
      ],
      "description": "\"opens\" (open rate), \"clicks\" (unique clicks), \"conversions\" or \"revenue\" (both need the conversion pixel); omit to keep",
      "default": null,
      "enum": [
        "opens",
        "clicks",
        "conversions",
        "revenue"
      ]
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "campaignId"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "newsletterId",
    "variants",
    "variantCount",
    "needsMoreVariants",
    "sharePerVariantPercent",
    "testSizePercent",
    "testDurationHours",
    "winnerBy",
    "hasStarted"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "newsletterId": {
      "type": "integer"
    },
    "variants": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "emailId",
          "label",
          "name",
          "subject",
          "editorUrl",
          "contentRevision"
        ],
        "properties": {
          "emailId": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "editorUrl": {
            "type": "string"
          },
          "contentRevision": {
            "type": "string"
          }
        }
      }
    },
    "variantCount": {
      "type": "integer"
    },
    "needsMoreVariants": {
      "type": "boolean"
    },
    "sharePerVariantPercent": {
      "type": "integer"
    },
    "testSizePercent": {
      "type": "integer"
    },
    "testDurationHours": {
      "type": "integer"
    },
    "winnerBy": {
      "type": [
        "string",
        "null"
      ]
    },
    "hasStarted": {
      "type": "boolean"
    }
  }
}
```

