---
title: "Add or remove targeting"
method: PATCH
path: "/campaigns/{campaignId}/targeting"
tags: ["Targeting"]
---

# Add or remove targeting

`PATCH /campaigns/{campaignId}/targeting`

## Request

- Base URL: `https://www.fandom.ai/api/v1`
- URL: `https://www.fandom.ai/api/v1/campaigns/{campaignId}/targeting`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/docs/campaigns/:campaignId/targeting/patch.ts> (a function with typed inputs; its response is checked against the schema)

The app's Add and Delete for one audience. Removed terms come out of Google Ads on the next sync. Not allowed while the audience is generating.

Scope: `campaigns:write`.

Send an `Idempotency-Key` header to make retries safe.

## Path parameters

- `campaignId` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `audienceId` string, required: The audience slot (the `id` in Get targeting).
  - `add` object[]
    - `section` 'keywords' | 'negativeKeywords' | 'caaWebsites' | 'websites' | 'adCategories' | 'adAffinities' | 'adInMarketAffinities' | 'adLifeEvents' | 'adDetailedDemographics' | 'adDemographics' | 'cia' | 'caaApps', required: `keywords`, `negativeKeywords`, `caaWebsites` (websites), `adCategories` (topics), `adAffinities`, `adInMarketAffinities`, `adLifeEvents`, `adDetailedDemographics`, `adDemographics`, `cia` (custom intent) or `caaApps`. Which apply depends on the campaign type.
    - `text` string, required
    - `matchType` 'BROAD' | 'PHRASE' | 'EXACT': Keywords only.
  - `remove` object[]
    - `section` 'keywords' | 'negativeKeywords' | 'caaWebsites' | 'websites' | 'adCategories' | 'adAffinities' | 'adInMarketAffinities' | 'adLifeEvents' | 'adDetailedDemographics' | 'adDemographics' | 'cia' | 'caaApps', required: `keywords`, `negativeKeywords`, `caaWebsites` (websites), `adCategories` (topics), `adAffinities`, `adInMarketAffinities`, `adLifeEvents`, `adDetailedDemographics`, `adDemographics`, `cia` (custom intent) or `caaApps`. Which apply depends on the campaign type.
    - `text` string, required

## Response `200`

Success

- object
  - `added` number, required
  - `updated` number, required
  - `removed` number, required
  - `audience` object, required
    - `id` string, required: The audience's slot on the campaign.
    - `name` string, required
    - `audienceId` string, nullable, required
    - `status` 'not_generated' | 'generating' | 'ready' | 'error', required: Generation takes 30–90 seconds.
    - `error` string, nullable, required
    - `updatedAt` string, nullable, required
    - `items` object[], required
      - `section` string, required
      - `label` string, required: The section's name in the app.
      - `text` string, required
      - `matchType` string, nullable, required: Keywords only: BROAD, PHRASE or EXACT.
      - `source` string, required: `generated`, `manual`, `rfp`, `imported`…

## Other responses

- `400`: The request is missing something or has a bad value. The message says what.
- `401`: No API key, or the key is wrong or revoked.
- `403`: The key doesn't have the scope, or isn't allowed this campaign or account.
- `404`: Nothing with that id in this workspace.
- `409`: The current state doesn't allow this (for example, it's already done or still generating).
- `429`: More than 120 requests in a minute. Wait and retry.

## Changes

- **2026-10-07** `dfe5b1c3d84f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/changes/campaigns/:campaignId/targeting/patch.md)

---

[API](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api.md) - [All operations](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/llms.txt) - [OpenAPI document](https://skmtc.dev/skilledstars/apis/super-fans-enterprise-api/revisions/6c1a68a75970?raw)
