# Update a data processing campaign

`PUT /api/configuration/consent/data-processing/{all}`

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

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

## Overview

Switches a data processing campaign on or off. A data processing campaign is a named purpose for which members give or withhold consent to have their data processed; the set of campaigns configured for your tenant is returned by [Get all data processing campaigns](get-all-data-processing-campaigns.md).

**This endpoint changes one thing: the campaign's active flag.** Despite the `PUT` verb and the campaign's other attributes, the request body carries only `isActive` — the name, description and expiry date you supplied when creating the campaign cannot be changed here, and no other endpoint in this group changes them. If you need a different name or description, delete the campaign and create a new one, keeping in mind that [deleting a campaign also deletes every member consent recorded against it](delete-a-data-processing-campaign.md), whereas deactivating it here leaves those consent records intact.

**Send `isActive` explicitly on every call.** It is a plain boolean with no server-side default, so a request body that omits it — or sends `null` — is read as `false` and deactivates the campaign. There is no "leave unchanged" value.

The `{all}` in the path is a placeholder, not a literal. Substitute the campaign identifier: `PUT /api/configuration/consent/data-processing/NEWSLETTER`.

A successful call returns `204 No Content` with no body, and the new state is visible on the next read.

## Endpoint

`PUT {base_url}/api/configuration/consent/data-processing/{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. Use the `campaignId` value returned by [Get all data processing campaigns](get-all-data-processing-campaigns.md) — it is a short code generated from the campaign name when the campaign was created (uppercased, spaces removed and truncated), not a numeric identifier, and you cannot choose it yourself. An id that belongs to a marketing campaign rather than a data processing one is rejected with `404` rather than updating the marketing campaign. |

## Request body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `isActive` | boolean | No | Whether the campaign is available for members to consent to. Not optional in practice: a missing or null value is read as `false`, so omitting it deactivates the campaign. Send the value you want on every call. Setting it to `false` hides the campaign from reads that pass `onlyActive=true` but keeps the campaign and every member consent already recorded against it; setting it back to `true` restores it unchanged. |

## Sample request

```bash title="cURL"
curl -X PUT '{base_url}/api/configuration/consent/data-processing/NEWSLETTER' \
  -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 flagged as a system campaign, which cannot be modified. The body is the plain string `Cannot update campaign {campaignId} as this is a non modifiable campaign`. Also returned, with the body `A campaign ID must be supplied`, when the path segment is empty. |
| `404` | Not found | No campaign exists with that id, or the id belongs to a campaign in a different category — a marketing campaign id sent to this data processing route fails here rather than updating the marketing campaign. The response has no body, so you cannot distinguish the two cases from the status alone. |
| `500` | Internal server error | An unexpected server-side failure while reading or writing the campaign. The body is empty. The update is not applied. |
