Sets up a variant for a specific A/B/n test or personalization by copying, hiding, or swapping the original component.
The unique identifier of the A/B/n test or personalization to set up. To get this ID, you can use the List flow definitions endpoint for the page and use the flow ref value.
The unique identifier of the personalization or A/B/n test variant to set up. To get this ID, you can use the List flow definitions endpoint. Use the transpiledVariants[].ref, or variants[].ref when available.
The unique identifier of the page containing the component.
The unique identifier of the component to set up as a variant.
The strategy for the variant. Either HIDE, SWAP, or COPY.
The version of the page to use, or null for the latest version.
- Production serverhttps://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/flows/{flowId}/variants/{variantId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/flows/1fdfbc60-9646-469d-b971-2b0f4c033fbc/variants/8ea2cb6f-a92a-4c05-88a3-a4c0b29c63a8 \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-sc-job-id: job-1234' \
-d '{
"page_id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
"component_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"variant_strategy": "HIDE",
"language": "en",
"page_version": 1,
"swapped_component": {
"componentRenderingId": "86a03271-dff4-470a-92bd-b68c67de2e25",
"datasourcePath": "/sitecore/content/Verticals/SkatePark/Data/Promos/Summer Sale"
}
}'Successful response
The unique identifier of the page.
The unique identifier of the component set up as a variant.
The unique identifier of the component rendering definition.
The unique identifier of the A/B/n test or personalization.
The unique identifier of the A/B/n test or personalization variant.
- string
- null
{ "pageId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301", "componentId": "d290f1ee-6c54-4b01-90e6-d701748f0851", "componentRenderingId": "86a03271-dff4-470a-92bd-b68c67de2e25", "flowId": "1fdfbc60-9646-469d-b971-2b0f4c033fbc", "variantId": "8ea2cb6f-a92a-4c05-88a3-a4c0b29c63a8", "datasource": "/sitecore/content/Verticals/SkatePark/Data/Promos/Summer Sale" }