---
title: "Experiences"
description: "<p>Experiences help you create different variations of content pages that cater to different sections of your audience. Experiences are also versioned, so that you can make draft changes on an active version of an experience. The following requests allow you to manage the Segmented and A/B Test Experiences within a project.</p><p>## Experience version lifecycle</p><p>Every change to what an experience shows visitors goes through a *version*. A version has one of four statuses:</p><p>| Status | Meaning |</p><p>|---|---|</p><p>| <span data-type=\"inlineCode\" class=\"code\">DRAFT</span> | Work in progress. The only status whose configuration (variants, variant split, metrics, targeting) can be edited. Not served to visitors. |</p><p>| <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span> | Live. Served to visitors. |</p><p>| <span data-type=\"inlineCode\" class=\"code\">PAUSED</span> | A live version that is temporarily switched off. The experience matches no variants, so the Manifest API returns <span data-type=\"inlineCode\" class=\"code\">null</span>. |</p><p>| <span data-type=\"inlineCode\" class=\"code\">ARCHIVED</span> | A previous version that was replaced. Read-only history. |</p><p>**Rules that apply to every flow below**</p><p>- An experience has at most one <span data-type=\"inlineCode\" class=\"code\">DRAFT</span> and at most one live version (<span data-type=\"inlineCode\" class=\"code\">ACTIVE</span> or <span data-type=\"inlineCode\" class=\"code\">PAUSED</span>) at any time. Every older version is <span data-type=\"inlineCode\" class=\"code\">ARCHIVED</span>.</p><p>- Creating an experience creates an empty <span data-type=\"inlineCode\" class=\"code\">DRAFT</span> version. Find its UID with <span data-type=\"inlineCode\" class=\"code\">Get all Experience Versions</span>, or from the <span data-type=\"inlineCode\" class=\"code\">latestVersion</span> field of the experience.</p><p>- <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span> and <span data-type=\"inlineCode\" class=\"code\">PAUSED</span> versions are locked. Their configuration cannot be edited in place. Only their status can change, and the request must still carry the unchanged configuration.</p><p>- Archiving is automatic. You cannot set a version to <span data-type=\"inlineCode\" class=\"code\">ARCHIVED</span>, and you cannot move an <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span>, <span data-type=\"inlineCode\" class=\"code\">PAUSED</span> or <span data-type=\"inlineCode\" class=\"code\">ARCHIVED</span> version back to <span data-type=\"inlineCode\" class=\"code\">DRAFT</span>.</p><p>- Version requests always carry the full configuration. <span data-type=\"inlineCode\" class=\"code\">status</span> and <span data-type=\"inlineCode\" class=\"code\">variants</span> are required, and nothing is copied from another version, so to change a live version you read it first and send the whole configuration back.</p><p>- To activate a version, an A/B test needs at least two variants and a segmented experience needs at least one. With the <span data-type=\"inlineCode\" class=\"code\">CUSTOM_PERCENTAGE</span> split, the variant traffic must add up to 100.</p><p>### Take a new experience live</p><p>1. <span data-type=\"inlineCode\" class=\"code\">Create an Experience</span>. An empty <span data-type=\"inlineCode\" class=\"code\">DRAFT</span> version is created along with it.</p><p>2. <span data-type=\"inlineCode\" class=\"code\">Get all Experience Versions</span> and note the UID of the <span data-type=\"inlineCode\" class=\"code\">DRAFT</span> version.</p><p>3. <span data-type=\"inlineCode\" class=\"code\">Update an Experience Version</span> on that draft with the full configuration. Keep <span data-type=\"inlineCode\" class=\"code\">status</span> as <span data-type=\"inlineCode\" class=\"code\">DRAFT</span>. Repeat as often as needed.</p><p>4. <span data-type=\"inlineCode\" class=\"code\">Update an Experience Version</span> on the same draft with the final configuration and <span data-type=\"inlineCode\" class=\"code\">status</span> set to <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span>.</p><p>### Pause a live version</p><p>1. <span data-type=\"inlineCode\" class=\"code\">Get all Experience Versions</span> and read the <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span> version.</p><p>2. <span data-type=\"inlineCode\" class=\"code\">Update an Experience Version</span> on it with <span data-type=\"inlineCode\" class=\"code\">status</span> set to <span data-type=\"inlineCode\" class=\"code\">PAUSED</span> and the configuration exactly as it is. Visitors stop seeing the experience.</p><p>3. To resume, send the same request with <span data-type=\"inlineCode\" class=\"code\">status</span> set to <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span>.</p><p>### Edit a live experience</p><p>1. <span data-type=\"inlineCode\" class=\"code\">Get all Experience Versions</span>. Read the configuration of the live version (<span data-type=\"inlineCode\" class=\"code\">ACTIVE</span> or <span data-type=\"inlineCode\" class=\"code\">PAUSED</span>) and check whether a <span data-type=\"inlineCode\" class=\"code\">DRAFT</span> version already exists.</p><p>2. If there is no draft, <span data-type=\"inlineCode\" class=\"code\">Create an Experience Version</span> with <span data-type=\"inlineCode\" class=\"code\">status</span> set to <span data-type=\"inlineCode\" class=\"code\">DRAFT</span> and the full edited configuration. Reuse the <span data-type=\"inlineCode\" class=\"code\">shortUid</span> of the variants you are keeping and leave it out for new variants. If a draft already exists, this request is rejected with <span data-type=\"inlineCode\" class=\"code\">personalize.EXPERIENCES.VERSIONS.CANNOT_CREATE_VERSION_AS_DRAFT_ALREADY_EXISTS</span> whatever status you send. Update that draft in step 3 instead, or discard it with <span data-type=\"inlineCode\" class=\"code\">Delete an Experience Version</span> and create a new one.</p><p>3. Refine the draft with <span data-type=\"inlineCode\" class=\"code\">Update an Experience Version</span> as needed, or discard it with <span data-type=\"inlineCode\" class=\"code\">Delete an Experience Version</span>.</p><p>4. <span data-type=\"inlineCode\" class=\"code\">Update an Experience Version</span> on the draft with <span data-type=\"inlineCode\" class=\"code\">status</span> set to <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span>. The previous live version, whether it was <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span> or <span data-type=\"inlineCode\" class=\"code\">PAUSED</span>, becomes <span data-type=\"inlineCode\" class=\"code\">ARCHIVED</span>.</p><p>If there is no draft, you can skip steps 3 and 4 by creating the version with <span data-type=\"inlineCode\" class=\"code\">status</span> set to <span data-type=\"inlineCode\" class=\"code\">ACTIVE</span> in step 2. It goes live immediately and the previous live version is archived in the same request.</p>"
url: "https://www.contentstack.com/docs/developers/apis/personalize-management-api/experiences"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-04-24"
---

# Experiences

Experiences help you create different variations of content pages that cater to different sections of your audience. Experiences are also versioned, so that you can make draft changes on an active version of an experience. The following requests allow you to manage the Segmented and A/B Test Experiences within a project.

\## Experience version lifecycle

Every change to what an experience shows visitors goes through a \*version\*. A version has one of four statuses:

| Status | Meaning |

|---|---|

| DRAFT | Work in progress. The only status whose configuration (variants, variant split, metrics, targeting) can be edited. Not served to visitors. |

| ACTIVE | Live. Served to visitors. |

| PAUSED | A live version that is temporarily switched off. The experience matches no variants, so the Manifest API returns null. |

| ARCHIVED | A previous version that was replaced. Read-only history. |

\*\*Rules that apply to every flow below\*\*

\- An experience has at most one DRAFT and at most one live version (ACTIVE or PAUSED) at any time. Every older version is ARCHIVED.

\- Creating an experience creates an empty DRAFT version. Find its UID with Get all Experience Versions, or from the latestVersion field of the experience.

\- ACTIVE and PAUSED versions are locked. Their configuration cannot be edited in place. Only their status can change, and the request must still carry the unchanged configuration.

\- Archiving is automatic. You cannot set a version to ARCHIVED, and you cannot move an ACTIVE, PAUSED or ARCHIVED version back to DRAFT.

\- Version requests always carry the full configuration. status and variants are required, and nothing is copied from another version, so to change a live version you read it first and send the whole configuration back.

\- To activate a version, an A/B test needs at least two variants and a segmented experience needs at least one. With the CUSTOM\_PERCENTAGE split, the variant traffic must add up to 100.

\### Take a new experience live

1\. Create an Experience. An empty DRAFT version is created along with it.

2\. Get all Experience Versions and note the UID of the DRAFT version.

3\. Update an Experience Version on that draft with the full configuration. Keep status as DRAFT. Repeat as often as needed.

4\. Update an Experience Version on the same draft with the final configuration and status set to ACTIVE.

\### Pause a live version

1\. Get all Experience Versions and read the ACTIVE version.

2\. Update an Experience Version on it with status set to PAUSED and the configuration exactly as it is. Visitors stop seeing the experience.

3\. To resume, send the same request with status set to ACTIVE.

\### Edit a live experience

1\. Get all Experience Versions. Read the configuration of the live version (ACTIVE or PAUSED) and check whether a DRAFT version already exists.

2\. If there is no draft, Create an Experience Version with status set to DRAFT and the full edited configuration. Reuse the shortUid of the variants you are keeping and leave it out for new variants. If a draft already exists, this request is rejected with personalize.EXPERIENCES.VERSIONS.CANNOT\_CREATE\_VERSION\_AS\_DRAFT\_ALREADY\_EXISTS whatever status you send. Update that draft in step 3 instead, or discard it with Delete an Experience Version and create a new one.

3\. Refine the draft with Update an Experience Version as needed, or discard it with Delete an Experience Version.

4\. Update an Experience Version on the draft with status set to ACTIVE. The previous live version, whether it was ACTIVE or PAUSED, becomes ARCHIVED.

If there is no draft, you can skip steps 3 and 4 by creating the version with status set to ACTIVE in step 2. It goes live immediately and the previous live version is archived in the same request.

## Create an Experience

### Create an Experience

**POST** `/experiences`

The Create an Experience request lets you create a new experience in a project. An experience can be either of SEGMENTED or AB\_TEST type. Creating an experience also creates an empty draft version for the configuration.

To configure the permissions for your application via OAuth, include the personalize:manage scope.  
  

##### Create a Segmented Experience:

```
{
  "name": "Australian Users Experience",
  "description": "This is the experience for Australian users.",
  "__type": "SEGMENTED"
}
```

In this example, we create a Segmented Experience. The \_\_type field is used to set the type of the experience. Note that the experience in the response has a latestVersion field pointing to the draft version configuration created along with the experience.

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
{
  "shortUid": "1",
  "name": "CTA color test",
  "description": "Test if using a warmer color on the CTA improves conversions",
  "__type": "AB_TEST",
  "tags": [
    "campaign:black-friday",
    "section:homepage"
  ],
  "project": "6887777b3335554698867847",
  "status": "DRAFT",
  "createdBy": "bxxxxxxxxxxxx3",
  "updatedBy": "bxxxxxxxxxxxx6",
  "referredAudiences": [],
  "referredEvents": [],
  "createdAt": "2024-03-13T15:39:51.645Z",
  "updatedAt": "2024-03-13T15:39:51.645Z",
  "uid": "6887777xxxxxxxxx98867841",
  "hasDraft": true,
  "latestVersion": "66d5ad0000000001412ae841",
  "createdByUserName": "Jane Doe",
  "updatedByUserName": "Jane Doe"
}
```

## Get all Experiences

### Get all Experiences

**GET** `/experiences`

The Get all Experiences request fetches the list of all the experiences in a project.

To configure the permissions for your application via OAuth, include the personalize:read or personalize:manage scope.

#### Query Parameters

- **includeArchived** (optional)
  Set to true to return current and archived experiences together. When omitted or false, only current (non-archived) experiences are returned.
- **tags[]** (optional)
  Filter experiences by passing a list of tags. Experiences matching at least one of the provided tags are returned (OR semantics).
- **referredEvents[]** (optional)
  Filter experiences by passing a list of event UIDs. The experiences referring to the given events as metrics will be returned.
- **referredAudiences[]** (optional)
  Filter experiences by passing a list of audience UIDs. The experiences referring to the given audiences in its variants (for segmented experiences) or targeting criteria (for A/B test experiences) will be returned.

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
[
  {
    "shortUid": "1",
    "name": "CTA color",
    "description": "Use a warmer color on the CTA to improve conversion",
    "__type": "AB_TEST",
    "tags": [
      "campaign:black-friday",
      "section:homepage"
    ],
    "project": "6887777b3335554698867847",
    "status": "DRAFT",
    "createdBy": "bxxxxxxxxxxxx3",
    "updatedBy": "bxxxxxxxxxxxx6",
    "referredAudiences": [],
    "referredEvents": [],
    "createdAt": "2024-03-13T15:39:51.645Z",
    "updatedAt": "2024-03-14T17:00:00.000Z",
    "uid": "6887777xxxxxxxxx98867841",
    "hasDraft": true,
    "latestVersion": "66d5ad0000000001412ae841",
    "createdByUserName": "Jane Doe",
    "updatedByUserName": "Jane Doe"
  }
]
```

## Update an Experience

### Update an Experience

**PUT** `/experiences/{uid}`

The Update an Experience request lets you update an existing experience in a project. Note that once an experience of a particular type has been created, the type cannot be changed with this request.

To configure the permissions for your application via OAuth, include the personalize:manage scope.

#### URL Parameters

- **uid** (required)
  Enter the Experience UID to be updated.

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
{
  "shortUid": "1",
  "name": "CTA color",
  "description": "Use a warmer color on the CTA to improve conversion",
  "__type": "AB_TEST",
  "tags": [
    "campaign:black-friday",
    "section:homepage"
  ],
  "project": "6887777b3335554698867847",
  "status": "DRAFT",
  "createdBy": "bxxxxxxxxxxxx3",
  "updatedBy": "bxxxxxxxxxxxx6",
  "referredAudiences": [],
  "referredEvents": [],
  "createdAt": "2024-03-13T15:39:51.645Z",
  "updatedAt": "2024-03-14T17:00:00.000Z",
  "uid": "6887777xxxxxxxxx98867841",
  "hasDraft": true,
  "latestVersion": "66d5ad0000000001412ae841",
  "createdByUserName": "Jane Doe",
  "updatedByUserName": "Jane Doe"
}
```

## Get a Single Experience

### Get a Single Experience

**GET** `/experiences/{uid}`

The Get a Single Experience request fetches a specific experience created in your project.

To configure the permissions for your application via OAuth, include the personalize:read scope.

#### URL Parameters

- **uid** (required)
  Enter the Experience UID to be retrieved

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
{
  "shortUid": "1",
  "name": "CTA color",
  "description": "Use a warmer color on the CTA to improve conversion",
  "__type": "AB_TEST",
  "tags": [
    "campaign:black-friday",
    "section:homepage"
  ],
  "project": "6887777b3335554698867847",
  "status": "DRAFT",
  "createdBy": "bxxxxxxxxxxxx3",
  "updatedBy": "bxxxxxxxxxxxx6",
  "referredAudiences": [],
  "referredEvents": [],
  "createdAt": "2024-03-13T15:39:51.645Z",
  "updatedAt": "2024-03-14T17:00:00.000Z",
  "uid": "6887777xxxxxxxxx98867841",
  "hasDraft": true,
  "latestVersion": "66d5ad0000000001412ae841",
  "createdByUserName": "Jane Doe",
  "updatedByUserName": "Jane Doe"
}
```

## Delete an Experience

### Delete an Experience

**DELETE** `/experiences/{uid}`

The Delete an Experience request lets you delete an existing experience in a project.

To configure the permissions for your application via OAuth, include the personalize:manage scope.

#### URL Parameters

- **uid** (required)
  Enter the Experience UID to be deleted

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
The experience was deleted successfully
```

## Create an Experience Version

### Create an Experience Version

**POST** `/experiences/{uid}/versions`

The Create an Experience Version request lets you create a new version of an experience in a project.

Creating a new version allows you to modify the configuration of an existing active version. A version can be created with a DRAFT or ACTIVE status. A new version cannot be created if a DRAFT version already exists, in which case you can only modify the existing DRAFT version.

The request must carry the full configuration: status and variants are required. Nothing is copied from the existing version, so read the live version first and send your edited copy. Creating a version with the ACTIVE status makes it live immediately and archives the current live version (ACTIVE or PAUSED) in the same request. If a DRAFT version already exists, the request is rejected with personalize.EXPERIENCES.VERSIONS.CANNOT\_CREATE\_VERSION\_AS\_DRAFT\_ALREADY\_EXISTS whatever status is requested.

To configure the permissions for your application via OAuth, include the personalize:manage scope.  
  

##### Create a Segmented Experience version:

```
{
  "status": "DRAFT",
  "variants": [
    {
      "__type": "SegmentedVariant",
      "name": "Australian Continent Visitors",
      "shortUid": "0",
      "audiences": [
        "388888800000000087654321",
        "399999900000000044444444"
      ],
      "audienceCombinationType": "OR"
    }
  ]
}
```

In this example, we create a new DRAFT version of our segmented experience. We want to target the entire Australian continent instead of just the country, and accordingly, we also target one more audience in the variant and change the audienceCombinationType. The short UID refers to the existing variant's short UID so that we can update it.  
  

##### Create an active version:

```
{
  "status": "ACTIVE",
  "variants": [
    {
      "__type": "ABTestVariant",
      "name": "Control",
      "shortUid": "0",
      "trafficDistribution": 33.33
    },
    {
      "__type": "ABTestVariant",
      "name": "Purple",
      "shortUid": "1",
      "trafficDistribution": 33.33
    },
    {
      "__type": "ABTestVariant",
      "name": "Red",
      "trafficDistribution": 33.33
    }
  ],
  "variantSplit": "EQUALLY_SPLIT",
  "metrics": [
    {
      "__type": "Primary",
      "event": "244444400000000087654321",
      "name": "Click on CTA"
    }
  ],
  "targeting": {
    "audience": {
      "audiences": [
        "155555500000000012345678"
      ],
      "audienceCombinationType": "AND"
    }
  }
}
```

The example here is the same A/B test, however, instead of creating a DRAFT version, we're activating the version instantly. The changes in the version are instantly reflected and the existing version is ARCHIVED.

#### URL Parameters

- **uid** (required)
  Enter the Experience UID to version

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
{
  "uid": "9888888xxxxxxxxx89102123",
  "experienceUid": "688777700000000098867841",
  "__type": "AB_TEST",
  "variants": [
    {
      "__type": "ABTestVariant",
      "name": "Control",
      "shortUid": "0",
      "trafficDistribution": 33.33
    },
    {
      "__type": "ABTestVariant",
      "name": "Purple",
      "shortUid": "1",
      "trafficDistribution": 33.33
    },
    {
      "__type": "ABTestVariant",
      "name": "Red",
      "trafficDistribution": 33.33,
      "shortUid": "2"
    }
  ],
  "variantSplit": "EQUALLY_SPLIT",
  "metrics": [
    {
      "__type": "Primary",
      "event": "244444400000000087654321",
      "name": "Click on CTA"
    }
  ],
  "targeting": {
    "audience": {
      "audiences": [
        "155555500000000012345678"
      ],
      "audienceCombinationType": "AND"
    }
  },
  "status": "DRAFT",
  "createdAt": "2024-03-15T15:39:51.645Z",
  "updatedAt": "2024-03-15T15:39:51.645Z",
  "createdBy": "bxxxxxxxxxxxx3",
  "updatedBy": "bxxxxxxxxxxxx3",
  "createdByUserName": "Jane Doe",
  "updatedByUserName": "Jane Doe"
}
```

## Get all Experience Versions

### Get all Experience Versions

**GET** `/experiences/{uid}/versions`

The Get all Experience Versions request fetches the list of all the versions for a given Experience.

The list of versions is sorted by the createdAt date.

To configure the permissions for your application via OAuth, include the personalize:read or personalize:manage scope.

#### URL Parameters

- **uid** (required)
  Enter the Experience UID to version

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
[
  {
    "uid": "9888888xxxxxxxxx89102123",
    "experienceUid": "688777700000000098867841",
    "__type": "AB_TEST",
    "variants": [
      {
        "__type": "ABTestVariant",
        "name": "Control",
        "shortUid": "0",
        "trafficDistribution": 33.33
      },
      {
        "__type": "ABTestVariant",
        "name": "Purple",
        "shortUid": "1",
        "trafficDistribution": 33.33
      },
      {
        "__type": "ABTestVariant",
        "name": "Red",
        "trafficDistribution": 33.33,
        "shortUid": "2"
      }
    ],
    "variantSplit": "EQUALLY_SPLIT",
    "metrics": [
      {
        "__type": "Primary",
        "event": "244444400000000087654321",
        "name": "Click on CTA"
      }
    ],
    "targeting": {
      "audience": {
        "audiences": [
          "155555500000000012345678"
        ],
        "audienceCombinationType": "AND"
      }
    },
    "status": "DRAFT",
    "createdAt": "2024-03-15T15:39:51.645Z",
    "updatedAt": "2024-03-15T15:39:51.645Z",
    "createdBy": "bxxxxxxxxxxxx3",
    "updatedBy": "bxxxxxxxxxxxx3",
    "createdByUserName": "Jane Doe",
    "updatedByUserName": "Jane Doe"
  }
]
```

## Update an Experience Version

### Update an Experience Version

**PUT** `/experiences/{uid}/versions/{versionUid}`

The Update an Experience Version request lets you update an existing version of an Experience. After creating an Experience initially, an empty draft version is already created, and you can update it to modify the configuration of the Experience. Once the configuration is ready, you can activate the version by updating the status to ACTIVE. Any existing live version (ACTIVE or PAUSED) will change to ARCHIVED. You can also PAUSE an active version with this request.

The request must carry the full configuration: status and variants are required. Only a DRAFT version's configuration can be edited. On an ACTIVE or PAUSED version only the status can change, and the configuration in the request must match the stored one. To pause or resume, send the version back unchanged with the new status.

\*\*Allowed status changes\*\*

| From | To | Result |

|---|---|---|

| DRAFT | DRAFT | The configuration is updated. |

| DRAFT | ACTIVE | The version goes live and the previous live version becomes ARCHIVED. |

| ACTIVE | PAUSED | Visitors stop seeing the experience. |

| PAUSED | ACTIVE | The experience resumes. |

Every other change is rejected.

| Condition | Error code |

|---|---|

| Editing the configuration of an ACTIVE or PAUSED version | personalize.EXPERIENCES.VERSIONS.CANNOT\_UPDATE\_LOCKED\_VERSION |

| Setting the status to ARCHIVED | personalize.EXPERIENCES.VERSIONS.CANNOT\_MANUALLY\_ARCHIVE\_VERSION |

| Moving an ACTIVE or PAUSED version back to DRAFT | personalize.EXPERIENCES.VERSIONS.CANNOT\_MARK\_VERSION\_AS\_DRAFT |

| Pausing a DRAFT version | personalize.EXPERIENCES.VERSIONS.CANNOT\_PAUSE\_INACTIVE\_VERSION |

| Updating an ARCHIVED version | personalize.EXPERIENCES.VERSIONS.CANNOT\_UPDATE\_ARCHIVED\_VERSION |

| Activating with too few variants | personalize.EXPERIENCES.VERSIONS.INSUFFICIENT\_VARIANTS\_TO\_ACTIVATE |

| CUSTOM\_PERCENTAGE split that does not add up to 100 | personalization.VARIANT.INVALID\_PERCENTAGE\_SUM |

To configure the permissions for your application via OAuth, include the personalize:manage scope.  
  

##### Update a Segmented Experience version:

```
{
  "status": "DRAFT",
  "variants": [
    {
      "__type": "SegmentedVariant",
      "name": "Australian Visitors",
      "audiences": [
        "388888800000000087654321"
      ],
      "audienceCombinationType": "AND"
    }
  ]
}
```

In this example, we update the configuration for the Segmented Experience created previously. We're creating a variant for the visitors from Australia, with the variant targeted to the Australian audience. Notice that the shortUid is skipped for the new variant as it will be generated on the server side.  
  

##### Activate a version:

```
{
  "status": "ACTIVE",
  "variants": [
    {
      "__type": "ABTestVariant",
      "name": "Control",
      "trafficDistribution": 50
    },
    {
      "__type": "ABTestVariant",
      "name": "Purple",
      "trafficDistribution": 50
    }
  ],
  "variantSplit": "EQUALLY_SPLIT",
  "metrics": [
    {
      "__type": "Primary",
      "event": "244444400000000087654321",
      "name": "Click on CTA"
    }
  ]
}
```

Activating a version is done by updating the status to ACTIVE. Any existing active version will be ARCHIVED following the activation of a new version.  
  

##### Pause a version:

```
{
  "status": "PAUSED",
  "variants": [
    {
      "__type": "ABTestVariant",
      "name": "Control",
      "trafficDistribution": 50
    },
    {
      "__type": "ABTestVariant",
      "name": "Purple",
      "trafficDistribution": 50
    }
  ],
  "variantSplit": "EQUALLY_SPLIT",
  "metrics": [
    {
      "__type": "Primary",
      "event": "244444400000000087654321",
      "name": "Click on CTA"
    }
  ]
}
```

Pausing a version is achieved by updating the status to PAUSED. Once paused, the experience does not match any variants and will return null in the Manifest API. You can also re-activate the version again by updating it with the ACTIVE status. As with any update, the request must carry the full, unchanged configuration of the version.

#### URL Parameters

- **versionUid** (required)
  Enter the Experience Version UID
- **uid** (required)
  Enter the Experience UID to version

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
{
  "uid": "9888888xxxxxxxxx89102123",
  "experienceUid": "688777700000000098867841",
  "__type": "AB_TEST",
  "variants": [
    {
      "__type": "ABTestVariant",
      "name": "Control",
      "trafficDistribution": 50,
      "shortUid": "0"
    },
    {
      "__type": "ABTestVariant",
      "name": "Purple",
      "trafficDistribution": 50,
      "shortUid": "1"
    }
  ],
  "variantSplit": "EQUALLY_SPLIT",
  "metrics": [
    {
      "__type": "Primary",
      "event": "244444400000000087654321",
      "name": "Click on CTA"
    }
  ],
  "status": "DRAFT",
  "createdAt": "2024-03-13T15:39:51.645Z",
  "updatedAt": "2024-03-14T15:39:51.645Z",
  "createdBy": "bxxxxxxxxxxxx3",
  "updatedBy": "bxxxxxxxxxxxx3",
  "createdByUserName": "Jane Doe",
  "updatedByUserName": "Jane Doe"
}
```

## Delete an Experience Version

### Delete an Experience Version

**DELETE** `/experiences/{uid}/versions/{versionUid}`

The Delete an Experience Version request lets you discard the draft version of an Experience. Attempting to delete an ACTIVE, PAUSED or ARCHIVED version will return an error. Only a DRAFT version can be deleted: any other status is rejected with personalize.EXPERIENCES.VERSIONS.CANNOT\_DELETE\_LOCKED\_VERSION. A draft can only be deleted once the experience has a live version (ACTIVE or PAUSED). Until then, any draft, including one that has been configured, is rejected with personalize.EXPERIENCES.VERSIONS.CANNOT\_DELETE\_ONLY\_DRAFT.

To configure the permissions for your application via OAuth, include the personalize:manage scope.

#### URL Parameters

- **versionUid** (required)
  Enter the Experience Version UID
- **uid** (required)
  Enter the Experience UID to version

#### Headers

- **authorization** (optional)
  Enter your OAuth token here. Read more: https://www.contentstack.com/docs/developers/developer-hub/contentstack-oauth
- **authtoken** (optional)
  Enter your authtoken here. Read more: https://www.contentstack.com/docs/developers/create-tokens/types-of-tokens#authentication-tokens-authtokens
- **x-project-uid** (required)

#### Sample Response

```json
The Experience Version was deleted successfully
```