Contentstack introduces the Agentic Experience Platform | Press release
Contentstack introduces the Agentic Experience Platform | Press release
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs
  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing
  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases
  • 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
  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support
  • Overview
  • Find a partner
  • Login
  • About us
  • News
  • Customer support portal
  • Contact
  • Facebook
  • LinkedIn
  • Instagram
  • Github
  • Youtube
  • Discord
  • X

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.

AI Assistant

Ask a question below...

infoAI responses may contain mistakes.
/
  1. Home
  2. APIs
  3. Content Delivery API
  4. Entry Variants

Entry Variants

markdownView as Markdown

Entry Variants allows you to create content variations for different audiences, languages, and marketing experiments. The key concepts include Base Entry, Entry Variant, and Variant Group. This feature streamlines personalized content management, improves consistency, and simplifies updates.

Note: The Entry 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.

Get all entry variants

GEThttps://cdn.contentstack.io/v3/content_types/{content_type_uid}/entries

The Get all entry variants retrieves all variants of a given entry and their customizations.

Pass your variant UID(s) or aliases in the x-cs-variant-uid header to get all the variants applied to the entries.

NoteBy default you can add up to 3 variant UIDs or aliases (comma-separated) simultaneously. The limit can vary based on your organization plan. The variant UID or alias added first takes priority and will be applied to the base entry fields. For example, if you pass UIDs for Red, Green, and Blue variants in that order, the Red variant will have the highest priority. Sample header request, x-cs-variant-uid: cs6c42daef493fb432, cs7697ce80c9bbcc3e, cs8697ce80c9bbcc4f or x-cs-variant-uid: cs_personalize_0_0, cs_personalize_0_1, cs_personalize_0_2.

You can add other queries to extend the functionality of this API call.

Note
  • The API timeout for entry variants is capped at 10 seconds
  • The maximum response document size for all entry variants is 10 MB

When using Delivery Tokens

  • Fetches ONLY published content
  • Passing the environment as a query parameter is optional but recommended to ensure that the CDN delivers the most recent content
  • Locale is optional
    • If no locale is specified, it returns the entry from the master locale
    • If you specify a locale in the query, it returns the latest published version of the localized entry/entries
    • If an entry is not localized, make use of the include_fallback=true query parameter to fetch the published content from its fallback locale

TipThis request returns only the first 100 entries of the specified content type. Refer to the Pagination section to retrieve the rest of your entries in a paginated form.

Error Handling

If the number of variants exceeds the configured limit:

  • The API processes only up to the allowed limit.
  • Pass the show_errors=true query parameter to include an errors array describing the truncation.
  • If show_errors is false or not set, the errors key is omitted.

Sample response when the show_errors=true query parameter is passed and allowed variant limit is exceeded:

{
  "entries": [ ... ],
  "errors": [
    {
      "code": "VARIANT_LIMIT_EXCEEDED",
      "message": "x-cs-variant-uid should not be greater than {{your_set_limit}}",
      "details": {
        "provided_count": 7,
        "limit": {{your_set_limit}},
        "applied_count": {{your_set_limit}}
      }
    }
  ]
}
Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
{
    "entries": [
        {
            "_version": 3,
            "locale": "en-us",
            "uid": "blt492d7ae2f81ee5fd",
            "ACL": {},
            "_in_progress": false,
            "created_at": "2024-09-25T09:41:26.807Z",
            "created_by": "blt6fe92749b66ad81a",
            "group": [
                {
                    "single_line": "Variant 2",
                    "multi_line": "Variant 2 Multi",
                    "_metadata": {
                        "uid": "cs5bafacf1e94ff8c2"
                    }
                },
                {
                    "single_line": "Variant 1",
                    "multi_line": "Variant 1 Multi",
                    "_metadata": {
                        "uid": "csc30ef8fdc0b190fe"
                    }
                }
            ],
            "tags": [],
            "title": "Testhghghhgh",
            "updated_at": "2024-09-25T09:44:25.673Z",
            "updated_by": "blt6fe92749b66ad81a",
            "publish_details": {
                "environment": "blt0c46fa6bf0ebbc8f",
                "locale": "en-us",
                "time": "2024-09-25T11:25:12.450Z",
                "user": "blt6fe92749b66ad81a",
                "variants": {
                    "3439b92ff6b5406ab559e7e7f246a49b": {
                        "time": "2024-09-25T12:43:11.986Z",
                        "user": "blt3d9f7cdb9bffaa6a",
                        "environment": "blt0c46fa6bf0ebbc8f",
                        "locale": "en-us"
                    }
                }
            }
        }
    ],
    "count": 1
}

Get single entry variant

GEThttps://cdn.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}

The Get single entry variant request retrieves a single variant entry of a given base entry.

Pass your variant UID(s) or aliases in the x-cs-variant-uid header to get all the variants applied to the entries.

NoteBy default you can add up to 3 variant UIDs or aliases (comma-separated) simultaneously. The limit can vary based on your organization plan. The variant UID or alias added first takes priority and will be applied to the base entry fields. For example, if you pass UIDs for Red, Green, and Blue variants in that order, the Red variant will have the highest priority. Sample header request, x-cs-variant-uid: cs6c42daef493fb432, cs7697ce80c9bbcc3e, cs8697ce80c9bbcc4f or x-cs-variant-uid: cs_personalize_0_0, cs_personalize_0_1, cs_personalize_0_2.

You can add other queries to extend the functionality of this API call.

Note
  • The API timeout for entry variants is capped at 10 seconds
  • The maximum response document size for all entry variants is 10 MB

When using Delivery Tokens

  • Fetches ONLY published content
  • Passing the environment as a query parameter is optional but recommended to ensure that the CDN delivers the most recent content
  • Locale is optional
    • If no locale is specified, it returns the entry from the master locale
    • If you specify a locale in the query, it returns the latest published version of the localized entry/entries
    • If an entry is not localized, make use of the include_fallback=true query parameter to fetch the published content from its fallback locale

TipThis request returns only the first 100 entries of the specified content type. Refer to the Pagination section to retrieve the rest of your entries in a paginated form.

Error Handling

If the number of variants exceeds the configured limit:

  • The API processes only up to the allowed limit.
  • Pass the show_errors=true query parameter to include an errors array describing the truncation.
  • If show_errors is false or not set, the errors key is omitted.

Sample response when the show_errors=true query parameter is passed and allowed variant limit is exceeded:

{
  "entries": [ ... ],
  "errors": [
    {
      "code": "VARIANT_LIMIT_EXCEEDED",
      "message": "x-cs-variant-uid should not be greater than {{your_set_limit}}",
      "details": {
        "provided_count": 7,
        "limit": {{your_set_limit}},
        "applied_count": {{your_set_limit}}
      }
    }
  ]
}
Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445
{
    "entry": {
        "_version": 3,
        "locale": "en-us",
        "uid": "blt492d7ae2f81ee5fd",
        "ACL": {},
        "_in_progress": false,
        "created_at": "2024-09-25T09:41:26.807Z",
        "created_by": "blt6fe92749b66ad81a",
        "group": [
            {
                "single_line": "Variant 2",
                "multi_line": "Variant 2 Multi",
                "_metadata": {
                    "uid": "cs5bafacf1e94ff8c2"
                }
            },
            {
                "single_line": "Variant 1",
                "multi_line": "Variant 1 Multi",
                "_metadata": {
                    "uid": "csc30ef8fdc0b190fe"
                }
            }
        ],
        "tags": [],
        "title": "Testhghghhgh",
        "updated_at": "2024-09-25T09:44:25.673Z",
        "updated_by": "blt6fe92749b66ad81a",
        "publish_details": {
            "environment": "blt0c46fa6bf0ebbc8f",
            "locale": "en-us",
            "time": "2024-09-25T11:25:12.450Z",
            "user": "blt6fe92749b66ad81a",
            "variants": {
                "3439b92ff6b5406ab559e7e7f246a49b": {
                    "time": "2024-09-25T12:43:11.986Z",
                    "user": "blt3d9f7cdb9bffaa6a",
                    "environment": "blt0c46fa6bf0ebbc8f",
                    "locale": "en-us"
                }
            }
        }
    }
}
Hide Parameters

URL Parameters

content_type_uidrequiredstring

Enter the unique ID of the content type of which you want to retrieve the entries. The UID is often based on the title of the content type and it is unique across a stack.

Example:

home_page

Query Parameters

environmentoptionalstring

Enter the environment scoped to your delivery token. For example, if your delivery token is scoped to the production environment, pass the value as production.

Example:

production
localeoptionalstring

Enter the code of the language of which the entries needs to be included. Only the entries published in this locale will be displayed.

Example:

en
include_fallbackoptionalstring

Enter 'true' to include the published localized content from the fallback locale when the specified locale does not contain published content.

Example:

true
include_publish_detailsoptionalstring

Enter “true” to include the publish details of the entry.

Example:

true
include_rulesoptionalstring

Enter “true” to include the publishing rules for the entry.

Example:

true
include_metadataoptionalstring

Pass this as "true" to fetch the metadata attached to each entry.

Example:

true
show_errorsoptionalstring

Pass this as true to include the errors array in the response.

Example:

true

Headers

api_keyrequiredstring

Enter the API key of your stack.

Example:

blte5318f6d4fcd10db
access_tokenrequiredstring

Enter the environment-specific delivery token of your stack. Check Authentication.

Example:

csdb72e2bdb75536c727b9129d
x-cs-variant-uidrequiredstring

Enter the variant UID linked with your content type.

Example:

csa639040f051b6db6, csbf165536748bdee2, cs619c85c94f383934, cs669f1759b774fe1d
Hide Parameters

URL Parameters

content_type_uidrequiredstring

Enter the unique ID of the content type of which you want to retrieve the entries. The UID is often based on the title of the content type and it is unique across a stack.

Example:

home_page
entry_uidrequiredstring

Enter the unique ID of your entry.

Example:

blt3e91e3812a44ba90

Query Parameters

environmentoptionalstring

Enter the environment scoped to your delivery token. For example, if your delivery token is scoped to the production environment, pass the value as production.

Example:

production
localeoptionalstring

Enter the code of the language of which the entries needs to be included. Only the entries published in this locale will be displayed.

Example:

en
include_fallbackoptionalstring

Enter “true” to include the published localized content from the fallback locale when the specified locale does not contain published content.

Example:

true
include_publish_detailsoptionalstring

Enter “true” to include the publish details of the entry.

Example:

true
include_rulesoptionalstring

Enter “true” to include the publishing rules for the entry.

Example:

true
include_metadataoptionalstring

Pass this as "true" to fetch the metadata attached to each entry.

Example:

true
show_errorsoptionalstring

Pass this as true to include the errors array in the response.

Example:

true

Headers

api_keyrequiredstring

Enter the API key of your stack.

Example:

blte5318f6d4fcd10db
access_tokenrequiredstring

Enter the environment-specific delivery token of your stack. Check Authentication.

Example:

csdb72e2bdb75536c727b9129d
x-cs-variant-uidrequiredstring

Enter the variant UID linked with your content type.

Example:

csa639040f051b6db6, csbf165536748bdee2, cs619c85c94f383934, cs669f1759b774fe1d