# Update Autoresponder Draft

Updates name, internal note, labels, UTM campaign name and audience of a follow-up campaign (autoresponder) of any kind; omitted arguments stay. Name, note, labels and UTM name can change in any state; the audience is refused while the follow-up is active. The audience replaces the previous one and needs an explicit mode -- "all_contacts" addresses every active contact; saved audiences do not apply to follow-ups; an omitted includeTagsMatch or excludeTagsMatch means "any"; its own tags (sent, opened, clicked, viewed, converted) cannot be conditions. Subject is update-autoresponder-email, SMS text replace-autoresponder-sms-content, trigger configure-autoresponder-trigger. Sends nothing.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "autoresponderId": {
      "type": "integer",
      "description": "ID of the follow-up to change",
      "minimum": 1
    },
    "name": {
      "type": [
        "null",
        "string"
      ],
      "description": "New name, unique within the account, without HTML; omit to keep",
      "default": null,
      "maxLength": 250
    },
    "notes": {
      "type": [
        "null",
        "string"
      ],
      "description": "Internal note; empty string removes it, omit keeps it",
      "default": null,
      "maxLength": 1000
    },
    "labels": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "default": null
    },
    "utmCampaignName": {
      "type": [
        "null",
        "string"
      ],
      "description": "Campaign name appended to tracked links as utm_campaign, at most 120 characters; empty string restores the account default; omit to keep",
      "default": null,
      "maxLength": 120
    },
    "audience": {
      "type": "object",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "all_contacts",
            "tag_conditions"
          ],
          "description": "\"all_contacts\" (every active contact, no further field) or \"tag_conditions\"."
        },
        "includeTagIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1
          },
          "maxItems": 50,
          "description": "Tags a contact must carry, for \"tag_conditions\"; include and exclude together at most 50."
        },
        "includeTagsMatch": {
          "type": "string",
          "enum": [
            "any",
            "all"
          ],
          "description": "Whether \"any\" required tag is enough or \"all\" are needed; omit for \"any\"."
        },
        "excludeTagIds": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 1
          },
          "maxItems": 50,
          "description": "Tags that keep a contact out, for \"tag_conditions\"; include and exclude together at most 50."
        },
        "excludeTagsMatch": {
          "type": "string",
          "enum": [
            "any",
            "all"
          ],
          "description": "Whether \"any\" excluded tag already excludes or only \"all\" together do; omit for \"any\"."
        }
      },
      "required": [
        "mode"
      ],
      "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": [
    "autoresponderId"
  ],
  "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"
    }
  }
}
```

