# Create SMS Newsletter Draft

Creates an SMS newsletter draft with an empty SMS and no send date, so it reaches nobody. The audience starts unfiltered (every active contact with a phone number once sent); set it with update-sms-newsletter-draft, the text with replace-sms-newsletter-content, provider and sender with configure-sms-newsletter-delivery. splitTest makes it a split test, which only creation can decide; variants use the sms-newsletter-split-test tools. Needs the SMS marketing permission.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name, unique within the account, at most 250 characters, without HTML",
      "minLength": 1,
      "maxLength": 250
    },
    "notes": {
      "type": [
        "null",
        "string"
      ],
      "description": "Internal note, at most 1000 characters; omit for none",
      "default": null,
      "maxLength": 1000
    },
    "splitTest": {
      "type": "object",
      "properties": {
        "testSizePercent": {
          "type": "integer",
          "minimum": 2,
          "maximum": 98,
          "description": "Share of the audience the variants are sent to before the winner takes the rest."
        },
        "testDurationHours": {
          "type": "integer",
          "minimum": 1,
          "maximum": 27777,
          "description": "Measuring period before the winner is chosen."
        },
        "winnerBy": {
          "type": "string",
          "enum": [
            "opens",
            "clicks",
            "conversions",
            "revenue"
          ],
          "description": "\"opens\" (email only), \"clicks\", \"conversions\" or \"revenue\" (both need the conversion pixel)."
        }
      },
      "required": [
        "testSizePercent",
        "testDurationHours",
        "winnerBy"
      ],
      "additionalProperties": false,
      "default": null
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account of the access token",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "newsletterId",
    "name",
    "notes",
    "labels",
    "status",
    "isSplitTest",
    "sms",
    "audience",
    "sendAt",
    "missingForDispatch",
    "editUrl",
    "scheduleUrl",
    "statisticsUrl"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "newsletterId": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "scheduled",
        "outgoing",
        "sent"
      ]
    },
    "isSplitTest": {
      "type": "boolean"
    },
    "sms": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "smsId",
        "text",
        "senderName",
        "provider",
        "linkTracking",
        "contentUrl"
      ],
      "properties": {
        "smsId": {
          "type": "integer"
        },
        "text": {
          "type": "string"
        },
        "senderName": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "linkTracking": {
          "type": "boolean"
        },
        "contentUrl": {
          "type": "string"
        }
      }
    },
    "audience": {
      "type": "object",
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "all_contacts",
            "saved_audience",
            "tag_conditions"
          ]
        }
      },
      "additionalProperties": true
    },
    "sendAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "missingForDispatch": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "editUrl": {
      "type": "string"
    },
    "scheduleUrl": {
      "type": "string"
    },
    "statisticsUrl": {
      "type": "string"
    }
  }
}
```

