Contact Us

January 22, 2025

May 13, 2026 5:53 pm

Deleting unused emails and templates in bulk in Salesforce Marketing Cloud

Share with

Understanding the Challenge

The main challenge in deleting unused emails and templates is determining which assets are truly unused. While leveraging the created date is easy, it may not be entirely accurate, as old creations may still be actively used.

One approach is to match emails against the send log or system data views. However, this method has limitations, as it won’t work for templates.

Using the API for Bulk Deletion

Teams can use the Salesforce Marketing Cloud REST API to delete unused emails and templates in bulk. This approach requires writing a script that will perform the deletion via API in a loop.

deleteUnusedAssets.js

var apiEndpoint = "https://your-subdomain.marketingcloudapis.com/";
var authenticationEndpoint = apiEndpoint + "v1/login";
var assetEndpoint = apiEndpoint + "asset/v1/content/assets/";
// Authenticate and obtain an access token
// Use the access token to delete unused assets

The root cause of this challenge is the lack of a built-in feature in Salesforce Marketing Cloud to bulk delete unused emails and templates. However, the API provides a powerful solution to overcome this limitation.

Best Practices for Bulk Deletion

Before deleting unused emails and templates in bulk, it’s essential to carefully analyze the send log report and user analysis to determine which assets are truly unused.

Heads up: Be cautious when deleting assets in bulk, as this action is irreversible.

Checklist for Bulk Deletion

  • Analyze the send log report to determine unused emails
  • Conduct user analysis to determine unused templates
  • Use the Salesforce Marketing Cloud REST API for bulk deletion
  • Write a script to perform the deletion via API in a loop
  • Test the script in a non-production environment before running it in production
  • Monitor the deletion process to ensure it’s working as expected

What is the best way to determine unused emails?

The best way to determine unused emails is to analyze the send log report.

Can I use the API to delete unused templates?

Yes, you can use the API to delete unused templates.

What is the risk of deleting assets in bulk?

The risk of deleting assets in bulk is that the action is irreversible, so it’s essential to be cautious and test the script before running it in production.

How do I authenticate with the Salesforce Marketing Cloud API?

You can authenticate with the Salesforce Marketing Cloud API by obtaining an access token through the login endpoint.

Genetrix Technology · Salesforce Marketing Cloud Partner

Need help shipping this in production?

Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.

Get in Touch with Genetrix →

Blogs for the

Business-Savvy!​

Let’s Connect

A 30 min no cost strategy session
with cloud support expert

Let’s Connect

A 30 min no cost strategy session
with cloud support expert