> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/implementation-guide/integrations-and-data-exchange/custom-fields/setup-for-campaigns.md).

# Setup for Campaigns

Direct, Referral, Automation, Leaderboard, and Challenge campaigns each have their **own** Custom Fields schema — a field created for Direct campaigns doesn't appear on Automation campaigns, and vice versa. Set up each schema from **Custom Fields**, exactly as described in [Setting Up Custom Fields](broken://pages/fab9589035d3fde779766df6d224e52d26b136fa).

{% hint style="info" %}
Unlike Members, campaign-type modules don't support Subgroups — only simple fields (String, Number, Boolean, Date, Single select, Multi select).
{% endhint %}

***

### Entering values

* Every campaign wizard/editor (Direct, Referral, Automation, Leaderboard, Challenges) has a dedicated **Custom Fields** step. Required fields must be filled in before the campaign can be saved.
* The values entered are repeated in the wizard's **Summary** step for review before publishing.
* The **Single Campaign View** shows a Custom Fields section with the saved values, the same way member profiles do.

***

### Custom fields in webhooks

Custom field data for a campaign is included in that campaign's **created** and **updated** webhooks, using the same group → field structure as the member API response. This means downstream systems (e.g. Salesforce, a BI pipeline) receive the campaign's custom attributes without a separate lookup call.

***

### Via the API

The same read/write pattern used for members applies to campaigns: `customFields` in the campaign payload (`POST` adds, `PUT` replaces), plus a dedicated partial-update endpoint:

```http
PATCH /api/{storeCode}/custom-fields/campaign/{campaignId}
```

The body uses the group → field structure; a field sent as `null` clears it, groups omitted from the payload are left untouched, and an unknown group returns a `400` validation error.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.openloyalty.io/implementation-guide/integrations-and-data-exchange/custom-fields/setup-for-campaigns.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
