UpdateExperiment - CloudWatch Evidently

UpdateExperiment

Important

End of support notice: On October 16, 2025, AWS will discontinue support for CloudWatch Evidently. After October 16, 2025, you will no longer be able to access the Evidently console or CloudWatch Evidently resources.

Updates an Evidently experiment.

Don't use this operation to update an experiment's tag. Instead, use TagResource.

Request Syntax

PATCH /projects/project/experiments/experiment HTTP/1.1 Content-type: application/json { "description": "string", "metricGoals": [ { "desiredChange": "string", "metricDefinition": { "entityIdKey": "string", "eventPattern": "string", "name": "string", "unitLabel": "string", "valueKey": "string" } } ], "onlineAbConfig": { "controlTreatmentName": "string", "treatmentWeights": { "string" : number } }, "randomizationSalt": "string", "removeSegment": boolean, "samplingRate": number, "segment": "string", "treatments": [ { "description": "string", "feature": "string", "name": "string", "variation": "string" } ] }

URI Request Parameters

The request uses the following URI parameters.

experiment

The name of the experiment to update.

Length Constraints: Minimum length of 1. Maximum length of 127.

Pattern: ^[-a-zA-Z0-9._]*$

Required: Yes

project

The name or ARN of the project that contains the experiment that you want to update.

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: (^[a-zA-Z0-9._-]*$)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:project/[a-zA-Z0-9._-]*)

Required: Yes

Request Body

The request accepts the following data in JSON format.

description

An optional description of the experiment.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 160.

Pattern: .*

Required: No

metricGoals

An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.

Type: Array of MetricGoalConfig objects

Array Members: Minimum number of 1 item. Maximum number of 3 items.

Required: No

onlineAbConfig

A structure that contains the configuration of which variation o use as the "control" version. The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.

Type: OnlineAbConfig object

Required: No

randomizationSalt

When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served. This randomization ID is a combination of the entity ID and randomizationSalt. If you omit randomizationSalt, Evidently uses the experiment name as the randomizationSalt.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 127.

Pattern: .*

Required: No

removeSegment

Removes a segment from being used in an experiment. You can't use this parameter if the experiment is currently running.

Type: Boolean

Required: No

samplingRate

The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.

This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the available audience.

Type: Long

Valid Range: Minimum value of 0. Maximum value of 100000.

Required: No

segment

Adds an audience segment to an experiment. When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment. You can't use this parameter if the experiment is currently running.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: (^[-a-zA-Z0-9._]*$)|(arn:[^:]*:[^:]*:[^:]*:[^:]*:segment/[-a-zA-Z0-9._]*)

Required: No

treatments

An array of structures that define the variations being tested in the experiment.

Type: Array of TreatmentConfig objects

Array Members: Minimum number of 0 items. Maximum number of 5 items.

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "experiment": { "arn": "string", "createdTime": number, "description": "string", "execution": { "endedTime": number, "startedTime": number }, "lastUpdatedTime": number, "metricGoals": [ { "desiredChange": "string", "metricDefinition": { "entityIdKey": "string", "eventPattern": "string", "name": "string", "unitLabel": "string", "valueKey": "string" } } ], "name": "string", "onlineAbDefinition": { "controlTreatmentName": "string", "treatmentWeights": { "string" : number } }, "project": "string", "randomizationSalt": "string", "samplingRate": number, "schedule": { "analysisCompleteTime": number }, "segment": "string", "status": "string", "statusReason": "string", "tags": { "string" : "string" }, "treatments": [ { "description": "string", "featureVariations": { "string" : "string" }, "name": "string" } ], "type": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

experiment

A structure containing the configuration details of the experiment that was updated.

Type: Experiment object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient permissions to perform this action.

HTTP Status Code: 403

ConflictException

A resource was in an inconsistent state during an update or a deletion.

HTTP Status Code: 409

ResourceNotFoundException

The request references a resource that does not exist.

HTTP Status Code: 404

ValidationException

The value of a parameter in the request caused an error.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: