# Import Marketing Campaign Template

Imports an automation template from a shared link or catalogue URI, creating paused automations and creating or mapping their tags, fields, emails and outbounds. Sends nothing until activation. Created objects remain without undo; outbound limits, duplicate names or invalid mappings refuse before writing. Read it with get-automation-template first and settle name and mappings with the user.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "templateLink": {
      "type": "string",
      "description": "Template link as shared, or the uri of a catalogue template from search-automation-templates",
      "minLength": 1,
      "maxLength": 2000
    },
    "automationName": {
      "type": [
        "null",
        "string"
      ],
      "description": "Name of the new automation; omitted takes the template name. Smart import only",
      "default": null,
      "minLength": 1,
      "maxLength": 250
    },
    "objectPrefix": {
      "type": [
        "null",
        "string"
      ],
      "description": "Prefix put before the name of every created object; omitted means none. Smart import only",
      "default": null,
      "maxLength": 100
    },
    "metaLabels": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 250
      },
      "default": null
    },
    "mappings": {
      "type": "array",
      "maxItems": 500,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "incomingId"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tag",
              "custom-field",
              "email",
              "outbound"
            ]
          },
          "incomingId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "useExistingId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        }
      },
      "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": [
    "templateLink"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "automationId",
    "automationName",
    "editUrl",
    "created",
    "mapped",
    "failed",
    "notTransferable"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "automationId": {
      "type": "integer"
    },
    "automationName": {
      "type": "string"
    },
    "editUrl": {
      "type": "string"
    },
    "created": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "incomingId",
          "incomingName",
          "id",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "automation",
              "tag",
              "custom-field",
              "email",
              "outbound"
            ]
          },
          "incomingId": {
            "type": "string"
          },
          "incomingName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "mapped": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "incomingId",
          "incomingName",
          "id",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "automation",
              "tag",
              "custom-field",
              "email",
              "outbound"
            ]
          },
          "incomingId": {
            "type": "string"
          },
          "incomingName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "failed": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "incomingId",
          "incomingName",
          "id",
          "name"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "automation",
              "tag",
              "custom-field",
              "email",
              "outbound"
            ]
          },
          "incomingId": {
            "type": "string"
          },
          "incomingName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "notTransferable": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  }
}
```

