# Update SMS Newsletter Draft

Updates name, internal note, labels, UTM campaign name and audience of an SMS newsletter that is a draft, or scheduled and not yet too close to its send date; omitted arguments stay. The audience replaces the previous one and needs an explicit mode -- "all_contacts" addresses every active contact. Text is replace-sms-newsletter-content, provider and sender configure-sms-newsletter-delivery. Sends nothing.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "newsletterId": {
      "type": "integer",
      "description": "ID of the SMS newsletter 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",
            "saved_audience",
            "tag_conditions"
          ],
          "description": "\"all_contacts\" (every active contact, no further field), \"saved_audience\" or \"tag_conditions\"."
        },
        "audienceId": {
          "type": "integer",
          "minimum": 1,
          "description": "ID of the saved audience, for mode \"saved_audience\" only."
        },
        "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."
        },
        "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."
        }
      },
      "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": [
    "newsletterId"
  ],
  "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"
    }
  }
}
```

