# Create Autoresponder SMS Draft

Creates an inactive SMS follow-up draft with empty text and an unfiltered audience. By default it sends once immediately after entry when activated; birthday mode needs a date field and time. Set the audience with update-autoresponder-draft, the text with replace-autoresponder-sms-content and the delay with configure-autoresponder-trigger. splitTest makes it a split test, which only creation can decide. Requires SMS marketing; sends nothing.

## 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
    },
    "birthday": {
      "type": "boolean",
      "description": "true for a birthday follow-up, which goes out on each contact's birthday instead of after a delay",
      "default": false
    },
    "birthdayFieldId": {
      "type": [
        "null",
        "string"
      ],
      "description": "Required when birthday is true, forbidden otherwise: ID of the date field holding the birthday, from search-custom-fields",
      "default": null,
      "minLength": 1,
      "maxLength": 100
    },
    "birthdayTime": {
      "type": [
        "null",
        "string"
      ],
      "description": "Required when birthday is true, forbidden otherwise: time of day \"HH:MM\" it goes out on the birthday",
      "default": null,
      "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]$"
    },
    "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",
    "autoresponderId",
    "kind",
    "name",
    "notes",
    "labels",
    "status",
    "isSplitTest",
    "email",
    "sms",
    "trigger",
    "audience",
    "missingForActivation",
    "editUrl",
    "scheduleUrl",
    "statisticsUrl"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "autoresponderId": {
      "type": "integer"
    },
    "kind": {
      "type": "string",
      "enum": [
        "email",
        "sms",
        "birthday-email",
        "birthday-sms"
      ]
    },
    "name": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "paused",
        "scheduled",
        "active"
      ]
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "isSplitTest": {
      "type": "boolean"
    },
    "email": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "emailId",
        "subject",
        "preheader",
        "reportSpamHeader",
        "editorUrl",
        "contentUrl"
      ],
      "properties": {
        "emailId": {
          "type": "integer"
        },
        "subject": {
          "type": "string"
        },
        "preheader": {
          "type": [
            "string",
            "null"
          ]
        },
        "reportSpamHeader": {
          "type": "boolean"
        },
        "editorUrl": {
          "type": "string"
        },
        "contentUrl": {
          "type": "string"
        }
      }
    },
    "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"
        }
      }
    },
    "trigger": {
      "type": "object",
      "required": [
        "delayUnit",
        "delayValue",
        "dateFieldId",
        "weekdays",
        "sendAtTime",
        "birthdayFieldId",
        "birthdayTime",
        "repeat",
        "repeatTagIds"
      ],
      "properties": {
        "delayUnit": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "immediately",
            "seconds",
            "minutes",
            "hours",
            "days",
            "weeks",
            "months",
            "custom-field",
            null
          ]
        },
        "delayValue": {
          "type": [
            "integer",
            "null"
          ]
        },
        "dateFieldId": {
          "type": [
            "string",
            "null"
          ]
        },
        "weekdays": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "integer"
          }
        },
        "sendAtTime": {
          "type": [
            "string",
            "null"
          ]
        },
        "birthdayFieldId": {
          "type": [
            "string",
            "null"
          ]
        },
        "birthdayTime": {
          "type": [
            "string",
            "null"
          ]
        },
        "repeat": {
          "type": "boolean"
        },
        "repeatTagIds": {
          "type": "array",
          "items": {
            "type": "integer"
          }
        }
      }
    },
    "audience": {
      "type": "object",
      "required": [
        "mode"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "all_contacts",
            "saved_audience",
            "tag_conditions"
          ]
        }
      },
      "additionalProperties": true
    },
    "missingForActivation": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "editUrl": {
      "type": "string"
    },
    "scheduleUrl": {
      "type": "string"
    },
    "statisticsUrl": {
      "type": "string"
    }
  }
}
```

