Delete a marketing campaign
DELETE /api/configuration/consent/marketing-campaigns/{all}
- Products: Operator (
FOH) - Features: Front of House Generic Access (
FOHGENERIC)
Overview
Removes a marketing campaign — a named promotional purpose members opt in or out of — from consent configuration. The final segment of the path is the campaign identifier returned when the campaign was created.
This is a hard delete, and it discards every member's consent for the campaign. The campaign goes, and so does every member consent record naming it, across all members and all communication channels. A history entry is recorded for each consent before it is removed — member, campaign, campaign name, channel, channel name and capture date — so the audit trail survives, but the opt-ins themselves do not, and re-creating a campaign with the same name gives you an empty one.
Deactivating instead of deleting does not save the opt-ins. Setting the campaign inactive through the update endpoint removes exactly the same member consent records; only the campaign itself survives. Neither route preserves who had opted in.
The route enforces the category, and a mismatch reads as 404. Marketing and data-processing campaigns share one identifier space, so this endpoint checks that the campaign you named is a marketing one. Pass a data-processing campaign's identifier here and you get 404 rather than an explanation — use the data-processing campaign delete for those.
A repeat call is not a no-op: it answers 404, which on a retry means the first attempt succeeded.
On success, the next read of marketing campaigns is up to date.
Endpoint
DELETE {base_url}/api/configuration/consent/marketing-campaigns/{all}
{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
campaignId | string | Yes | The campaign identifier — the generated code returned in the body when the campaign was created, or the identifier listed by the retrieve-campaigns endpoint. It is not the campaign's display name. Comparison is exact, and the campaign must be in the marketing category: an unknown identifier and a data-processing campaign's identifier both return 404. |
Sample request
curl -X DELETE '{base_url}/api/configuration/consent/marketing-campaigns/{all}' \
-H 'Authorization: Bearer {accessToken}' \
-H 'X-Use-SSO: true'Errors
| Status | Meaning | When |
|---|---|---|
400 | Bad request | The campaign exists but is flagged as a system campaign and cannot be removed — Cannot delete {campaignId} as this is a non removable campaign. No consent records are touched. |
400 | Bad request | campaignId is empty — A campaign ID must be supplied. In practice a request with an empty path segment does not reach this endpoint. |
404 | Not found | No campaign has that identifier, or the campaign exists but belongs to the data-processing category rather than marketing, or a previous delete already removed it. The body is empty, so 404 alone does not tell you which of these it was. |
500 | Internal server error | The delete failed — for example something still references the campaign. The consent removals, history entries and campaign removal are all-or-nothing, so nothing is left half-done. The body is empty. |