# Add Split Test Variant

Adds an email newsletter split-test variant, empty or copied from copyFromEmailId. Returns all variants and their editor URLs; audience shares are redistributed evenly. A test needs at least two variants to send. Refused after the test starts; sends nothing.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "campaignId": {
      "type": "integer",
      "description": "ID of the split test campaign (a newsletter ID)",
      "minimum": 1
    },
    "copyFromEmailId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "Email ID of the variant to copy, from splitTestVariants; omit for an empty variant",
      "default": null,
      "minimum": 1
    },
    "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"
    }
  }
}
```

