Get inspired at ContentCon. Learn more and register today
Get inspired at ContentCon. Learn more and register today
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Content Management API
  4. Variant Groups

Variant Groups

markdownView as Markdown

Variants in Contentstack provides an overview of variant groups and linked content types, which are used for content personalization. Linking content types to variant groups allows you to create entry variants.

A variant group is a collection of variants that share the same set of linked content types. Every variant belongs to a variant group and inherits the content types linked to that group, which is what makes the variant available on entries of those content types.

Note

  • The Variants feature may not be available by default to all organizations. Reach out to our support team to get it enabled.
  • When a variant group is linked to a Personalize experience, Personalize owns the group name, its variants, and the personalize_metadata object. Those properties are read-only through the Content Management API, and you cannot delete a linked variant group or variant until you delete the corresponding experience or variation in Personalize.

Create variant group

POSThttps://api.contentstack.io/v3/variant_groups

The Create variant group request lets you create a variant group in your stack. A variant group is a collection of variants that share the same set of linked content types, and every variant that you create inside the group inherits those content types.

In the “Body” section, pass the following parameters:

  • name (required): Enter a unique name for your variant group.
  • uid (optional): Enter a custom unique ID for your variant group. You cannot change this value later.
  • description (optional): Enter a description for your variant group.
  • content_types (optional): An array of content type UIDs to link to the variant group.

Note

  • The Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.
  • If you do not pass the content_types parameter, Contentstack links all the content types in your stack to the variant group.
  • If you do not pass a uid, Contentstack generates one for you. You cannot change the UID after you create the variant group.
Sample Request
12345678
{
    "name": "Variant-Group-1",
    "description": "Regional variants for product pages",
    "content_types": [
        "mobile",
        "laptop"
    ]
}
Sample Response
Status|201 Created
12345678910111213141516171819202122
{
    "name": "Variant-Group-1",
    "description": "Regional variants for product pages",
    "uid": "cs**************43",
    "content_types": [
        {
            "uid": "mobile",
            "status": "linked"
        },
        {
            "uid": "laptop",
            "status": "linked"
        }
    ],
    "branches": [
        "main"
    ],
    "created_by": "blt**************59",
    "updated_by": "blt**************59",
    "created_at": "2026-08-25T10:00:00.000Z",
    "updated_at": "2026-08-25T10:00:00.000Z"
}

Get all variant groups

GEThttps://api.contentstack.io/v3/variant_groups?skip=0&limit=30&include_count=true&include_variant_info=true&include_variant_count=true&desc=created_at&content_type={your_content_type_uid}

The Get all variant groups request returns a list of all variant groups linked to your stack. To retrieve the variant UIDs specific to a content type, include the content_type query parameter with the content type UID in your request.

Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
{
    "variant_groups": [
        {
            "name": "region",
            "created_by": "blt**************59",
            "updated_by": "blt**************59",
            "uid": "cs**************43",
            "branches": [
                "main"
            ],
            "content_types": [
                {
                    "uid": "mobile",
                    "status": "linked"
                },
                {
                    "uid": "laptop",
                    "status": "linked"
                }
            ],
            "created_at": "2024-08-20T10:31:07.092Z",
            "updated_at": "2024-08-20T10:31:07.092Z"
        },
        {
            "name": "Variant-Group-test-ct",
            "created_by": "blt**************9e",
            "updated_by": "blt**************33",
            "uid": "cs8**************b6",
            "content_types": [
                {
                    "uid": "testing_variant_cases",
                    "status": "linked"
                },
                {
                    "uid": "test_reference",
                    "status": "linked"
                },
                {
                    "uid": "test",
                    "status": "linked"
                }
            ],
            "created_at": "2024-08-21T10:10:29.494Z",
            "updated_at": "2024-08-22T11:30:48.669Z",
            "description": "",
            "variant_count": 3,
            "variants": [
                {
                    "uid": "cs1**************67",
                    "created_by": "blt**************33",
                    "updated_by": "blt**************33",
                    "name": "test",
                    "created_at": "2024-08-22T11:30:48.774Z",
                    "updated_at": "2024-08-22T11:30:48.774Z"
                },
                {
                    "uid": "cs3**************8f",
                    "created_by": "blt**************33",
                    "updated_by": "blt**************33",
                    "name": "test 2",
                    "created_at": "2024-08-22T11:30:48.978Z",
                    "updated_at": "2024-08-22T11:30:48.978Z"
                },
                {
                    "uid": "cs3d901397291171c0",
                    "created_by": "blt**************33",
                    "updated_by": "blt**************33",
                    "name": "test 3",
                    "created_at": "2024-08-22T11:30:48.979Z",
                    "updated_at": "2024-08-22T11:30:48.979Z"
                }
            ]
        },
        {
            "content_types": [
                {
                    "uid": "vigor",
                    "status": "linked"
                },
                {
                    "uid": "tsyuio",
                    "status": "linked"
                }
            ],
            "name": "test segmentated",
            "personalize_metadata": {
                "project_uid": "660bc**************31ac",
                "experience_uid": "660bd**************431ba",
                "experience_short_uid": "0",
                "status": "linked"
            },
            "created_by": null,
            "updated_by": "blt**************1a",
            "uid": "cse**************e2",
            "created_at": "2024-08-22T11:41:36.588Z",
            "updated_at": "2024-08-22T13:07:10.907Z",
            "variant_count": 2,
            "variants": [
                {
                    "uid": "csf**************7d",
                    "created_by": null,
                    "updated_by": "blt**************1a",
                    "name": "Country",
                    "variant_group_uid": "cse**************e2",
                    "personalize_metadata": {
                        "project_uid": "660bc**************31ac",
                        "experience_uid": "660bd**************31ba",
                        "experience_short_uid": "0",
                        "status": "linked",
                        "variant_short_uid": "1"
                    },
                    "alias": "cs_personalize_0_1",
                    "created_at": "2024-08-22T11:41:36.602Z",
                    "updated_at": "2024-08-22T13:07:11.069Z"
                },
                {
                    "uid": "cs8**************5e",
                    "created_by": null,
                    "updated_by": "blt**************1a",
                    "name": "test",
                    "variant_group_uid": "cse**************e2",
                    "personalize_metadata": {
                        "project_uid": "660bc**************31ac",
                        "experience_uid": "660bd**************31ba",
                        "experience_short_uid": "0",
                        "status": "linked",
                        "variant_short_uid": "0"
                    },
                    "alias": "cs_personalize_0_0",
                    "created_at": "2024-08-22T11:41:36.603Z",
                    "updated_at": "2024-08-22T13:07:11.088Z"
                }
            ]
        }
    ]
}

Update variant group

PUThttps://api.contentstack.io/v3/variant_groups/{variant_group_uid}

The Update variant group request lets you rename a variant group, change its description, and link or unlink content types. Pass at least one of the body parameters below.

In the “Body” section, pass the following parameters:

  • name (optional): Enter a new unique name for your variant group.
  • description (optional): Enter a new description for your variant group.
  • content_types (optional): An array of objects, each identifying one content type through its uid and its link status. Set the status to either linked or unlinked.

Unlinking a content type does not delete the entry variants that already exist for it, but it does prevent you from creating new entry variants for that content type.

Note

  • The Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.
  • You cannot change the uid of a variant group after you create it.
  • The personalize_metadata object is managed by Personalize and is read-only through the Content Management API.
Sample Request
12345678910111213
{
    "name": "Variant-Group-1-Updated",
    "content_types": [
        {
            "uid": "mobile",
            "status": "linked"
        },
        {
            "uid": "laptop",
            "status": "unlinked"
        }
    ]
}
Sample Response
Status|200 OK
123456789101112131415161718192021
{
    "name": "Variant-Group-1-Updated",
    "uid": "cs**************43",
    "content_types": [
        {
            "uid": "mobile",
            "status": "linked"
        },
        {
            "uid": "laptop",
            "status": "unlinked"
        }
    ],
    "branches": [
        "main"
    ],
    "created_by": "blt**************59",
    "updated_by": "blt**************33",
    "created_at": "2026-08-25T10:00:00.000Z",
    "updated_at": "2026-08-25T10:20:00.000Z"
}

Delete variant group

DELETEhttps://api.contentstack.io/v3/variant_groups/{variant_group_uid}

The Delete variant group request lets you delete a variant group from your stack.

WarningDeleting a variant group also deletes every variant inside that group. The entry variants that belong to those variants are unpublished and removed from your entries.

Note

  • The Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.
  • You cannot delete a variant group while it is linked to a Personalize experience. Delete the experience in Personalize first, which unlinks the variant group and makes it available for deletion.
Sample Response
Status|200 OK
123
{
    "notice": "Variant group deleted successfully."
}

Link content types

PUThttps://api.contentstack.io/v3/variant_groups/{variant_group_uid}/variants

The Link content types request allows you to link content types to your variant group.

In the “Body” section, enter the content type UID(s) in the following format:

        {
"uid": "content_type_uid_1",
"status": "linked"
},
{
"uid": "content_type_uid_2",
"status": "linked"
}
Sample Request
12345678910111213141516
{
    "content_types": [
        {
            "uid": "content_type_uid_1",
            "status": "linked"
        },
        {
            "uid": "content_type_uid_2",
            "status": "linked"
        }
    ],
    "uid": "csd**************03",
    "branches": [
        "main"
    ]
}
Sample Response
Status|200 OK
1234567891011121314151617181920212223242526
{
    "content_types": [
        {
            "uid": "content_type_uid_1",
            "status": "linked"
        },
        {
            "uid": "content_type_uid_2",
            "status": "linked"
        }
    ],
    "name": "Variant-Group-Name",
    "personalize_metadata": {
        "project_uid": "660bc**************31ac",
        "experience_uid": "660bd**************31ba",
        "experience_short_uid": "0",
        "status": "linked"
    },
    "created_by": "blt**************9e",
    "updated_by": "blt**************1a",
    "uid": "csd**************03",
    "created_at": "2024-05-22T05:56:15.393Z",
    "updated_at": "2024-09-06T09:04:19.758Z",
    "message": "Variant Group and Variants updated successfully",
    "variants": []
}

Unlink content types

PUThttps://api.contentstack.io/v3/variant_groups/{variant_group_uid}/variants

The Unlink content types request allows you to unlink content types to your variant group.

In the “Body” section, enter the content type UID(s) in the following format:

        {
"uid": "content_type_uid_1",
"status": "unlinked"
},
{
"uid": "content_type_uid_2",
"status": "unlinked"
}
Sample Request
12345678910111213141516
{
    "content_types": [
        {
            "uid": "content_type_uid_1",
            "status": "unlinked"
        },
        {
            "uid": "content_type_uid_2",
            "status": "unlinked"
        }
    ],
    "uid": "csd**************03",
    "branches": [
        "main"
    ]
}
Sample Response
Status|200 OK
1234567891011121314151617181920212223242526
{
    "content_types": [
        {
            "uid": "content_type_uid_1",
            "status": "unlinked"
        },
        {
            "uid": "content_type_uid_2",
            "status": "unlinked"
        }
    ],
    "name": "Variant-Group-Name",
    "personalize_metadata": {
        "project_uid": "660bc**************31ac",
        "experience_uid": "660bd**************31ba",
        "experience_short_uid": "0",
        "status": "linked"
    },
    "created_by": "blt**************9e",
    "updated_by": "blt**************1a",
    "uid": "csd**************03",
    "created_at": "2024-05-22T05:56:15.393Z",
    "updated_at": "2024-09-06T09:04:19.758Z",
    "message": "Variant Group and Variants updated successfully",
    "variants": []
}

Create variant

POSThttps://api.contentstack.io/v3/variant_groups/{variant_group_uid}/variants

The Create variant request lets you create a variant inside an existing variant group. The variant inherits every content type linked to that group, which makes it available on entries of those content types.

In the “Body” section, pass the following parameters:

  • name (required): Enter a name for your variant. The name must be unique within the variant group.
  • uid (optional): Enter a custom unique ID for your variant. You cannot change this value later.

Note

  • The Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.
  • Contentstack recommends that you pass a custom uid, because you use this UID later to fetch and customize entry variants. If you omit it, Contentstack generates one for you.
  • To create a variant that does not belong to any variant group, send the same request body to POST /variants instead.
Sample Request
1234
{
    "uid": "region_north_america",
    "name": "North America"
}
Sample Response
Status|201 Created
123456789101112
{
    "uid": "region_north_america",
    "name": "North America",
    "variant_group_uid": "cs**************43",
    "branches": [
        "main"
    ],
    "created_by": "blt**************59",
    "updated_by": "blt**************59",
    "created_at": "2026-08-25T10:05:00.000Z",
    "updated_at": "2026-08-25T10:05:00.000Z"
}

Get all variants in a variant group

GEThttps://api.contentstack.io/v3/variant_groups/{variant_group_uid}/variants?skip=0&limit=30&include_count=true&desc=created_at

The Get all variants in a variant group request returns the variant group along with every variant that belongs to it.

NoteThe Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.

Sample Response
Status|200 OK
1234567891011121314151617181920212223242526272829
{
    "uid": "cs**************43",
    "name": "Variant-Group-1",
    "content_types": [
        {
            "uid": "mobile",
            "status": "linked"
        }
    ],
    "variants": [
        {
            "uid": "region_north_america",
            "name": "North America",
            "created_by": "blt**************59",
            "updated_by": "blt**************59",
            "created_at": "2026-08-25T10:05:00.000Z",
            "updated_at": "2026-08-25T10:05:00.000Z"
        },
        {
            "uid": "region_europe",
            "name": "Europe",
            "created_by": "blt**************59",
            "updated_by": "blt**************59",
            "created_at": "2026-08-25T10:06:00.000Z",
            "updated_at": "2026-08-25T10:06:00.000Z"
        }
    ],
    "count": 2
}

Get single variant

GEThttps://api.contentstack.io/v3/variants/{variant_uid}

The Get single variant request returns the details of a specific variant. If the variant belongs to a variant group, the response also includes a summary of that group under variant_group.

To fetch several variants in one call, pass the uids query parameter once for each variant, for example /variants?uids=cs**************43&uids=cs**************5e. The response then returns the matching variants in a variants array.

NoteThe Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.

Sample Response
Status|200 OK
123456789101112131415161718
{
    "uid": "region_north_america",
    "name": "North America",
    "created_by": "blt**************59",
    "updated_by": "blt**************59",
    "created_at": "2026-08-25T10:05:00.000Z",
    "updated_at": "2026-08-25T10:05:00.000Z",
    "variant_group": {
        "uid": "cs**************43",
        "name": "Variant-Group-1",
        "content_types": [
            {
                "uid": "mobile",
                "status": "linked"
            }
        ]
    }
}

Update variant

PUThttps://api.contentstack.io/v3/variants/{variant_uid}

The Update variant request lets you rename a variant. The name is the only property of a variant that you can change.

In the “Body” section, pass the name parameter (required) with a new name for your variant. The name must be unique within the variant group.

Note

  • The Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.
  • You cannot change the uid of a variant after you create it.
  • To scope the request to a variant group, use /variant_groups/{variant_group_uid}/variants/{variant_uid} instead. Contentstack then returns an error if the variant does not belong to that group.
Sample Request
123
{
    "name": "North America - East"
}
Sample Response
Status|200 OK
123456789101112
{
    "uid": "region_north_america",
    "name": "North America - East",
    "variant_group_uid": "cs**************43",
    "branches": [
        "main"
    ],
    "created_by": "blt**************59",
    "updated_by": "blt**************33",
    "created_at": "2026-08-25T10:05:00.000Z",
    "updated_at": "2026-08-25T10:22:00.000Z"
}

Delete variant

DELETEhttps://api.contentstack.io/v3/variants/{variant_uid}

The Delete variant request lets you delete a single variant without deleting the variant group it belongs to.

WarningDeleting a variant unpublishes and removes the entry variants that editors created for it.

Note

  • The Variants feature is currently available as part of an Early Access Program and may not be available to all users. For more information, you can reach out to our support team.
  • You cannot delete a variant while it is linked to a variation in a Personalize experience. Delete the variation in Personalize first, which unlinks the variant and makes it available for deletion.
  • To scope the request to a variant group, use /variant_groups/{variant_group_uid}/variants/{variant_uid} instead. Contentstack then returns an error if the variant does not belong to that group.
Sample Response
Status|200 OK
123
{
    "notice": "Variant deleted successfully."
}
Hide Parameters

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Content-Typerequiredstring

Pass application/json value.

Example:

application/json
Hide Parameters

Query Parameters

skipoptionalstring

Enter the number of items to be skipped from the response body.

Example:

2
limitoptionalstring

Enter the maximum number of items to be returned.

Example:

4
include_countoptionalstring

Set this parameter to “true” to include the total count of variant groups.

Example:

true
include_variant_infooptionalstring

Set this parameter to “true” to include the variant information.

Example:

true
include_variant_countoptionalstring

Set this parameter to “true” to include the total count of variants within a variant group.

Example:

true
ascoptionalstring

Sort the response in ascending order. Options include created_at and name.

Example:

created_at
descoptionalstring

Sort the response in descending order. Options include created_at and name.

Example:

name
content_typeoptionalstring

Enter the unique ID of your content type.

Example:

your_content_type_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Hide Parameters

URL Parameters

variant_group_uidrequiredstring

Enter the unique ID for your variant group.

Example:

your_variant_group_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Content-Typerequiredstring

Pass application/json value.

Example:

application/json
Hide Parameters

URL Parameters

variant_group_uidrequiredstring

Enter the unique ID for your variant group.

Example:

your_variant_group_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Hide Parameters

URL Parameters

variant_group_uidrequiredstring

Enter the unique ID for your variant group.

Example:

your_variant_group_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Content-Typerequiredstring

Pass application/json value.

Example:

application/json
Hide Parameters

URL Parameters

variant_group_uidrequiredstring

Enter the unique ID for your variant group.

Example:

your_variant_group_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Content-Typerequiredstring

Pass application/json value.

Example:

application/json
Hide Parameters

URL Parameters

variant_group_uidrequiredstring

Enter the unique ID for your variant group.

Example:

your_variant_group_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Content-Typerequiredstring

Pass application/json value.

Example:

application/json
Hide Parameters

URL Parameters

variant_group_uidrequiredstring

Enter the unique ID for your variant group.

Example:

your_variant_group_uid

Query Parameters

skipoptionalstring

Enter the number of items to be skipped from the response body.

Example:

0
limitoptionalstring

Enter the maximum number of items to be returned.

Example:

30
include_countoptionalstring

Set this parameter to “true” to include the total count of variants in the variant group.

Example:

true
ascoptionalstring

Sort the response in ascending order. Options include name, created_at, and updated_at.

Example:

created_at
descoptionalstring

Sort the response in descending order. Options include name, created_at, and updated_at.

Example:

created_at

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Hide Parameters

URL Parameters

variant_uidrequiredstring

Enter the unique ID of your variant.

Example:

your_variant_uid

Query Parameters

uidsoptionalstring

Enter the unique ID of a variant to fetch. Pass this parameter once for each variant you want to retrieve, and omit variant_uid from the path.

Example:

your_variant_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Hide Parameters

URL Parameters

variant_uidrequiredstring

Enter the unique ID of your variant.

Example:

your_variant_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token
Content-Typerequiredstring

Pass application/json value.

Example:

application/json
Hide Parameters

URL Parameters

variant_uidrequiredstring

Enter the unique ID of your variant.

Example:

your_variant_uid

Headers

api_keyrequiredstring

Enter the API key of the stack.

Example:

your_stack_api_key
authtokenoptionalstring

Enter your authtoken.

Example:

your_authtoken
authorizationrequiredstring

Enter your management token.

Example:

your_management_token