Creates a new A/B/n test for a specific component on a page. This allows you to compare two or more variants of the component and determine which one performs better.
The unique identifier of the page that includes the component to A/B/n test.
The unique identifier of the component to A/B/n test.
How the A/B/n test evaluates the performance of its variants:
pageViewGoal- measures the number of page views.bouncersGoal- measures the number of bounces.exitsGoal- measures the number of exits.
A list of variants to use for the A/B/n test. Traffic splits must sum to 100 and exactly one variant must be marked as control.
- Production serverhttps://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/experiments/flows
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
- string
- null
curl -i -X POST \
https://edge-platform.sitecorecloud.io/stream/ai-agent-api/api/v1/experiments/flows \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-H 'x-sc-job-id: job-1234' \
-d '{
"site_id": "site_123",
"page_id": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
"language": "en",
"component_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"name": "Hero Banner Experiment",
"goal_type": "pageViewGoal",
"targeted_pages": [],
"variants": [
{
"name": "Variant A",
"is_control": false,
"traffic_split": 50
}
]
}'Successful response
The client key associated with the flow definition (A/B/n test or personalization).
The URL of the flow definition (A/B/n test or personalization).
A reference identifier for the flow definition (A/B/n test or personalization).
The name of the flow definition (A/B/n test or personalization).
A reference identifier for the user who last modified the flow definition (A/B/n test or personalization).
The timestamp when the flow definition (A/B/n test or personalization) was last modified.
The revision number of the flow definition (A/B/n test or personalization).
Whether the flow definition (A/B/n test or personalization) is archived.
A user-friendly identifier for the flow definition (A/B/n test or personalization).
A list of channels associated with the flow definition (A/B/n test or personalization), such as web or mobile.
A list of triggers for the flow definition (A/B/n test or personalization), or null if none.
The business process associated with the flow definition (A/B/n test or personalization).
The unique identifier of the site associated with the A/B/n test or personalization.
A list of transpiled variants for the flow definition (A/B/n test or personalization), or null if none.
A list of variants for the experiment (A/B/n test or personalization), or null if none.
The current status of the flow definition (A/B/n test or personalization).
The schedule configuration for the flow definition (A/B/n test or personalization).
Links to the revisions of the flow definition (A/B/n test or personalization).
The sample size configuration for the flow definition (A/B/n test or personalization).
Whether notifications are enabled for the flow definition (A/B/n test or personalization).
The subtype of the flow definition (A/B/n test or personalization), identifying it as an A/B experiment.
{ "clientKey": "pers12345", "href": "https://www.example.com/flow-definition", "ref": "FlowDefinition-12345", "name": "User Registration Flow", "modifiedByRef": "User-67890", "modifiedAt": "2025-01-15T10:30:00Z", "revision": 2, "archived": false, "friendlyId": "user_registration_flow", "type": "COMPONENT", "channels": [ "string" ], "triggers": [ null ], "tags": [ null ], "businessProcess": "user_registration", "siteId": "site_123", "transpiledVariants": [ { … } ], "variants": [ { … } ], "status": "DRAFT", "schedule": { "type": "simpleSchedule", "startDate": "2023-01-01T00:00:00Z" }, "revisions": { "href": "https://www.example.com/flow-definition/revisions" }, "sampleSizeConfig": { "baseValue": 0.5, "minimumDetectableDifference": 0.1, "confidenceLevel": 0.95, "sampleSize": 0 }, "notificationEnabled": true, "subtype": "EXPERIMENT", "traffic": { "type": "simpleTraffic", "weightingAlgorithm": "USER_DEFINED", "modifiedAt": "2023-01-01T00:00:00Z", "allocation": 100, "coupled": false, "splits": [ … ] }, "goals": { "property1": { … }, "property2": { … } } }