> For the complete documentation index, see [llms.txt](https://docs.abtasty.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.abtasty.com/server-side/command-line-interface/resource-loader/feature-experimentation/variation-group.md).

# Variation Group

Schema, including its fields, nested structure, and relationships

#### Definition

A **Variation Group** is a single traffic split within a campaign. It defines who can enter (via **Targeting**) and how traffic is distributed across **Variations**. Exactly one variation must be the **reference** (control). Allocations in the group must sum to 100.

#### Payload Properties

A variation group has many properties. When creating or updating a variation group, the payload can include the following fields:

* **`id`** (String, *optional*) – The variation group's unique ID. Include this only when updating an existing variation group.
* `name` (String, optional) — Display name for the group.
* `variations` (Array\<Variation>, **required**) — At least one reference and one test recommended.
* `targeting` (Object, optional) — Entry rules:
  * `targeting_groups` (Array\<Object>, optional) — OR between groups.
    * Each group has `targetings` (Array\<Object>, AND within the group):
      * `key` (String, **required**) — Targeting Key name.
      * `operator` (String, **required**) — e.g., `EQUALS`, `IN`, `CONTAINS`, `MATCHES_REGEX` (set varies by platform).
      * `value` (Any, **required**) — Comparison value (string/number/boolean/array).

**Example Variation group Payload:**

```json
{
  "name": "Logged-in Users",
  "variations": [
    { "name": "Original", "reference": true, "allocation": 50 },
    {
      "name": "Variation A",
      "reference": false,
      "allocation": 50,
      "modifications": {
        "type": "FLAG",
        "value": { "new-nav": true }
      }
    }
  ],
  "targeting": {
    "targeting_groups": [
      {
        "targetings": [
          { "key": "isLoggedIn", "operator": "EQUALS", "value": true }
        ]
      }
    ]
  }
}
```

#### Error Codes

Error scenarios for campaigns largely follow the general codes:

* **InvalidPayload** – The campaign payload is missing required fields or has invalid values (e.g., missing name or type).
* **ParentNotFound** – (Not usually applicable to campaigns since they have no parent in this schema; this might be returned if an account or environment context is wrong, but not in the resource schema context of parent-child).
* **PermissionDenied** – The user lacks permission to create or modify campaigns (for instance, not having the rights to create campaigns in the account).
* **DuplicateRef** – A campaign with the same reference already exists. For example, trying to create a campaign with a name or key that conflicts with an existing one could trigger this.
* **InvalidDependency** – If the campaign references something that doesn’t exist. This is rare at the campaign level, but could occur if sub\_tests or audiences reference invalid IDs (e.g., an audience ID that is not found).


---

# 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 by asking a question.

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

```
GET https://docs.abtasty.com/server-side/command-line-interface/resource-loader/feature-experimentation/variation-group.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 `automate deployments from our CI pipeline` 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.
