# Update a marketing campaign

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

- **Products:** Operator (`FOH`)
- **Features:** Front of House Generic Access (`FOHGENERIC`)

HTML version: [Update a marketing campaign](https://support.gladstonesoftware.cloud/reference/configuration/update-a-marketing-campaign)

## 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](create-a-new-marketing-campaign.md).

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](get-all-marketing-campaigns.md) 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](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `campaignId` | string | Yes | The campaign to update, as returned in the `campaignId` field of [Get all marketing campaigns](get-all-marketing-campaigns.md). 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

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `isActive` | boolean | No | Whether 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

```bash title="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

| Status | Meaning | When |
|--------|---------|------|
| `400` | Bad request | The 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. |
| `400` | Bad request | No campaign ID was supplied in the path: `A campaign ID must be supplied`. |
| `404` | Not found | No campaign has this ID, or the campaign exists but is a data-processing campaign rather than a marketing one. The body is empty. |
| `500` | Internal server error | Deactivating 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. |
