Entry Variants
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.
NoteThe 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.
Create entry variant
https://api.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}/variants/{variant_uid}The Create entry variant request lets you create an entry variant of your existing base entry.
NoteYou must have variant groups linked to relevant content type(s). If you have not linked your content types to a variant group yet, refer to the Link Content Type request.
In the “Body” section, include only the fields that require updating for the entry variant. The system detects changes automatically based on the values provided. All other fields inherit their values from the base entry. For Group and Modular Blocks fields with multiple instances, use the _order property to define the preferred sequence of instance UIDs.
{
"entry": {
"title": "red",
"url": "/red",
"single_line": "Red variant",
"group": [
{
"single_line": "Red variant group 1",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
}
},
{
"single_line": "Red variant group 2",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
}
}
],
"_variant": {
"_order": [
{
"group": [
"base.csc30ef8fdc0b190fe",
"base.cs5bafacf1e94ff8c2"
]
}
]
}
}
}Note:
- The _change_set field is automatically included in the response to indicate which fields were updated in the entry variant.
- The system also detects changes in nested fields and includes them in the _change_set field of the response.
{
"entry": {
"title": "red",
"url": "/red",
"single_line": "Red variant",
"group": [
{
"single_line": "Variant 2",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
},
"multi_line": "Variant 2 Multi"
},
{
"single_line": "Variant 1",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
},
"multi_line": "Variant 1 Multi"
}
],
"_variant": {
"_order": [
{
"group": [
"base.cs5bafacf1e94ff8c2",
"base.csc30ef8fdc0b190fe"
]
}
]
}
}
}{
"entry": {
"uid": "blt**************a1",
"_variant": {
"_change_set": [
"title",
"url",
"single_line",
"group.cs5bafacf1e94ff8c2.single_line",
"group.cs5bafacf1e94ff8c2.multi_line",
"group.csc30ef8fdc0b190fe.single_line",
"group.csc30ef8fdc0b190fe.multi_line"
],
"_order": [
{
"group": [
"base.cs5bafacf1e94ff8c2",
"base.csc30ef8fdc0b190fe"
]
}
],
"_instance_uid": "blt**************d5",
"_uid": "cs1**************02",
"_base_entry_version": 1
},
"_version": 3,
"created_at": "2024-09-06T13:30:23.305Z",
"created_by": "blt**************1a",
"group": [
{
"single_line": "Variant 2",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
},
"multi_line": "Variant 2 Multi"
},
{
"single_line": "Variant 1",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
},
"multi_line": "Variant 1 Multi"
}
],
"locale": "en-us",
"single_line": "Red variant",
"tags": [],
"title": "red",
"updated_at": "2024-09-06T13:32:50.403Z",
"updated_by": "blt**************1a",
"url": "/red"
},
"notice": "Entry variant created successfully."
}Update entry variant
https://api.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}/variants/{variant_uid}The Update entry variant request lets you update an entry variant of your existing base entry.
NoteYou must have variant groups linked to relevant content type(s). If you have not linked your content types to a variant group yet, refer to the Link Content Type request.
In the “Body” section, include only the fields that require updating for the entry variant. The system detects changes automatically based on the values provided. All other fields inherit their values from the base entry. For Group and Modular Blocks fields with multiple instances, use the _order property to define the preferred sequence of instance UIDs.
{
{
"entry": {
"title": "red",
"url": "/red",
"single_line": "Red variant",
"group": [
{
"single_line": "Variant 2",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
},
"multi_line": "Variant 2 Multi"
},
{
"single_line": "Variant 1",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
},
"multi_line": "Variant 1 Multi"
}
],
"_variant": {
"_order": [
{
"group": [
"base.cs5bafacf1e94ff8c2",
"base.csc30ef8fdc0b190fe"
]
}
]
}
}
}
Note:
- The _change_set field is automatically included in the response to indicate which fields were updated in the entry variant.
- The system also detects changes in nested fields and includes them in the _change_set field of the response.
{
"entry": {
"title": "red",
"url": "/red",
"single_line": "Red variant",
"group": [
{
"single_line": "Variant 2",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
},
"multi_line": "Variant 2 Multi"
},
{
"single_line": "Variant 1",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
},
"multi_line": "Variant 1 Multi"
}
],
"_variant": {
"_order": [
{
"group": [
"base.cs5bafacf1e94ff8c2",
"base.csc30ef8fdc0b190fe"
]
}
]
}
}
}{
"entry": {
"uid": "blt**************a1",
"_variant": {
"_change_set": [
"title",
"url",
"single_line",
"group.cs5bafacf1e94ff8c2.single_line",
"group.cs5bafacf1e94ff8c2.multi_line",
"group.csc30ef8fdc0b190fe.single_line",
"group.csc30ef8fdc0b190fe.multi_line"
],
"_order": [
{
"group": [
"base.cs5bafacf1e94ff8c2",
"base.csc30ef8fdc0b190fe"
]
}
],
"_instance_uid": "blt**************d5",
"_uid": "cs1**************02",
"_base_entry_version": 1
},
"_version": 3,
"created_at": "2024-09-06T13:30:23.305Z",
"created_by": "blt**************1a",
"group": [
{
"single_line": "Variant 2",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
},
"multi_line": "Variant 2 Multi"
},
{
"single_line": "Variant 1",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
},
"multi_line": "Variant 1 Multi"
}
],
"locale": "en-us",
"single_line": "Red variant",
"tags": [],
"title": "red",
"updated_at": "2024-09-06T13:32:50.403Z",
"updated_by": "blt**************1a",
"url": "/red"
},
"notice": "Entry variant updated successfully."
}Get all entry variants
https://api.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}/variantsThe Get all entry variants request retrieves all entry variants of the specified entry.
{
"entries": [
{
"uid": "blt**************a1",
"_variant": {
"_change_set": [
"title",
"url",
"single_line",
"group.cs5bafacf1e94ff8c2.single_line",
"group.cs5bafacf1e94ff8c2.multi_line",
"group.csc30ef8fdc0b190fe.single_line",
"group.csc30ef8fdc0b190fe.multi_line"
],
"_order": [
{
"group": [
"base.cs5bafacf1e94ff8c2",
"base.csc30ef8fdc0b190fe"
]
}
],
"_instance_uid": "blta9cc89a57108129246d5",
"_uid": "3439b92ff6b5406ab559e7e7f246a49b",
"_base_entry_version": 1
},
"_version": 1,
"created_at": "2024-09-09T10:28:46.093Z",
"created_by": "blt6fe92749b66ad81a",
"group": [
{
"single_line": "Variant 2",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
},
"multi_line": "Variant 2 Multi"
},
{
"single_line": "Variant 1",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
},
"multi_line": "Variant 1 Multi"
}
],
"locale": "en-us",
"single_line": "Green Variant",
"tags": [],
"title": "Green RD",
"updated_at": "2024-09-09T10:28:46.093Z",
"updated_by": "blt6fe92749b66ad81a",
"url": "/green"
},
{
"uid": "blt05097f3d980a17a1",
"_variant": {
"_change_set": [
"title",
"url",
"single_line"
],
"_order": [],
"_instance_uid": "blta9cc89a57108129246d5",
"_uid": "3439b92ff6b5406ab559e7e7f246a49c",
"_base_entry_version": 1
},
"_version": 4,
"created_at": "2024-09-06T13:30:23.305Z",
"created_by": "blt**************1a",
"locale": "en-us",
"single_line": "Red variant",
"tags": [],
"title": "red",
"updated_at": "2024-09-09T10:27:44.796Z",
"updated_by": "blt**************1a",
"url": "/red"
}
]
}Get single entry variant
https://api.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}/variants/{variant_uid}The Get single entry variant request retrieves a single variant entry of a given base entry.
{
"entry": {
"uid": "blt**************a1",
"_variant": {
"_change_set": [
"title",
"url",
"single_line",
"group.cs5bafacf1e94ff8c2.single_line",
"group.cs5bafacf1e94ff8c2.multi_line",
"group.csc30ef8fdc0b190fe.single_line",
"group.csc30ef8fdc0b190fe.multi_line"
],
"_order": [
{
"group": [
"base.cs5bafacf1e94ff8c2",
"base.csc30ef8fdc0b190fe"
]
}
],
"_instance_uid": "blta9cc89a57108129246d5",
"_uid": "3439b92ff6b5406ab559e7e7f246a49b",
"_base_entry_version": 1
},
"_version": 1,
"created_at": "2024-09-09T10:28:46.093Z",
"created_by": "blt**************1a",
"group": [
{
"single_line": "Variant 2",
"_metadata": {
"uid": "cs5bafacf1e94ff8c2"
},
"multi_line": "Variant 2 Multi"
},
{
"single_line": "Variant 1",
"_metadata": {
"uid": "csc30ef8fdc0b190fe"
},
"multi_line": "Variant 1 Multi"
}
],
"locale": "en-us",
"single_line": "Green Variant",
"tags": [],
"title": "Green RD",
"updated_at": "2024-09-09T10:28:46.093Z",
"updated_by": "blt**************1a",
"url": "/green"
}
}Delete entry variant
https://api.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}/variants/{variant_uid}The Delete entry variant request lets you delete an entry variant.
{
"notice": "Entry variant deleted successfully."
}Publish entry variant
https://api.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}/publishThe Publish entry variant request lets you publish an entry variant.
In the “Body” section, include the variant UID and version within variants. Pass the publish_latest_base_conditionally key as true within variant_rules.
"variants": [
{
"uid": "cs6**************a5",
"version": 1
}
],
"variant_rules": {
"publish_latest_base_conditionally": true
}
NoteYou don't need to include the base entry version in the payload. The entry variant will be published based on the latest version or as specified by the variant_rules toggle. If the base entry version is included, the system will ignore it.
{
"entry": {
"environments": ["production"],
"locales": ["en-us"],
"variants": [
{
"uid": "cs6**************a5",
"version": 1
}
],
"variant_rules": {
"publish_latest_base": false,
"publish_latest_base_conditionally": true
}
},
"locale": "en-us"
}{
"notice": "The requested action has been performed.",
"job_id": "75****1f-e**0-46**-a**5-02********9a"
}Unpublish entry variant
https://api.contentstack.io/v3/content_types/{content_type_uid}/entries/{entry_uid}/unpublishThe Unpublish entry variant request lets you unpublish an entry variant.
In the “Body” section, include the version number and variant UID within variants.
"variants": [
{
"uid": "cs6**************a5",
"version": 1
}
]
NoteYou don't need to include the base entry version in the payload. The entry variant will be unpublished based on the latest version or as specified by the variant_rules toggle. If the base entry version is included, the system will ignore it.
{
"entry": {
"environments": ["blt**************fd"],
"locales": ["en-us"],
"variants": [
{
"uid": "cs6**************a5",
"version": 1
}
]
},
"locale": "en-us"
}{
"notice": "The requested action has been performed.",
"job_id": "05****9c-9**0-45**-9**4-ea********37"
}