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.

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

Gethttps://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 OKContent-Type: application/json; charset=utf-8{"TemplateID": "5cac213cf061dd4e008de5a82b7a3621","Name": "Template One","PreviewURL": "http://preview.createsend.com/templates/publicpreview/01AF532CD8889B33?d=r","ScreenshotURL": "http://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

Posthttps://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
{"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 CreatedContent-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 RequiredThe template name passed cannot be empty.
  • 4003: Invalid Template NameThe template name entered is invalid.
  • 4004: HTML Page URL RequiredThe URL to your HTML page for the template cannot be empty.
  • 4005: Invalid HTML Page URLYou must provide a valid URL to your HTML page for the template.
  • 4006: Invalid ZIP File URLThe URL of the zip file you have passed is invalid.
  • 4101: No Editable Region in TemplateYou 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 tagWe 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 TagThe 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 RepeaterWe 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 tagWe 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 ContentsWe 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 TagWe found your <tableofcontents> and </tableofcontents> tags, but couldn’t track down the <repeatertitle>tag.
  • 4110: Mulitple repeatertitle tagsYou 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 tagsYou have provided a repeatertitle tag, but have not wrapped it in tableofcontents tags.
  • 4118: Table of Contents With No Repeater TagIf 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 RepeatersYour 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 TrsA repeater in your template contains multiple <tr> tags which is not allowed.
  • 4130: No Closing Singleline tagWe found your <singleline> tag, but we couldn’t track down the </singleline> tag. Please add it to close the loop.
  • 4131: No Closing Multiline tagWe found your <multiline> tag, but we couldn’t track down the </multiline> tag. Please add it to close the loop.
  • 4132: No Repeater with TitleYou have provided a tableofcontents, but haven't included a repeater with a <singleline repeatertitle='' /> tag. Please add a singleline tag with the repeatertitle='' attribute to the repeater you want to populate your table of contents.
  • 4201: Contains FlashFlash is not supported by almost every email client out there and should not be included in your emails.
  • 4202: Contains ScriptAlmost 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 JavaJava 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 TagWe 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 CommentsYour 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 CharsYou'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 LinkIt 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 TagWe 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 requiredYou'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 tagWe'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 tagWe'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 FileIt 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 RepeaterWe 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 tagWe found your <layout> tag, but we couldn’t track down the </layout> tag. Please add it to close the loop.
  • 4403: No Opening Layout tagWe 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 LayoutWe 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 TrsA layout in your template contains multiple <tr> tags which is not allowed.
  • 4406: Not all Layouts Have a LabelWe 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 tagsYour 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 typeThe type provided is invalid for a datarepeater. Please refer to the documentation to see what types are acceptable.
  • 4503: Invalid datarepeater tagThe 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 TOCThe 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 tagAn 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 tagThe 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 tagAn 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 typeThe type attribute is required for the datarepeater tag. Please refer to the template documentation to see what values are accepted.
  • 4509: Invalid tag nestingThe 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 nestingThe 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 feedsThe 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

Puthttps://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
{"Name": "Renamed Template Two","HtmlPageURL": "http://example.com/index.html","ZipFileURL": "http://example.com/files.zip"}
Expected response: (Same for all >
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 IDInvalid Template ID, or the template doesn't exist or belong to the client.
  • 4002: Template Name RequiredThe template name passed cannot be empty.
  • 4003: Invalid Template NameThe template name entered is invalid.
  • 4004: HTML Page URL RequiredThe URL to your HTML page for the template cannot be empty.
  • 4005: Invalid HTML Page URLYou must provide a valid URL to your HTML page for the template.
  • 4006: Invalid ZIP File URLThe URL of the zip file you have passed is invalid.
  • 4101: No Editable Region in TemplateYou 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 tagWe 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 TagThe 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 RepeaterWe 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 tagWe 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 ContentsWe 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 TagWe found your <tableofcontents> and </tableofcontents> tags, but couldn’t track down the <repeatertitle>tag.
  • 4110: Mulitple repeatertitle tagsYou 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 tagsYou have provided a repeatertitle tag, but have not wrapped it in tableofcontents tags.
  • 4118: Table of Contents With No Repeater TagIf 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 RepeatersYour 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 TrsA repeater in your template contains multiple <tr> tags which is not allowed.
  • 4130: No Closing Singleline tagWe found your <singleline> tag, but we couldn’t track down the </singleline> tag. Please add it to close the loop.
  • 4131: No Closing Multiline tagWe found your <multiline> tag, but we couldn’t track down the </multiline> tag. Please add it to close the loop.
  • 4132: No Repeater with TitleYou have provided a tableofcontents, but haven't included a repeater with a <singleline repeatertitle='' /> tag. Please add a singleline tag with the repeatertitle='' attribute to the repeater you want to populate your table of contents.
  • 4201: Contains FlashFlash is not supported by almost every email client out there and should not be included in your emails.
  • 4202: Contains ScriptAlmost 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 JavaJava 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 TagWe 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 CommentsYour 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 CharsYou'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 LinkIt 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 TagWe 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 requiredYou'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 tagWe'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 tagWe'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 FileIt 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 RepeaterWe 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 tagWe found your <layout> tag, but we couldn’t track down the </layout> tag. Please add it to close the loop.
  • 4403: No Opening Layout tagWe 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 LayoutWe 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 TrsA layout in your template contains multiple <tr> tags which is not allowed.
  • 4406: Not all Layouts Have a LabelWe 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 tagsYour 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 typeThe type provided is invalid for a datarepeater. Please refer to the documentation to see what types are acceptable.
  • 4503: Invalid datarepeater tagThe 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 TOCThe 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 tagAn 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 tagThe 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 tagAn 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 typeThe type attribute is required for the datarepeater tag. Please refer to the template documentation to see what values are accepted.
  • 4509: Invalid tag nestingThe 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 nestingThe 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 feedsThe 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

Deletehttps://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 >
HTTP/1.1 200 OK
Error responses:

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