Our API

The Campaign Monitor API opens up a world of possibilities for integrating our platform with your favorite CMS, blog, or other third party software.

You're currently veiwing the docs for version 3.2, which is no longer the most up to date API version. Click here for the most up-to-date docs.

Templates

Templates make it easy for your clients to send great looking emails by just adding their own content. The API allows you to easily create, updating and delete any number of templates for each client in your account.

Getting a template

Get https://api.createsend.com/api/v3.2/templates/{templateid}.{xml|json}

Returns all the basic details for a specific template including the name, ID, preview URL and screenshot URL.

  • TemplateID The ID of the template to be retrieved.
Expected response: JSONXML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "TemplateID": "5cac213cf061dd4e008de5a82b7a3621",
    "Name": "Template One",
    "PreviewURL": "https://preview.createsend.com/templates/publicpreview/01AF532CD8889B33?d=r",
    "ScreenshotURL": "https://preview.createsend.com/ts/r/14/833/263/14833263.jpg?0318092600"
}
Error responses:

Please see our response status codes documentation for details of potential error responses for any API request.

Creating a template

Post https://api.createsend.com/api/v3.2/templates/{clientid}.{xml|json}

Adds a new template for an existing client by providing the name of the template and URLs for the HTML file and a zip of all other files.

  • ClientID The ID of the client for whom the template should be created.
Expected request: JSONXML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "Name": "Template Two",
    "HtmlPageURL": "http://example.com/index.html",
    "ZipFileURL": "http://example.com/files.zip"
}

Response
Contains the ID of the template which has been created.

Expected response: JSONXML
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

"aa164e9c8ab0471294fe6148fc9cf634"
Error responses:

Please see our response status codes documentation for details of potential error responses for any API request.

If you receive a 400 Bad Request response for this request, these are the possible errors which may be included in the body of the response:

  • 4002: Template Name Required The template name passed cannot be empty.
  • 4003: Invalid Template Name The template name entered is invalid.
  • 4004: HTML Page URL Required The URL to your HTML page for the template cannot be empty.
  • 4005: Invalid HTML Page URL You must provide a valid URL to your HTML page for the template.
  • 4006: Invalid ZIP File URL The URL of the zip file you have passed is invalid.
  • 4101: No Editable Region in Template You need have at least one <singleline />, <multiline /> or <img editable="true" /> tag in your template. Without these, your clients can't add any content to their emails.
  • 4102: No Closing Repeater tag We found your <repeater> tag, but we couldn’t track down the </repeater> tag. Please add it to close the loop.
  • 4103: No Width Specified in the Image Tag The image you’ve added as <image> needs a width added so we can resize all the images your client adds to be the same width as this image (height is not required).
  • 4104: No Editable Regions in Repeater We found your <repeater> and </repeater> tags, but couldn't track down a <singleline>, <multiline> or <img editable="true" /> tag. You'll need one of these tags so you can add content to any repeating items.
  • 4105: No Opening Repeater tag We found your </repeater> tag, but we couldn’t track down the <repeater> tag. Please add it to close the loop.
  • 4108: No Closing Table of Contents We found the <tableofcontents> tag, but couldn’t track down the </tableofcontents> tag. You’ll need to add this before the table of contents will work.
  • 4109: No repeatertitle Tag We found your <tableofcontents> and </tableofcontents> tags, but couldn’t track down the <repeatertitle>tag.
  • 4110: Mulitple repeatertitle tags You have more than one repeatertitle tag within your tableofcontents tags. We can only reference one of them, so please remove the extras.
  • 4111: No tableofcontents tags You have provided a repeatertitle tag, but have not wrapped it in tableofcontents tags.
  • 4118: Table of Contents With No Repeater Tag If you’re adding table of contents, you’ll also need a repeater in your template. The table of contents is automatically created based on what your client adds for each repeater title. If you have a table of contents, you’ll need to also add the <repeater> and </repeater> and associated tags to your template.
  • 4128: Nested Repeaters Your template contains a repeater tag within an open repeater, or nested repeaters. Repeaters cannot be nested and must be separate of other repeaters in your template.
  • 4129: Table Based Repeater Contains Multiple Trs A repeater in your template contains multiple <tr> tags which is not allowed.
  • 4130: No Closing Singleline tag We found your <singleline> tag, but we couldn’t track down the </singleline> tag. Please add it to close the loop.
  • 4131: No Closing Multiline tag We found your <multiline> tag, but we couldn’t track down the </multiline> tag. Please add it to close the loop.
  • 4132: No Repeater with Title You have provided a tableofcontents, but haven't included a repeater with a <singleline repeatertitle="true" /> tag. Please add a singleline tag with the repeatertitle="true" attribute to the repeater you want to populate your table of contents.
  • 4201: Contains Flash Flash is not supported by almost every email client out there and should not be included in your emails.
  • 4202: Contains Script Almost every popular email client and spam filter does not support JavaScript. Your campaign will either be filtered as spam, or will display a security warning to your recipients. We recommend removing all JavaScript code from your campaign and then re-import it.
  • 4203: Contains Java Java is not supported by almost every email client out there and should not be included in your emails. Please remove it from your content.
  • 4300: No Unsubscribe Tag We require a single-click unsubscribe link in every campaign you send. To add an unsubscribe link, you can... Do it yourself - by adding the tags <unsubscribe> and </unsubscribe> around the words you want to become an unsubscribe link, and then re-import your template.
  • 4301: Unsubscribe Tag Hidden In Comments Your unsubscribe tag appears to be hidden inside HTML comment tags such as <!- -> . Please ensure your unsubscribe link is visible and not commented out of the page.
  • 4302: Unsubscribe Tag Contains Less Than 3 Chars You'll need to add some text, such as 'unsubscribe' in between your and tags. Those words will then become an unsubscribe link for each recipient.
  • 4303: Unsubscribe Tag Contains A Link It appears your <unsubscribe> tag contains a link. Please ensure you add the tags and around only the words (and not links) you want to become an unsubscribe link. We'll automatically convert that to a link for each recipient.
  • 4304: No Closing Unsubscribe Tag We found the <unsubscribe> tag, but couldn't track down the </unsubscribe> tag. You'll need to add this before the unsubscribe link will work.
  • 4305: Clickable unsubscribe link required You're using a text email unsubscribe link - [unsubscribe]. Please change this to one suitable for a HTML email by adding the tags<unsubscribe> and </unsubscribe> around the words you want to become an unsubscribe link.
  • 4306: Nested Unsubscribe tag We've detected an <unsubscribe> tag inside another Campaign Monitor tag. This will render the Unsubscribe link unusable, and can cause problems with your subscribers attempting to unsubscribe. Please place the <unsubscribe> tag outside the Campaign Monitor tag.
  • 4307: Nested Unsubscribe tag We've detected an <unsubscribe> tag inside another link (ie. an <a> tag). This will render the Unsubscribe link unusable, and can cause problems with your subscribers attempting to unsubscribe. Please place the <unsubscribe> tag outside the link.
  • 4350: Files Missing from ZIP File It appears that there are files missing from your zip file which are referenced by your HTML file. Please ensure that all necessary files are included in the zip file and that the HTML file references all other files correctly.
  • 4401: Layout not in a Repeater We found a <layout> tag, but it wasn't wrapped in <repeater> and </repeater> tags. Different layouts can only be placed within a repeater.
  • 4402: No Closing Layout tag We found your <layout> tag, but we couldn’t track down the </layout> tag. Please add it to close the loop.
  • 4403: No Opening Layout tag We found your </layout> tag, but we couldn’t track down the <layout> tag. Please add it to close the loop.
  • 4404: No Editable Regions in Layout We found your <layout> and </layout> tags, but couldn't track down a <singleline>, <multiline> or <img editable="true" /> tag. You'll need one of these tags so you can add content to any repeating items.
  • 4405: Table Based Layout Contains Multiple Trs A layout in your template contains multiple <tr> tags which is not allowed.
  • 4406: Not all Layouts Have a Label We found a <layout> tag in a repeater that has a label, but not all of the layouts in that repeater do. To make it easy to choose between each layout option, please make sure each <layout> has a label.
  • 4501: Nested datarepeater tags Your template contains a datarepeater tag within an open repeater, or nested repeaters. Repeaters cannot be nested and must be separate of other repeaters in your template.
  • 4502: Invalid datarepeater type The type provided is invalid for a datarepeater. Please refer to the documentation to see what types are acceptable.
  • 4503: Invalid datarepeater tag The tag provided is invalid for this type of datarepeater. Please refer to the template documentation to see which tags are accepted.
  • 4504: Invalid tag chosen for TOC The tag provided is not a valid tag to be included in the table of contents for this type of datarepeater. Please refer to the template documentation to see which tags are accepted.
  • 4505: Missing required attribute in tag An attribute is required for a particular tag in this type of datarepeater. Please refer to the template documentation to see which attributes are required.
  • 4506: Invalid attribute value in tag The value you've supplied for an attribute is invalid for the given tag. Please refer to the template documentation to see what values are accepted.
  • 4507: Missing required attribute in data tag An attribute is required for the data tag when the given type is specified. Please refer to the template documentation to see which attributes are required for what tags.
  • 4508: Missing datarepeater type The type attribute is required for the datarepeater tag. Please refer to the template documentation to see what values are accepted.
  • 4509: Invalid tag nesting The tag is not able to have other data tags nested within it. Please refer to the template documentation to see which tags are able to be nested.
  • 4510: Invalid tag nesting The tag is not able to be nested within other data tags. Please refer to the template documentation to see which tags are able to be nested.
  • 4511: Invalid site URL or no feeds The url you have provided as the source for your <datarepeater> is either invalid, or does not contain any RSS feeds. Please check the url and make sure there are some feeds on your site.

Updating a template

Put https://api.createsend.com/api/v3.2/templates/{templateid}.{xml|json}

Updates an existing template for a client. You can update the name of the template and URLs for the HTML file and zip file.

  • TemplateID The ID of the template to be updated.
Expected request: JSONXML
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "Name": "Renamed Template Two",
    "HtmlPageURL": "http://example.com/index.html",
    "ZipFileURL": "http://example.com/files.zip"
}
Expected response: (Same for all languages)
HTTP/1.1 200 OK
Error responses:

Please see our response status codes documentation for details of potential error responses for any API request.

If you receive a 400 Bad Request response for this request, these are the possible errors which may be included in the body of the response:

  • 4001: Invalid Template ID Invalid Template ID, or the template doesn't exist or belong to the client.
  • 4002: Template Name Required The template name passed cannot be empty.
  • 4003: Invalid Template Name The template name entered is invalid.
  • 4004: HTML Page URL Required The URL to your HTML page for the template cannot be empty.
  • 4005: Invalid HTML Page URL You must provide a valid URL to your HTML page for the template.
  • 4006: Invalid ZIP File URL The URL of the zip file you have passed is invalid.
  • 4101: No Editable Region in Template You need have at least one <singleline />, <multiline /> or <img editable="true" /> tag in your template. Without these, your clients can't add any content to their emails.
  • 4102: No Closing Repeater tag We found your <repeater> tag, but we couldn’t track down the </repeater> tag. Please add it to close the loop.
  • 4103: No Width Specified in the Image Tag The image you’ve added as <image> needs a width added so we can resize all the images your client adds to be the same width as this image (height is not required).
  • 4104: No Editable Regions in Repeater We found your <repeater> and </repeater> tags, but couldn't track down a <singleline>, <multiline> or <img editable="true" /> tag. You'll need one of these tags so you can add content to any repeating items.
  • 4105: No Opening Repeater tag We found your </repeater> tag, but we couldn’t track down the <repeater> tag. Please add it to close the loop.
  • 4108: No Closing Table of Contents We found the <tableofcontents> tag, but couldn’t track down the </tableofcontents> tag. You’ll need to add this before the table of contents will work.
  • 4109: No repeatertitle Tag We found your <tableofcontents> and </tableofcontents> tags, but couldn’t track down the <repeatertitle>tag.
  • 4110: Mulitple repeatertitle tags You have more than one repeatertitle tag within your tableofcontents tags. We can only reference one of them, so please remove the extras.
  • 4111: No tableofcontents tags You have provided a repeatertitle tag, but have not wrapped it in tableofcontents tags.
  • 4118: Table of Contents With No Repeater Tag If you’re adding table of contents, you’ll also need a repeater in your template. The table of contents is automatically created based on what your client adds for each repeater title. If you have a table of contents, you’ll need to also add the <repeater> and </repeater> and associated tags to your template.
  • 4128: Nested Repeaters Your template contains a repeater tag within an open repeater, or nested repeaters. Repeaters cannot be nested and must be separate of other repeaters in your template.
  • 4129: Table Based Repeater Contains Multiple Trs A repeater in your template contains multiple <tr> tags which is not allowed.
  • 4130: No Closing Singleline tag We found your <singleline> tag, but we couldn’t track down the </singleline> tag. Please add it to close the loop.
  • 4131: No Closing Multiline tag We found your <multiline> tag, but we couldn’t track down the </multiline> tag. Please add it to close the loop.
  • 4132: No Repeater with Title You have provided a tableofcontents, but haven't included a repeater with a <singleline repeatertitle="true" /> tag. Please add a singleline tag with the repeatertitle="true" attribute to the repeater you want to populate your table of contents.
  • 4201: Contains Flash Flash is not supported by almost every email client out there and should not be included in your emails.
  • 4202: Contains Script Almost every popular email client and spam filter does not support JavaScript. Your campaign will either be filtered as spam, or will display a security warning to your recipients. We recommend removing all JavaScript code from your campaign and then re-import it.
  • 4203: Contains Java Java is not supported by almost every email client out there and should not be included in your emails. Please remove it from your content.
  • 4300: No Unsubscribe Tag We require a single-click unsubscribe link in every campaign you send. To add an unsubscribe link, you can... Do it yourself - by adding the tags <unsubscribe> and </unsubscribe> around the words you want to become an unsubscribe link, and then re-import your template.
  • 4301: Unsubscribe Tag Hidden In Comments Your unsubscribe tag appears to be hidden inside HTML comment tags such as <!- -> . Please ensure your unsubscribe link is visible and not commented out of the page.
  • 4302: Unsubscribe Tag Contains Less Than 3 Chars You'll need to add some text, such as 'unsubscribe' in between your and tags. Those words will then become an unsubscribe link for each recipient.
  • 4303: Unsubscribe Tag Contains A Link It appears your <unsubscribe> tag contains a link. Please ensure you add the tags and around only the words (and not links) you want to become an unsubscribe link. We'll automatically convert that to a link for each recipient.
  • 4304: No Closing Unsubscribe Tag We found the <unsubscribe> tag, but couldn't track down the </unsubscribe> tag. You'll need to add this before the unsubscribe link will work.
  • 4305: Clickable unsubscribe link required You're using a text email unsubscribe link - [unsubscribe]. Please change this to one suitable for a HTML email by adding the tags<unsubscribe> and </unsubscribe> around the words you want to become an unsubscribe link.
  • 4306: Nested Unsubscribe tag We've detected an <unsubscribe> tag inside another Campaign Monitor tag. This will render the Unsubscribe link unusable, and can cause problems with your subscribers attempting to unsubscribe. Please place the <unsubscribe> tag outside the Campaign Monitor tag.
  • 4307: Nested Unsubscribe tag We've detected an <unsubscribe> tag inside another link (ie. an <a> tag). This will render the Unsubscribe link unusable, and can cause problems with your subscribers attempting to unsubscribe. Please place the <unsubscribe> tag outside the link.
  • 4350: Files Missing from ZIP File It appears that there are files missing from your zip file which are referenced by your HTML file. Please ensure that all necessary files are included in the zip file and that the HTML file references all other files correctly.
  • 4401: Layout not in a Repeater We found a <layout> tag, but it wasn't wrapped in <repeater> and </repeater> tags. Different layouts can only be placed within a repeater.
  • 4402: No Closing Layout tag We found your <layout> tag, but we couldn’t track down the </layout> tag. Please add it to close the loop.
  • 4403: No Opening Layout tag We found your </layout> tag, but we couldn’t track down the <layout> tag. Please add it to close the loop.
  • 4404: No Editable Regions in Layout We found your <layout> and </layout> tags, but couldn't track down a <singleline>, <multiline> or <img editable="true" /> tag. You'll need one of these tags so you can add content to any repeating items.
  • 4405: Table Based Layout Contains Multiple Trs A layout in your template contains multiple <tr> tags which is not allowed.
  • 4406: Not all Layouts Have a Label We found a <layout> tag in a repeater that has a label, but not all of the layouts in that repeater do. To make it easy to choose between each layout option, please make sure each <layout> has a label.
  • 4501: Nested datarepeater tags Your template contains a datarepeater tag within an open repeater, or nested repeaters. Repeaters cannot be nested and must be separate of other repeaters in your template.
  • 4502: Invalid datarepeater type The type provided is invalid for a datarepeater. Please refer to the documentation to see what types are acceptable.
  • 4503: Invalid datarepeater tag The tag provided is invalid for this type of datarepeater. Please refer to the template documentation to see which tags are accepted.
  • 4504: Invalid tag chosen for TOC The tag provided is not a valid tag to be included in the table of contents for this type of datarepeater. Please refer to the template documentation to see which tags are accepted.
  • 4505: Missing required attribute in tag An attribute is required for a particular tag in this type of datarepeater. Please refer to the template documentation to see which attributes are required.
  • 4506: Invalid attribute value in tag The value you've supplied for an attribute is invalid for the given tag. Please refer to the template documentation to see what values are accepted.
  • 4507: Missing required attribute in data tag An attribute is required for the data tag when the given type is specified. Please refer to the template documentation to see which attributes are required for what tags.
  • 4508: Missing datarepeater type The type attribute is required for the datarepeater tag. Please refer to the template documentation to see what values are accepted.
  • 4509: Invalid tag nesting The tag is not able to have other data tags nested within it. Please refer to the template documentation to see which tags are able to be nested.
  • 4510: Invalid tag nesting The tag is not able to be nested within other data tags. Please refer to the template documentation to see which tags are able to be nested.
  • 4511: Invalid site URL or no feeds The url you have provided as the source for your <datarepeater> is either invalid, or does not contain any RSS feeds. Please check the url and make sure there are some feeds on your site.

Deleting a template

Delete https://api.createsend.com/api/v3.2/templates/{templateid}.{xml|json}

Deletes an existing template based on the template ID.

  • TemplateID The ID of the template to be deleted.
Expected response: (Same for all languages)
HTTP/1.1 200 OK
Error responses:

Please see our response status codes documentation for details of potential error responses for any API request.