Delete a single email campaign activity.

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:write

Authorization 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}

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cc.email/v3/emails/4a5e56ce-286b-41dd-9d92-1ab86064030c');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'Connection' => 'keep-alive',
  'Content-Length' => '',
  'Accept-Encoding' => 'gzip, deflate',
  'Host' => 'your_host',
  'Postman-Token' => '272f7ad5-0dad-4ec7-b9d1-6f01da4bb89b,28faba6d-8466-43f0-b9a9-8c2073ad2186',
  'Cache-Control' => 'no-cache',
  'User-Agent' => 'PostmanRuntime/7.15.2',
  'Authorization' => 'Bearer {access_token}',
  'Content-Type' => 'application/json',
  'Accept' => '*/*'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
curl -X DELETE \
  https://api.cc.email/v3/emails/4a5e56ce-286b-41dd-9d92-1ab86064030c \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Bearer {access_token}' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: ' \
  -H 'Content-Type: application/json' \
  -H 'Host: your_host' \
  -H 'Postman-Token: 272f7ad5-0dad-4ec7-b9d1-6f01da4bb89b,33fbef47-d785-4b58-b0d2-35666642b27e' \
  -H 'User-Agent: PostmanRuntime/7.15.2' \
  -H 'cache-control: no-cache'
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!