Update a marketing campaign

PUT /api/configuration/consent/marketing-campaigns/{all}

Overview

Switches a marketing campaign on or off. A marketing campaign is a named consent purpose — a newsletter or a promotions mailing, for example — that a member opts into or out of; this call changes only whether the campaign is available, not what it is.

This endpoint updates the active flag and nothing else. The name, description and expiry date are untouched whatever you send, and there is no other endpoint for changing them — a campaign's text is fixed once created.

Because isActive is a plain boolean rather than a nullable one, omitting it deactivates the campaign. There is no "leave as is": an empty body {} is a valid request that sets the campaign inactive. Always send the flag explicitly.

Deactivating is destructive. Setting isActive to false does not merely hide the campaign: it deletes every member consent recorded against it, moving them to consent history. Reactivating afterwards does not bring them back — the members have to consent again. Only reactivation (true) is a safe, reversible operation.

Worse, on this platform deactivating a campaign that members have actually consented to currently fails with 500 after the consents have been touched, and the failure is a known defect rather than anything your request did wrong. Deactivation is only reliable on a campaign with no member consent. Treat a 500 here as "do not retry, raise it with us".

An inactive campaign is filtered out of Get all marketing campaigns when that call is made with onlyActive=true. A successful update is visible on the next read.

Endpoint

PUT {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

NameTypeRequiredDescription
campaignIdstringYesThe campaign to update, as returned in the campaignId field of Get all marketing campaigns. Identifiers are generated at creation from the campaign name — uppercased, spaces stripped, truncated to 10 characters — so they are readable but not something you choose. The identifier must belong to a marketing campaign: quoting a data-processing campaign's ID here returns 404, not a cross-category update.

Request body

FieldTypeRequiredDescription
isActivebooleanNoWhether the campaign is offered to members. true makes it selectable and returned by onlyActive=true listings; false hides it from onlyActive=true listings and, as a side effect, deletes every member consent already recorded against it into consent history. This is the only field the update applies. It is not nullable, so an omitted or null value is read as false and deactivates the campaign — send it on every call. Any campaignId or category you put in the body is overwritten by the route and the endpoint, so you cannot rename a campaign or move it between categories this way.

Sample request

cURL
curl -X PUT '{base_url}/api/configuration/consent/marketing-campaigns/{all}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "isActive": true
}'

Errors

StatusMeaningWhen
400Bad requestThe campaign is a system campaign, which the platform ships and does not allow you to change: Cannot update campaign {campaignId} as this is a non modifiable campaign. Nothing in the listing response tells you which campaigns are system campaigns — protected is always false — which means you cannot detect this in advance. Treat it as a permanent failure rather than retrying.
400Bad requestNo campaign ID was supplied in the path: A campaign ID must be supplied.
404Not foundNo campaign has this ID, or the campaign exists but is a data-processing campaign rather than a marketing one. The body is empty.
500Internal server errorDeactivating a campaign that members have consented to. The request fails while moving those consents to history, even though the input was valid. This is a known defect; retrying does not help. Also returned for any other unexpected server-side failure. The body is empty.

This page as markdown · All pages · llms.txt