Constant
Contact
API Guide

Delete an Email Campaign

Make a DELETE call to /emails/{campaign_id} to delete an existing email campaign and all associated campaign activities.

You cannot delete an email campaign if the current_status is SCHEDULED. To unschedule an email campaign, make a DELETE call to the /emails/activities/{campaign_activity_id}/schedules` endpoint.

To restore a deleted email campaign, use the Constant Contact user interface.

Authorization Requirements

User privileges: campaign:writeAuthorization scopes: campaign_data

Parameters

Use the campaign_id path parameter to specify the email campaign that you want to delete. For example:

https://api.cc.email/v3/emails/{campaign_id}

Example DELETE Email Campaign Request

DELETE
https://api.cc.email/v3/emails/{campaign_id}
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cc.email/v3/emails/4a5e56ce-286b-41dd-9d92-1ab86064030c")
  .delete(null)
  .addHeader("Accept", "*/*")
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {access token}")
  .addHeader("User-Agent", "PostmanRuntime/7.15.2")
  .addHeader("Cache-Control", "no-cache")
  .addHeader("Postman-Token", "272f7ad5-0dad-4ec7-b9d1-6f01da4bb89b,2841a52c-acd1-402d-b8de-9fe91821b4f9")
  .addHeader("Host", "your_host")
  .addHeader("Accept-Encoding", "gzip, deflate")
  .addHeader("Content-Length", "")
  .addHeader("Connection", "keep-alive")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();

Response

A successful DELETE call returns a 204 response code and message (Email campaign successfully deleted. No response body returned), and an empty response body:

[
]

Deleting an email campaign, changes the current_status to Removed. Attempting to get details about a deleted email campaign returns a 404 response code (resource not found). Attempting to delete an email campaign that was previously deleted returns a 400 response code with the following error key and message:

[
 {
   "error_key": "validation.error.emailcampaigns.remove.invalid.removed",
   "error_message": "EmailCampaign cannot be removed as it is already in REMOVED status."
 }
]
Try it!

On this page