diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index c892a380ecc..a05d136ff76 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -42535,6 +42535,48 @@ components:
required:
- metric_id
type: object
+ ExperimentsCreateExperimentProtocolRequest:
+ description: Create a draft protocol with the organization default subject type.
+ properties:
+ data:
+ $ref: "#/components/schemas/ExperimentsCreateExperimentProtocolRequestData"
+ required:
+ - data
+ type: object
+ ExperimentsCreateExperimentProtocolRequestData:
+ description: JSON:API protocol request resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/ExperimentsCreateExperimentProtocolRequestDataAttributes"
+ type:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataType"
+ required:
+ - type
+ - attributes
+ type: object
+ ExperimentsCreateExperimentProtocolRequestDataAttributes:
+ description: Create a draft protocol with the organization default subject type.
+ properties:
+ description:
+ description: Optional text that explains the protocol.
+ nullable: true
+ type: string
+ migration_metadata:
+ additionalProperties: {}
+ description: >-
+ Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission preserves it on update.
+ nullable: true
+ type: object
+ name:
+ description: >-
+ Protocol name. Leading and trailing spaces are removed. The trimmed name must contain 1 to 255 characters.
+ example: Checkout conversion
+ minLength: 1
+ pattern: .*\S.*
+ type: string
+ required:
+ - name
+ type: object
ExperimentsCreateExperimentV2Request:
description: "Request to create an experiment draft."
example:
@@ -46188,6 +46230,148 @@ components:
type: string
x-enum-varnames:
- EXPERIMENT_METRIC_GROUPS
+ ExperimentsPatchExperimentProtocolRequest:
+ description: >-
+ Partial protocol update. Omitted attributes remain unchanged. Published protocols accept only name, description, and migration_metadata; archived protocols reject updates.
+ properties:
+ data:
+ $ref: "#/components/schemas/ExperimentsPatchExperimentProtocolRequestData"
+ required:
+ - data
+ type: object
+ ExperimentsPatchExperimentProtocolRequestData:
+ description: JSON:API protocol request resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/ExperimentsPatchExperimentProtocolRequestDataAttributes"
+ id:
+ description: Protocol ID. If supplied, must match the path protocol_id.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ type:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataType"
+ required:
+ - type
+ type: object
+ ExperimentsPatchExperimentProtocolRequestDataAttributes:
+ description: >-
+ Partial protocol update. Omitted attributes remain unchanged. Published protocols accept only name, description, and migration_metadata; archived protocols reject updates.
+ properties:
+ analysis_plan:
+ $ref: "#/components/schemas/ExperimentsPatchProtocolAnalysisPlanInput"
+ assignment_source_default_properties:
+ description: Assignment properties. Omission or null preserves them; an array replaces them.
+ items:
+ $ref: >-
+ #/components/schemas/ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems
+ nullable: true
+ type: array
+ assignment_source_id:
+ description: >-
+ ID of the assignment source selected by the protocol. Omission or null keeps the current value. An empty string clears it.
+ nullable: true
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$
+ type: string
+ default_duration_days:
+ description: >-
+ Default experiment duration supplied by the protocol, in days. Omission preserves it; null clears it. Sets analysis_plan.target_duration_days on experiments created from this protocol.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ description:
+ description: Description. Empty string clears it; omission or null preserves it.
+ nullable: true
+ type: string
+ enforcement:
+ $ref: "#/components/schemas/ExperimentsPatchProtocolEnforcementInput"
+ environment_id:
+ description: >-
+ ID of the feature flag environment used by the experiment. Omission or null keeps the current value. An empty string clears it.
+ nullable: true
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$
+ type: string
+ exposure_schedule:
+ $ref: "#/components/schemas/ExperimentsPatchProtocolExposureScheduleInput"
+ is_duration_required_to_start:
+ description: >-
+ Whether the protocol requires a duration before an experiment can start. Omission or null preserves it.
+ example: false
+ nullable: true
+ type: boolean
+ is_equal_split_enforced:
+ description: >-
+ Whether the protocol requires equal traffic allocation across variants. Omission or null preserves it.
+ example: false
+ nullable: true
+ type: boolean
+ is_metric_limit_enabled:
+ description: Whether the protocol limits the number of metrics. Omission or null preserves it.
+ example: false
+ nullable: true
+ type: boolean
+ is_minimum_duration_enabled:
+ description: Whether the protocol enforces a minimum experiment duration. Omission or null preserves it.
+ example: false
+ nullable: true
+ type: boolean
+ metric_groups:
+ description: Metric groups. Omission or null preserves them; an array replaces them.
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolMetricGroupInput"
+ nullable: true
+ type: array
+ metric_limit:
+ description: Maximum number of metrics allowed by the protocol. Omission preserves it; null clears it.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ migration_metadata:
+ additionalProperties: {}
+ description: >-
+ Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission preserves it on update.
+ nullable: true
+ type: object
+ minimum_duration_unit:
+ description: Minimum duration unit, `DAYS` or `WEEKS`. Empty string clears it. Omission or null preserves it.
+ nullable: true
+ pattern: ^(DAYS|WEEKS)?$
+ type: string
+ minimum_duration_value:
+ description: Minimum experiment duration in the specified unit. Omission preserves it; null clears it.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ name:
+ description: >-
+ Protocol name. Leading and trailing spaces are removed. The trimmed name must contain 1 to 255 characters.
+ example: Checkout conversion
+ minLength: 1
+ nullable: true
+ pattern: .*\S.*
+ type: string
+ primary_metric_id:
+ description: >-
+ ID of the primary metric supplied by the protocol. Omission or null keeps the current value. An empty string clears it.
+ nullable: true
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$
+ type: string
+ subject_type_id:
+ description: >-
+ ID of the subject type used by this configuration. Omission or null keeps the current value. An empty string clears it.
+ nullable: true
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$
+ type: string
+ targeting_rules:
+ description: Targeting rules. Omission or null preserves them; an array replaces them.
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolTargetingRuleInput"
+ nullable: true
+ type: array
+ type: object
ExperimentsPatchExperimentV2MetaDTO:
description: "Refresh requirements and warnings returned by an experiment update."
properties:
@@ -46993,6 +47177,144 @@ components:
type: string
x-enum-varnames:
- METRIC_COLLECTIONS
+ ExperimentsPatchProtocolAnalysisPlanInput:
+ description: >-
+ Partial statistical settings. Omitted fields remain unchanged. Null clears the whole plan. Null clears nullable fields; null or an empty string clears confidence_interval_method.
+ nullable: true
+ properties:
+ compute_cuped:
+ description: Whether to use pre-experiment data to reduce variance with CUPED.
+ nullable: true
+ type: boolean
+ confidence_interval_method:
+ description: >-
+ Confidence interval method: `Sequential`, `FixedSample`, `Bayesian`, or `SequentialFixedHybrid`. An empty string leaves the method unset.
+ nullable: true
+ pattern: ^(Sequential|FixedSample|Bayesian|SequentialFixedHybrid)?$
+ type: string
+ confidence_level:
+ description: Confidence level used by the statistical analysis.
+ format: double
+ maximum: 1
+ minimum: 0
+ nullable: true
+ type: number
+ multiple_testing_correction_method:
+ description: Method used to adjust for testing multiple metrics.
+ nullable: true
+ type: string
+ type: object
+ ExperimentsPatchProtocolEnforcementInput:
+ description: >-
+ Partial lock map. Omitted fields remain unchanged. Null clears the whole map. Empty or null field values become `EDITABLE`, except `subject_type`, `flag_source`, and `confidence_interval_method`, which remain `LOCKED`.
+ nullable: true
+ properties:
+ confidence_interval_method:
+ description: Always `LOCKED`. The server keeps this setting locked regardless of the supplied value.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ confidence_level:
+ description: LOCKED prevents changes to confidence level. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ cuped_calculation:
+ description: LOCKED prevents changes to CUPED variance reduction. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ default_duration:
+ description: LOCKED prevents changes to default duration. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ environment:
+ description: LOCKED prevents changes to environment. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ flag_source:
+ description: Always LOCKED. The server keeps this setting locked regardless of the supplied value.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ multiple_testing_correction:
+ description: LOCKED prevents changes to multiple testing correction. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ notifications:
+ description: LOCKED prevents changes to notifications. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ primary_metric:
+ description: LOCKED prevents changes to primary metric. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ secondary_metrics:
+ description: LOCKED prevents changes to secondary metrics. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ split_by_exploration_dimensions:
+ description: LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ subject_type:
+ description: Always LOCKED. The server keeps this setting locked regardless of the supplied value.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ targeting_rules:
+ description: LOCKED prevents changes to targeting rules. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ traffic_exposure:
+ description: LOCKED prevents changes to traffic exposure. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ warehouse_exposure_source:
+ description: LOCKED prevents changes to warehouse exposure source. EDITABLE permits changes.
+ nullable: true
+ pattern: ^(LOCKED|EDITABLE)?$
+ type: string
+ type: object
+ ExperimentsPatchProtocolExposureScheduleInput:
+ description: >-
+ Partial traffic schedule. Omitted fields remain unchanged. Null clears the whole schedule. Null clears nullable fields and rollout_steps; null sets strategy to an empty string and `autostart` to false.
+ nullable: true
+ properties:
+ autostart:
+ description: Whether the exposure schedule starts automatically.
+ nullable: true
+ type: boolean
+ guardrail_triggered_action:
+ description: Action taken when a guardrail triggers during the exposure schedule.
+ nullable: true
+ type: string
+ rollout_steps:
+ description: Rollout steps, replaced when supplied.
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolExposureStepInput"
+ nullable: true
+ type: array
+ selection_interval_ms:
+ description: Interval between traffic selections, in milliseconds.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ strategy:
+ description: Method used to increase traffic exposure over the schedule.
+ nullable: true
+ type: string
+ type: object
ExperimentsPatchSubjectTypeV2Request:
description: "Request to update the subject type."
example:
@@ -47156,6 +47478,156 @@ components:
x-enum-varnames:
- IS_NULL
- IS_NOT_NULL
+ ExperimentsProtocolAnalysisPlanInput:
+ description: >-
+ Statistical settings. Use `default_duration_days` for duration; `target_duration_days` is not accepted here.
+ nullable: true
+ properties:
+ compute_cuped:
+ description: Whether to use pre-experiment data to reduce variance with CUPED.
+ nullable: true
+ type: boolean
+ confidence_interval_method:
+ description: >-
+ Confidence interval method: `Sequential`, `FixedSample`, `Bayesian`, or `SequentialFixedHybrid`. An empty string leaves the method unset.
+ pattern: ^(Sequential|FixedSample|Bayesian|SequentialFixedHybrid)?$
+ type: string
+ confidence_level:
+ description: Confidence level used by the statistical analysis.
+ format: double
+ maximum: 1
+ minimum: 0
+ nullable: true
+ type: number
+ multiple_testing_correction_method:
+ description: Method used to adjust for testing multiple metrics.
+ nullable: true
+ type: string
+ type: object
+ ExperimentsProtocolConditionInput:
+ description: >-
+ Protocol targeting condition. Publishing and replacement require a saved filter or a valid inline attribute, operator, and values.
+ properties:
+ attribute:
+ description: Subject attribute evaluated by the targeting condition.
+ type: string
+ operator:
+ description: Comparison applied to the subject attribute.
+ type: string
+ order_position:
+ description: Position of this entry in the ordered configuration.
+ format: int64
+ minimum: 0
+ type: integer
+ saved_filter_id:
+ description: >-
+ Saved filter UUID. Null selects an inline condition. An empty string skips the saved-filter lookup.
+ nullable: true
+ pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$
+ type: string
+ value:
+ description: Values compared with the subject attribute in this condition.
+ items:
+ description: One value compared with the subject attribute.
+ type: string
+ nullable: true
+ type: array
+ type: object
+ ExperimentsProtocolExposureScheduleInput:
+ description: >-
+ Traffic schedule. Publishing and replacement require `NO_ROLLOUT` with exactly one step, or `UNIFORM_INTERVALS` with a positive selection interval and at least one step. Requires `environment_id`.
+ nullable: true
+ properties:
+ autostart:
+ description: Whether the exposure schedule starts automatically.
+ type: boolean
+ guardrail_triggered_action:
+ description: Action taken when a guardrail triggers during the exposure schedule.
+ nullable: true
+ type: string
+ rollout_steps:
+ description: Rollout steps, replaced when supplied.
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolExposureStepInput"
+ nullable: true
+ type: array
+ selection_interval_ms:
+ description: Interval between traffic selections, in milliseconds.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ strategy:
+ description: Method used to increase traffic exposure over the schedule.
+ type: string
+ type: object
+ ExperimentsProtocolExposureStepInput:
+ description: A traffic exposure step in the protocol template.
+ properties:
+ exposure_ratio:
+ description: Fraction of traffic exposed during this rollout step.
+ format: double
+ maximum: 1
+ minimum: 0
+ type: number
+ grouped_step_index:
+ description: Index of the group that contains this rollout step.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ interval_ms:
+ description: Duration of this rollout step, in milliseconds.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ is_pause_record:
+ description: Whether this schedule entry represents a pause.
+ type: boolean
+ order_position:
+ description: Position of this entry in the ordered configuration.
+ format: int64
+ minimum: 0
+ type: integer
+ type: object
+ ExperimentsProtocolMetricGroupInput:
+ description: A metric group supplied by the protocol. Empty decision groups are removed.
+ properties:
+ is_decision:
+ description: Whether this group contains decision metrics.
+ type: boolean
+ metrics:
+ description: Metrics in the group.
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolMetricInput"
+ nullable: true
+ type: array
+ name:
+ description: Metric group name.
+ type: string
+ type: object
+ ExperimentsProtocolMetricInput:
+ description: A metric included in a protocol. Select the primary metric with `primary_metric_id`, not `is_primary`.
+ properties:
+ metric_id:
+ description: Metric UUID.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ required:
+ - metric_id
+ type: object
+ ExperimentsProtocolTargetingRuleInput:
+ description: A targeting rule in the protocol template.
+ properties:
+ conditions:
+ description: Conditions in this rule.
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolConditionInput"
+ nullable: true
+ type: array
+ type: object
ExperimentsPublicProtocolListResponseArray:
description: "List of protocol resources with pagination information."
properties:
@@ -47194,6 +47666,13 @@ components:
description:
description: "Text that explains the protocol."
type: string
+ experiment_count:
+ description: >-
+ Number of experiments in the organization that use this protocol, excluding deleted experiments.
+ example: 0
+ format: int64
+ minimum: 0
+ type: integer
name:
description: "Display name of the protocol."
example: Checkout conversion
@@ -47211,10 +47690,13 @@ components:
description: "ID of the subject type used by this configuration."
type: string
updated_at:
- description: "RFC3339 update time. Preserve all fractional seconds when passing this value as expected_updated_at."
+ description: |-
+ RFC3339 update time. Preserve all fractional seconds when passing this value as
+ `expected_updated_at`.
example: "2026-01-01T00:00:00Z"
type: string
required:
+ - experiment_count
- name
- status
- updated_at
@@ -47248,6 +47730,11 @@ components:
properties:
analysis_plan:
$ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataAttributesAnalysisPlan"
+ archived_at:
+ description: "Time when the protocol was archived. Omitted if it has not been archived."
+ example: "2026-07-31T14:00:00Z"
+ format: date-time
+ type: string
assignment_source_default_properties:
description: "Default properties supplied by the protocol's assignment source."
items:
@@ -47257,6 +47744,11 @@ components:
assignment_source_id:
description: "ID of the assignment source selected by the protocol."
type: string
+ created_at:
+ description: "Time when the protocol was created."
+ example: "2026-07-31T12:00:00Z"
+ format: date-time
+ type: string
default_duration_days:
description: "Default experiment duration supplied by the protocol, in days."
format: int64
@@ -47269,6 +47761,13 @@ components:
environment_id:
description: "ID of the feature flag environment used by the experiment."
type: string
+ experiment_count:
+ description: >-
+ Number of experiments in the organization that use this protocol, excluding deleted experiments. Omitted if the count cannot be retrieved. An omitted count does not mean zero.
+ example: 0
+ format: int64
+ minimum: 0
+ type: integer
exposure_schedule:
$ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataAttributesExposureSchedule"
is_duration_required_to_start:
@@ -47332,10 +47831,13 @@ components:
$ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataAttributesTargetingRulesItems"
type: array
updated_at:
- description: "RFC3339 update time. Preserve all fractional seconds when passing this value as expected_updated_at."
+ description: |-
+ RFC3339 update time. Preserve all fractional seconds when passing this value as
+ `expected_updated_at`.
example: "2026-01-01T00:00:00Z"
type: string
required:
+ - created_at
- is_duration_required_to_start
- is_equal_split_enforced
- is_metric_limit_enabled
@@ -47379,7 +47881,7 @@ components:
description: "Controls that determine which protocol settings can be changed in an experiment."
properties:
confidence_interval_method:
- description: "LOCKED prevents changes to confidence interval method. EDITABLE permits changes."
+ description: "Always LOCKED. The server keeps this setting locked regardless of the supplied value."
type: string
confidence_level:
description: "LOCKED prevents changes to confidence level. EDITABLE permits changes."
@@ -47394,7 +47896,7 @@ components:
description: "LOCKED prevents changes to environment. EDITABLE permits changes."
type: string
flag_source:
- description: "LOCKED prevents changes to feature flag source. EDITABLE permits changes."
+ description: "Always LOCKED. The server keeps this setting locked regardless of the supplied value."
type: string
multiple_testing_correction:
description: "LOCKED prevents changes to multiple testing correction. EDITABLE permits changes."
@@ -47412,7 +47914,7 @@ components:
description: "LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes."
type: string
subject_type:
- description: "LOCKED prevents changes to subject type. EDITABLE permits changes."
+ description: "Always LOCKED. The server keeps this setting locked regardless of the supplied value."
type: string
targeting_rules:
description: "LOCKED prevents changes to targeting rules. EDITABLE permits changes."
@@ -47641,6 +48143,230 @@ components:
type: string
x-enum-varnames:
- EXPERIMENT_RESULTS_REFRESH
+ ExperimentsReplaceExperimentProtocolRequest:
+ description: >-
+ Replace a published protocol template. Omitted optional template fields are cleared. Omitted enforcement and migration_metadata are preserved. Enabled limits require their values; allocation settings require environment_id.
+ properties:
+ data:
+ $ref: "#/components/schemas/ExperimentsReplaceExperimentProtocolRequestData"
+ required:
+ - data
+ type: object
+ ExperimentsReplaceExperimentProtocolRequestData:
+ description: JSON:API protocol request resource.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/ExperimentsReplaceExperimentProtocolRequestDataAttributes"
+ id:
+ description: Protocol ID. If supplied, must match the path protocol_id.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ type:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataType"
+ required:
+ - type
+ - attributes
+ type: object
+ ExperimentsReplaceExperimentProtocolRequestDataAttributes:
+ description: >-
+ Replace a published protocol template. Omitted optional template fields are cleared. Omitted enforcement and migration_metadata are preserved. Enabled limits require their values; allocation settings require environment_id.
+ properties:
+ analysis_plan:
+ $ref: "#/components/schemas/ExperimentsProtocolAnalysisPlanInput"
+ assignment_source_default_properties:
+ description: Assignment properties.
+ items:
+ $ref: >-
+ #/components/schemas/ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems
+ type: array
+ assignment_source_id:
+ description: ID of the assignment source selected by the protocol.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ nullable: true
+ type: string
+ default_duration_days:
+ description: Default experiment duration supplied by the protocol, in days.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ enforcement:
+ $ref: "#/components/schemas/ExperimentsReplaceProtocolEnforcementInput"
+ environment_id:
+ description: ID of the feature flag environment used by the experiment.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ nullable: true
+ type: string
+ exposure_schedule:
+ $ref: "#/components/schemas/ExperimentsProtocolExposureScheduleInput"
+ is_duration_required_to_start:
+ description: Whether the protocol requires a duration before an experiment can start.
+ example: false
+ type: boolean
+ is_equal_split_enforced:
+ description: Whether the protocol requires equal traffic allocation across variants.
+ example: false
+ type: boolean
+ is_metric_limit_enabled:
+ description: Whether the protocol limits the number of metrics.
+ example: false
+ type: boolean
+ is_minimum_duration_enabled:
+ description: Whether the protocol enforces a minimum experiment duration.
+ example: false
+ type: boolean
+ metric_groups:
+ description: Metric groups.
+ example: []
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolMetricGroupInput"
+ type: array
+ metric_limit:
+ description: Maximum number of metrics allowed by the protocol.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ migration_metadata:
+ additionalProperties: {}
+ description: >-
+ Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission preserves it on update.
+ nullable: true
+ type: object
+ minimum_duration_unit:
+ description: Minimum duration unit, DAYS or WEEKS.
+ nullable: true
+ pattern: ^(DAYS|WEEKS)$
+ type: string
+ minimum_duration_value:
+ description: Minimum experiment duration in the specified unit.
+ format: int64
+ minimum: 0
+ nullable: true
+ type: integer
+ primary_metric_id:
+ description: ID of the primary metric supplied by the protocol.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ nullable: true
+ type: string
+ subject_type_id:
+ description: ID of the subject type used by this configuration.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ targeting_rules:
+ description: Targeting rules.
+ items:
+ $ref: "#/components/schemas/ExperimentsProtocolTargetingRuleInput"
+ type: array
+ required:
+ - subject_type_id
+ - is_equal_split_enforced
+ - is_minimum_duration_enabled
+ - is_duration_required_to_start
+ - is_metric_limit_enabled
+ - metric_groups
+ type: object
+ ExperimentsReplaceProtocolEnforcementInput:
+ description: >-
+ Complete lock map. Omit this object to preserve current locks. Null is rejected; every field is required.
+ properties:
+ confidence_interval_method:
+ description: Always LOCKED. The server keeps this setting locked regardless of the supplied value.
+ example: LOCKED
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ confidence_level:
+ description: LOCKED prevents changes to confidence level. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ cuped_calculation:
+ description: LOCKED prevents changes to CUPED variance reduction. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ default_duration:
+ description: LOCKED prevents changes to default duration. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ environment:
+ description: LOCKED prevents changes to environment. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ flag_source:
+ description: Always LOCKED. The server keeps this setting locked regardless of the supplied value.
+ example: LOCKED
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ multiple_testing_correction:
+ description: LOCKED prevents changes to multiple testing correction. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ notifications:
+ description: LOCKED prevents changes to notifications. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ primary_metric:
+ description: LOCKED prevents changes to primary metric. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ secondary_metrics:
+ description: LOCKED prevents changes to secondary metrics. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ split_by_exploration_dimensions:
+ description: LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ subject_type:
+ description: Always LOCKED. The server keeps this setting locked regardless of the supplied value.
+ example: LOCKED
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ targeting_rules:
+ description: LOCKED prevents changes to targeting rules. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ traffic_exposure:
+ description: LOCKED prevents changes to traffic exposure. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ warehouse_exposure_source:
+ description: LOCKED prevents changes to warehouse exposure source. EDITABLE permits changes.
+ example: EDITABLE
+ pattern: ^(LOCKED|EDITABLE)$
+ type: string
+ required:
+ - confidence_interval_method
+ - confidence_level
+ - cuped_calculation
+ - default_duration
+ - environment
+ - flag_source
+ - multiple_testing_correction
+ - notifications
+ - primary_metric
+ - secondary_metrics
+ - split_by_exploration_dimensions
+ - subject_type
+ - targeting_rules
+ - traffic_exposure
+ - warehouse_exposure_source
+ type: object
ExperimentsSQLModelPropertyInput:
description: A property column defined by an exposure SQL model.
example:
@@ -170321,7 +171047,14 @@ paths:
examples:
default:
value:
- data: []
+ data:
+ - attributes:
+ experiment_count: 0
+ name: Checkout protocol
+ status: DRAFT
+ updated_at: "2026-07-31T12:00:00Z"
+ id: e4d5f6a7-0000-0000-0000-000000000000
+ type: protocols
schema:
$ref: "#/components/schemas/ExperimentsPublicProtocolListResponseArray"
description: OK
@@ -170357,7 +171090,193 @@ paths:
operator: AND
permissions:
- product_analytics_experiments_read
+ post:
+ description: >-
+ Create a draft protocol with a name and optional description and migration metadata. The organization's default subject type is selected. Use PATCH to configure the draft, then publish it before creating experiments from it.
+ operationId: CreateExperimentProtocol
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ description: Defaults for checkout experiments.
+ name: Checkout protocol
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsCreateExperimentProtocolRequest"
+ required: true
+ responses:
+ "201":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2026-07-31T12:00:00Z"
+ description: Defaults for checkout experiments.
+ enforcement:
+ confidence_interval_method: LOCKED
+ confidence_level: EDITABLE
+ cuped_calculation: EDITABLE
+ default_duration: EDITABLE
+ environment: EDITABLE
+ flag_source: LOCKED
+ multiple_testing_correction: EDITABLE
+ notifications: EDITABLE
+ primary_metric: EDITABLE
+ secondary_metrics: EDITABLE
+ split_by_exploration_dimensions: EDITABLE
+ subject_type: LOCKED
+ targeting_rules: EDITABLE
+ traffic_exposure: EDITABLE
+ warehouse_exposure_source: EDITABLE
+ experiment_count: 0
+ is_duration_required_to_start: false
+ is_equal_split_enforced: false
+ is_metric_limit_enabled: false
+ is_minimum_duration_enabled: false
+ metric_groups: []
+ name: Checkout protocol
+ status: DRAFT
+ subject_type:
+ id: c2b3d4e5-0000-0000-0000-000000000000
+ name: User
+ subject_type_id: c2b3d4e5-0000-0000-0000-000000000000
+ updated_at: "2026-07-31T12:00:00Z"
+ id: e4d5f6a7-0000-0000-0000-000000000000
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponse"
+ description: Created
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Invalid request or protocol settings.
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Missing or invalid authentication.
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The caller lacks the product_analytics_experiments_write permission.
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: A protocol with this name already exists.
+ "415":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unsupported request content type.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - product_analytics_experiments_write
+ summary: Create experiment protocol
+ tags:
+ - Experiments
+ x-permission:
+ operator: AND
+ permissions:
+ - product_analytics_experiments_write
/api/v2/experiments/protocols/{protocol_id}:
+ delete:
+ description: >-
+ Delete a protocol with no linked experiments. Draft, published, and archived protocols can be deleted. Returns 204 with no response body.
+ operationId: DeleteExperimentProtocol
+ parameters:
+ - description: The UUID of the protocol.
+ in: path
+ name: protocol_id
+ required: true
+ schema:
+ description: The UUID of the protocol.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ - description: >-
+ The updated_at value from the last read. Include the full timestamp, with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip this check.
+ in: query
+ name: expected_updated_at
+ schema:
+ type: string
+ responses:
+ "204":
+ description: No Content
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Invalid request or protocol settings.
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Missing or invalid authentication.
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The caller lacks the product_analytics_experiments_write permission.
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: No protocol with this ID exists in the organization.
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The protocol has linked experiments or expected_updated_at is stale.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - product_analytics_experiments_write
+ summary: Delete experiment protocol
+ tags:
+ - Experiments
+ x-permission:
+ operator: AND
+ permissions:
+ - product_analytics_experiments_write
get:
description: Get a draft, published, or archived experiment protocol by ID.
operationId: GetExperimentProtocol
@@ -170380,6 +171299,7 @@ paths:
value:
data:
attributes:
+ created_at: "2026-07-31T12:00:00Z"
description: Default settings for checkout experiments.
enforcement:
confidence_interval_method: LOCKED
@@ -170397,6 +171317,7 @@ paths:
targeting_rules: EDITABLE
traffic_exposure: EDITABLE
warehouse_exposure_source: EDITABLE
+ experiment_count: 0
is_duration_required_to_start: false
is_equal_split_enforced: false
is_metric_limit_enabled: false
@@ -170457,6 +171378,516 @@ paths:
operator: AND
permissions:
- product_analytics_experiments_read
+ patch:
+ description: >-
+ Update the supplied fields of a draft protocol. Published protocols accept only name, description, and migration_metadata changes through PATCH. Use PUT to replace their settings. Archived protocols cannot be edited.
+
+
+ Omitted fields keep their current values, including fields inside analysis_plan, exposure_schedule, and enforcement. Arrays replace the stored arrays. Supported null values clear fields; see the request schema. Use primary_metric_id to select the primary metric and default_duration_days to set the experiment analysis duration. Nested metric is_primary and analysis_plan.target_duration_days fields are rejected.
+ operationId: PatchExperimentProtocol
+ parameters:
+ - description: The UUID of the protocol.
+ in: path
+ name: protocol_id
+ required: true
+ schema:
+ description: The UUID of the protocol.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ description: Updated defaults for checkout experiments.
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsPatchExperimentProtocolRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2026-07-31T12:00:00Z"
+ description: Updated defaults for checkout experiments.
+ enforcement:
+ confidence_interval_method: LOCKED
+ confidence_level: EDITABLE
+ cuped_calculation: EDITABLE
+ default_duration: EDITABLE
+ environment: EDITABLE
+ flag_source: LOCKED
+ multiple_testing_correction: EDITABLE
+ notifications: EDITABLE
+ primary_metric: EDITABLE
+ secondary_metrics: EDITABLE
+ split_by_exploration_dimensions: EDITABLE
+ subject_type: LOCKED
+ targeting_rules: EDITABLE
+ traffic_exposure: EDITABLE
+ warehouse_exposure_source: EDITABLE
+ experiment_count: 0
+ is_duration_required_to_start: false
+ is_equal_split_enforced: false
+ is_metric_limit_enabled: false
+ is_minimum_duration_enabled: false
+ metric_groups: []
+ name: Checkout protocol
+ status: DRAFT
+ subject_type:
+ id: c2b3d4e5-0000-0000-0000-000000000000
+ name: User
+ subject_type_id: c2b3d4e5-0000-0000-0000-000000000000
+ updated_at: "2026-07-31T12:00:00Z"
+ id: e4d5f6a7-0000-0000-0000-000000000000
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Invalid request or protocol settings.
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Missing or invalid authentication.
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The caller lacks the product_analytics_experiments_write permission.
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: No protocol with this ID exists in the organization.
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: >-
+ The protocol is archived, a published protocol receives settings changes, or the name is already in use.
+ "415":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unsupported request content type.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - product_analytics_experiments_write
+ summary: Update experiment protocol
+ tags:
+ - Experiments
+ x-permission:
+ operator: AND
+ permissions:
+ - product_analytics_experiments_write
+ put:
+ description: >-
+ Replace the template of a published protocol. Draft and archived protocols return 409. Send subject_type_id, all four required boolean settings, and metric_groups. Omitted optional template fields are cleared. Omitted enforcement keeps the existing locks.
+
+
+ Use primary_metric_id to select the primary metric. Use default_duration_days to set target_duration_days on experiments created from the protocol. The nested metric is_primary and analysis_plan.target_duration_days fields are rejected. An unchanged GET response can be sent as the request body. Response-only fields are ignored.
+
+
+ Independent configuration errors are returned together in the JSON:API errors array. Each error identifies the field in source.pointer. Earlier request and reference checks can stop on the first error. A failed request leaves the protocol unchanged. Changes apply to future experiments; existing experiments keep their settings.
+ operationId: ReplaceExperimentProtocol
+ parameters:
+ - description: The UUID of the protocol.
+ in: path
+ name: protocol_id
+ required: true
+ schema:
+ description: The UUID of the protocol.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ - description: >-
+ The updated_at value from the last read. Include the full timestamp, with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip this check.
+ in: query
+ name: expected_updated_at
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ is_duration_required_to_start: false
+ is_equal_split_enforced: false
+ is_metric_limit_enabled: false
+ is_minimum_duration_enabled: false
+ metric_groups: []
+ subject_type_id: c2b3d4e5-0000-0000-0000-000000000000
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsReplaceExperimentProtocolRequest"
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2026-07-31T12:00:00Z"
+ description: Defaults for checkout experiments.
+ enforcement:
+ confidence_interval_method: LOCKED
+ confidence_level: EDITABLE
+ cuped_calculation: EDITABLE
+ default_duration: EDITABLE
+ environment: EDITABLE
+ flag_source: LOCKED
+ multiple_testing_correction: EDITABLE
+ notifications: EDITABLE
+ primary_metric: EDITABLE
+ secondary_metrics: EDITABLE
+ split_by_exploration_dimensions: EDITABLE
+ subject_type: LOCKED
+ targeting_rules: EDITABLE
+ traffic_exposure: EDITABLE
+ warehouse_exposure_source: EDITABLE
+ experiment_count: 0
+ is_duration_required_to_start: false
+ is_equal_split_enforced: false
+ is_metric_limit_enabled: false
+ is_minimum_duration_enabled: false
+ metric_groups: []
+ name: Checkout protocol
+ published_at: "2026-07-31T12:00:00Z"
+ status: PUBLISHED
+ subject_type:
+ id: c2b3d4e5-0000-0000-0000-000000000000
+ name: User
+ subject_type_id: c2b3d4e5-0000-0000-0000-000000000000
+ updated_at: "2026-07-31T12:00:00Z"
+ id: e4d5f6a7-0000-0000-0000-000000000000
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Invalid request or protocol settings.
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Missing or invalid authentication.
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The caller lacks the product_analytics_experiments_write permission.
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: No protocol with this ID exists in the organization.
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The protocol is not published or expected_updated_at is stale.
+ "415":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Unsupported request content type.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - product_analytics_experiments_write
+ summary: Replace experiment protocol
+ tags:
+ - Experiments
+ x-permission:
+ operator: AND
+ permissions:
+ - product_analytics_experiments_write
+ /api/v2/experiments/protocols/{protocol_id}/archive:
+ post:
+ description: >-
+ Archive a draft or published protocol. Archived protocols cannot be edited or used to create new experiments. Existing experiments keep their settings. Archiving an already archived protocol returns 409.
+ operationId: ArchiveExperimentProtocol
+ parameters:
+ - description: The UUID of the protocol.
+ in: path
+ name: protocol_id
+ required: true
+ schema:
+ description: The UUID of the protocol.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ - description: >-
+ The updated_at value from the last read. Include the full timestamp, with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip this check.
+ in: query
+ name: expected_updated_at
+ schema:
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ archived_at: "2026-07-31T14:00:00Z"
+ created_at: "2026-07-31T12:00:00Z"
+ description: Defaults for checkout experiments.
+ enforcement:
+ confidence_interval_method: LOCKED
+ confidence_level: EDITABLE
+ cuped_calculation: EDITABLE
+ default_duration: EDITABLE
+ environment: EDITABLE
+ flag_source: LOCKED
+ multiple_testing_correction: EDITABLE
+ notifications: EDITABLE
+ primary_metric: EDITABLE
+ secondary_metrics: EDITABLE
+ split_by_exploration_dimensions: EDITABLE
+ subject_type: LOCKED
+ targeting_rules: EDITABLE
+ traffic_exposure: EDITABLE
+ warehouse_exposure_source: EDITABLE
+ experiment_count: 0
+ is_duration_required_to_start: false
+ is_equal_split_enforced: false
+ is_metric_limit_enabled: false
+ is_minimum_duration_enabled: false
+ metric_groups: []
+ name: Checkout protocol
+ published_at: "2026-07-31T12:00:00Z"
+ status: ARCHIVED
+ subject_type:
+ id: c2b3d4e5-0000-0000-0000-000000000000
+ name: User
+ subject_type_id: c2b3d4e5-0000-0000-0000-000000000000
+ updated_at: "2026-07-31T14:00:00Z"
+ id: e4d5f6a7-0000-0000-0000-000000000000
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Invalid request or protocol settings.
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Missing or invalid authentication.
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The caller lacks the product_analytics_experiments_write permission.
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: No protocol with this ID exists in the organization.
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The protocol is already archived or expected_updated_at is stale.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - product_analytics_experiments_write
+ summary: Archive experiment protocol
+ tags:
+ - Experiments
+ x-permission:
+ operator: AND
+ permissions:
+ - product_analytics_experiments_write
+ /api/v2/experiments/protocols/{protocol_id}/publish:
+ post:
+ description: >-
+ Publish a valid draft protocol. The protocol must have a name and subject type. Supplied references and settings must be valid. An exposure schedule or targeting rules require an environment. Enabled limits require their values. Configurable template fields must have a value before they can be locked.
+
+
+ Independent configuration errors are returned together in the JSON:API errors array with source.pointer values that identify the fields. Earlier request and reference checks can stop on the first error. A failed request leaves the protocol unchanged.
+ operationId: PublishExperimentProtocol
+ parameters:
+ - description: The UUID of the protocol.
+ in: path
+ name: protocol_id
+ required: true
+ schema:
+ description: The UUID of the protocol.
+ example: 550e8400-e29b-41d4-a716-446655440000
+ format: uuid
+ type: string
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ created_at: "2026-07-31T12:00:00Z"
+ description: Defaults for checkout experiments.
+ enforcement:
+ confidence_interval_method: LOCKED
+ confidence_level: EDITABLE
+ cuped_calculation: EDITABLE
+ default_duration: EDITABLE
+ environment: EDITABLE
+ flag_source: LOCKED
+ multiple_testing_correction: EDITABLE
+ notifications: EDITABLE
+ primary_metric: EDITABLE
+ secondary_metrics: EDITABLE
+ split_by_exploration_dimensions: EDITABLE
+ subject_type: LOCKED
+ targeting_rules: EDITABLE
+ traffic_exposure: EDITABLE
+ warehouse_exposure_source: EDITABLE
+ experiment_count: 0
+ is_duration_required_to_start: false
+ is_equal_split_enforced: false
+ is_metric_limit_enabled: false
+ is_minimum_duration_enabled: false
+ metric_groups: []
+ name: Checkout protocol
+ published_at: "2026-07-31T12:00:00Z"
+ status: PUBLISHED
+ subject_type:
+ id: c2b3d4e5-0000-0000-0000-000000000000
+ name: User
+ subject_type_id: c2b3d4e5-0000-0000-0000-000000000000
+ updated_at: "2026-07-31T12:00:00Z"
+ id: e4d5f6a7-0000-0000-0000-000000000000
+ type: protocols
+ schema:
+ $ref: "#/components/schemas/ExperimentsPublicProtocolResponse"
+ description: OK
+ "400":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Invalid request or protocol settings.
+ "401":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Missing or invalid authentication.
+ "403":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: The caller lacks the product_analytics_experiments_write permission.
+ "404":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: No protocol with this ID exists in the organization.
+ "409":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Only draft protocols can be published.
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ "500":
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/JSONAPIErrorResponse"
+ description: Internal Server Error
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - product_analytics_experiments_write
+ summary: Publish experiment protocol
+ tags:
+ - Experiments
+ x-permission:
+ operator: AND
+ permissions:
+ - product_analytics_experiments_write
/api/v2/experiments/results/refresh:
post:
description: >-
diff --git a/examples/v2/experiments/ArchiveExperimentProtocol.java b/examples/v2/experiments/ArchiveExperimentProtocol.java
new file mode 100644
index 00000000000..bfa30aaa303
--- /dev/null
+++ b/examples/v2/experiments/ArchiveExperimentProtocol.java
@@ -0,0 +1,41 @@
+// Archive experiment protocol returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ExperimentsApi;
+import com.datadog.api.client.v2.api.ExperimentsApi.ArchiveExperimentProtocolOptionalParameters;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+
+ // there is a valid "experiment_protocol" in the system
+ String EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT =
+ System.getenv("EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT");
+ UUID EXPERIMENT_PROTOCOL_DATA_ID = null;
+ try {
+ EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID"));
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error parsing UUID: " + e.getMessage());
+ }
+
+ try {
+ ExperimentsPublicProtocolResponse result =
+ apiInstance.archiveExperimentProtocol(
+ EXPERIMENT_PROTOCOL_DATA_ID,
+ new ArchiveExperimentProtocolOptionalParameters()
+ .expectedUpdatedAt(EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT));
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ExperimentsApi#archiveExperimentProtocol");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/experiments/CreateExperimentProtocol.java b/examples/v2/experiments/CreateExperimentProtocol.java
new file mode 100644
index 00000000000..a5abae0dc4d
--- /dev/null
+++ b/examples/v2/experiments/CreateExperimentProtocol.java
@@ -0,0 +1,39 @@
+// Create experiment protocol returns "Created" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ExperimentsApi;
+import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequest;
+import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequestData;
+import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequestDataAttributes;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataType;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+
+ ExperimentsCreateExperimentProtocolRequest body =
+ new ExperimentsCreateExperimentProtocolRequest()
+ .data(
+ new ExperimentsCreateExperimentProtocolRequestData()
+ .type(ExperimentsPublicProtocolResponseDataType.PROTOCOLS)
+ .attributes(
+ new ExperimentsCreateExperimentProtocolRequestDataAttributes()
+ .name("ex-protocol-14bb9543f523edde")
+ .description("Protocol created by the API test.")));
+
+ try {
+ ExperimentsPublicProtocolResponse result = apiInstance.createExperimentProtocol(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ExperimentsApi#createExperimentProtocol");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/experiments/DeleteExperimentProtocol.java b/examples/v2/experiments/DeleteExperimentProtocol.java
new file mode 100644
index 00000000000..5851ce51505
--- /dev/null
+++ b/examples/v2/experiments/DeleteExperimentProtocol.java
@@ -0,0 +1,38 @@
+// Delete experiment protocol returns "No Content" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ExperimentsApi;
+import com.datadog.api.client.v2.api.ExperimentsApi.DeleteExperimentProtocolOptionalParameters;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+
+ // there is a valid "experiment_protocol" in the system
+ String EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT =
+ System.getenv("EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT");
+ UUID EXPERIMENT_PROTOCOL_DATA_ID = null;
+ try {
+ EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID"));
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error parsing UUID: " + e.getMessage());
+ }
+
+ try {
+ apiInstance.deleteExperimentProtocol(
+ EXPERIMENT_PROTOCOL_DATA_ID,
+ new DeleteExperimentProtocolOptionalParameters()
+ .expectedUpdatedAt(EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT));
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ExperimentsApi#deleteExperimentProtocol");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/experiments/GetExperimentProtocol.java b/examples/v2/experiments/GetExperimentProtocol.java
index 8ca8497fab7..f4d58ffae7b 100644
--- a/examples/v2/experiments/GetExperimentProtocol.java
+++ b/examples/v2/experiments/GetExperimentProtocol.java
@@ -12,10 +12,17 @@ public static void main(String[] args) {
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+ // there is a valid "experiment_protocol" in the system
+ UUID EXPERIMENT_PROTOCOL_DATA_ID = null;
+ try {
+ EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID"));
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error parsing UUID: " + e.getMessage());
+ }
+
try {
ExperimentsPublicProtocolResponse result =
- apiInstance.getExperimentProtocol(
- UUID.fromString("550e8400-e29b-41d4-a716-446655440000"));
+ apiInstance.getExperimentProtocol(EXPERIMENT_PROTOCOL_DATA_ID);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ExperimentsApi#getExperimentProtocol");
diff --git a/examples/v2/experiments/ListExperimentProtocols.java b/examples/v2/experiments/ListExperimentProtocols.java
index bf1c7d8e3ed..e9e85edcd04 100644
--- a/examples/v2/experiments/ListExperimentProtocols.java
+++ b/examples/v2/experiments/ListExperimentProtocols.java
@@ -3,7 +3,10 @@
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ExperimentsApi;
+import com.datadog.api.client.v2.api.ExperimentsApi.ListExperimentProtocolsOptionalParameters;
import com.datadog.api.client.v2.model.ExperimentsPublicProtocolListResponseArray;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataAttributesStatus;
+import java.util.Collections;
public class Example {
public static void main(String[] args) {
@@ -11,8 +14,18 @@ public static void main(String[] args) {
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+ // there is a valid "experiment_protocol" in the system
+ String EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_NAME =
+ System.getenv("EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_NAME");
+
try {
- ExperimentsPublicProtocolListResponseArray result = apiInstance.listExperimentProtocols();
+ ExperimentsPublicProtocolListResponseArray result =
+ apiInstance.listExperimentProtocols(
+ new ListExperimentProtocolsOptionalParameters()
+ .filterStatus(
+ Collections.singletonList(
+ ExperimentsPublicProtocolResponseDataAttributesStatus.DRAFT))
+ .filterQuery(EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_NAME));
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ExperimentsApi#listExperimentProtocols");
diff --git a/examples/v2/experiments/PatchExperimentProtocol.java b/examples/v2/experiments/PatchExperimentProtocol.java
new file mode 100644
index 00000000000..7e6630d2e0a
--- /dev/null
+++ b/examples/v2/experiments/PatchExperimentProtocol.java
@@ -0,0 +1,49 @@
+// Update experiment protocol returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ExperimentsApi;
+import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequest;
+import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequestData;
+import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequestDataAttributes;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataType;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+
+ // there is a valid "experiment_protocol" in the system
+ UUID EXPERIMENT_PROTOCOL_DATA_ID = null;
+ try {
+ EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID"));
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error parsing UUID: " + e.getMessage());
+ }
+
+ ExperimentsPatchExperimentProtocolRequest body =
+ new ExperimentsPatchExperimentProtocolRequest()
+ .data(
+ new ExperimentsPatchExperimentProtocolRequestData()
+ .type(ExperimentsPublicProtocolResponseDataType.PROTOCOLS)
+ .id(EXPERIMENT_PROTOCOL_DATA_ID)
+ .attributes(
+ new ExperimentsPatchExperimentProtocolRequestDataAttributes()
+ .description("Updated protocol description.")));
+
+ try {
+ ExperimentsPublicProtocolResponse result =
+ apiInstance.patchExperimentProtocol(EXPERIMENT_PROTOCOL_DATA_ID, body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ExperimentsApi#patchExperimentProtocol");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/experiments/PublishExperimentProtocol.java b/examples/v2/experiments/PublishExperimentProtocol.java
new file mode 100644
index 00000000000..6b503c96f4f
--- /dev/null
+++ b/examples/v2/experiments/PublishExperimentProtocol.java
@@ -0,0 +1,36 @@
+// Publish experiment protocol returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ExperimentsApi;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+
+ // there is a valid "configured_experiment_protocol" in the system
+ UUID CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID = null;
+ try {
+ CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID =
+ UUID.fromString(System.getenv("CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID"));
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error parsing UUID: " + e.getMessage());
+ }
+
+ try {
+ ExperimentsPublicProtocolResponse result =
+ apiInstance.publishExperimentProtocol(CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ExperimentsApi#publishExperimentProtocol");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/experiments/ReplaceExperimentProtocol.java b/examples/v2/experiments/ReplaceExperimentProtocol.java
new file mode 100644
index 00000000000..94fed74e262
--- /dev/null
+++ b/examples/v2/experiments/ReplaceExperimentProtocol.java
@@ -0,0 +1,70 @@
+// Replace experiment protocol returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.ExperimentsApi;
+import com.datadog.api.client.v2.api.ExperimentsApi.ReplaceExperimentProtocolOptionalParameters;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse;
+import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataType;
+import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequest;
+import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequestData;
+import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequestDataAttributes;
+import java.util.UUID;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
+ ExperimentsApi apiInstance = new ExperimentsApi(defaultClient);
+
+ // there is a valid "published_protocol" in the system
+ String PUBLISHED_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT =
+ System.getenv("PUBLISHED_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT");
+ UUID PUBLISHED_PROTOCOL_DATA_ID = null;
+ try {
+ PUBLISHED_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("PUBLISHED_PROTOCOL_DATA_ID"));
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error parsing UUID: " + e.getMessage());
+ }
+
+ // there is a valid "experiment_subject_type" in the system
+ UUID EXPERIMENT_SUBJECT_TYPE_DATA_ID = null;
+ try {
+ EXPERIMENT_SUBJECT_TYPE_DATA_ID =
+ UUID.fromString(System.getenv("EXPERIMENT_SUBJECT_TYPE_DATA_ID"));
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error parsing UUID: " + e.getMessage());
+ }
+
+ ExperimentsReplaceExperimentProtocolRequest body =
+ new ExperimentsReplaceExperimentProtocolRequest()
+ .data(
+ new ExperimentsReplaceExperimentProtocolRequestData()
+ .type(ExperimentsPublicProtocolResponseDataType.PROTOCOLS)
+ .id(PUBLISHED_PROTOCOL_DATA_ID)
+ .attributes(
+ new ExperimentsReplaceExperimentProtocolRequestDataAttributes()
+ .subjectTypeId(EXPERIMENT_SUBJECT_TYPE_DATA_ID)
+ .isEqualSplitEnforced(false)
+ .isMinimumDurationEnabled(false)
+ .isDurationRequiredToStart(false)
+ .isMetricLimitEnabled(false)
+ .defaultDurationDays(14L)));
+
+ try {
+ ExperimentsPublicProtocolResponse result =
+ apiInstance.replaceExperimentProtocol(
+ PUBLISHED_PROTOCOL_DATA_ID,
+ body,
+ new ReplaceExperimentProtocolOptionalParameters()
+ .expectedUpdatedAt(PUBLISHED_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT));
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling ExperimentsApi#replaceExperimentProtocol");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java b/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java
index 2d2d9cdfa95..dc9094340b2 100644
--- a/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java
+++ b/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java
@@ -10,6 +10,7 @@
import com.datadog.api.client.v2.model.ExperimentsCancelExperimentV2Request;
import com.datadog.api.client.v2.model.ExperimentsConcludeExperimentV2Request;
import com.datadog.api.client.v2.model.ExperimentsCreateExperimentMetricGroupV2Request;
+import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequest;
import com.datadog.api.client.v2.model.ExperimentsCreateExperimentV2Request;
import com.datadog.api.client.v2.model.ExperimentsCreateExposureSQLModelV2Request;
import com.datadog.api.client.v2.model.ExperimentsCreateMetricCollectionV2Request;
@@ -30,6 +31,7 @@
import com.datadog.api.client.v2.model.ExperimentsMetricV2DTO;
import com.datadog.api.client.v2.model.ExperimentsMetricV2DTOArray;
import com.datadog.api.client.v2.model.ExperimentsPatchExperimentMetricGroupV2Request;
+import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequest;
import com.datadog.api.client.v2.model.ExperimentsPatchExperimentV2Request;
import com.datadog.api.client.v2.model.ExperimentsPatchExperimentV2Response;
import com.datadog.api.client.v2.model.ExperimentsPatchMetricCollectionV2Request;
@@ -39,6 +41,7 @@
import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataAttributesStatus;
import com.datadog.api.client.v2.model.ExperimentsRefreshExperimentResultsV2DTO;
import com.datadog.api.client.v2.model.ExperimentsRefreshExperimentResultsV2DTOArray;
+import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequest;
import com.datadog.api.client.v2.model.ExperimentsStartExperimentV2Request;
import com.datadog.api.client.v2.model.ExperimentsSubjectTypeV2DTO;
import com.datadog.api.client.v2.model.ExperimentsSubjectTypeV2DTOArray;
@@ -88,6 +91,223 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
+ /** Manage optional parameters to archiveExperimentProtocol. */
+ public static class ArchiveExperimentProtocolOptionalParameters {
+ private String expectedUpdatedAt;
+
+ /**
+ * Set expectedUpdatedAt.
+ *
+ * @param expectedUpdatedAt The updated_at value from the last read. Include the full timestamp,
+ * with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip
+ * this check. (optional)
+ * @return ArchiveExperimentProtocolOptionalParameters
+ */
+ public ArchiveExperimentProtocolOptionalParameters expectedUpdatedAt(String expectedUpdatedAt) {
+ this.expectedUpdatedAt = expectedUpdatedAt;
+ return this;
+ }
+ }
+
+ /**
+ * Archive experiment protocol.
+ *
+ *
See {@link #archiveExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @return ExperimentsPublicProtocolResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ExperimentsPublicProtocolResponse archiveExperimentProtocol(UUID protocolId)
+ throws ApiException {
+ return archiveExperimentProtocolWithHttpInfo(
+ protocolId, new ArchiveExperimentProtocolOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * Archive experiment protocol.
+ *
+ *
See {@link #archiveExperimentProtocolWithHttpInfoAsync}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @return CompletableFuture<ExperimentsPublicProtocolResponse>
+ */
+ public CompletableFuture archiveExperimentProtocolAsync(
+ UUID protocolId) {
+ return archiveExperimentProtocolWithHttpInfoAsync(
+ protocolId, new ArchiveExperimentProtocolOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Archive experiment protocol.
+ *
+ * See {@link #archiveExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
+ * @return ExperimentsPublicProtocolResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ExperimentsPublicProtocolResponse archiveExperimentProtocol(
+ UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) throws ApiException {
+ return archiveExperimentProtocolWithHttpInfo(protocolId, parameters).getData();
+ }
+
+ /**
+ * Archive experiment protocol.
+ *
+ *
See {@link #archiveExperimentProtocolWithHttpInfoAsync}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ExperimentsPublicProtocolResponse>
+ */
+ public CompletableFuture archiveExperimentProtocolAsync(
+ UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) {
+ return archiveExperimentProtocolWithHttpInfoAsync(protocolId, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Archive a draft or published protocol. Archived protocols cannot be edited or used to create
+ * new experiments. Existing experiments keep their settings. Archiving an already archived
+ * protocol returns 409.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<ExperimentsPublicProtocolResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Invalid request or protocol settings. | - |
+ * | 401 | Missing or invalid authentication. | - |
+ * | 403 | The caller lacks the product_analytics_experiments_write permission. | - |
+ * | 404 | No protocol with this ID exists in the organization. | - |
+ * | 409 | The protocol is already archived or expected_updated_at is stale. | - |
+ * | 429 | Too many requests | - |
+ * | 500 | Internal Server Error | - |
+ *
+ */
+ public ApiResponse archiveExperimentProtocolWithHttpInfo(
+ UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'protocolId' when calling archiveExperimentProtocol");
+ }
+ String expectedUpdatedAt = parameters.expectedUpdatedAt;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/protocols/{protocol_id}/archive"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.archiveExperimentProtocol",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Archive experiment protocol.
+ *
+ * See {@link #archiveExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>>
+ */
+ public CompletableFuture>
+ archiveExperimentProtocolWithHttpInfoAsync(
+ UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'protocolId' when calling"
+ + " archiveExperimentProtocol"));
+ return result;
+ }
+ String expectedUpdatedAt = parameters.expectedUpdatedAt;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/protocols/{protocol_id}/archive"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.archiveExperimentProtocol",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
/**
* Archive exposure SQL model.
*
@@ -1087,30 +1307,30 @@ public ExperimentsExperimentMetricGroupMutationV2 createExperimentMetricGroupFro
}
/**
- * Create exposure SQL model.
+ * Create experiment protocol.
*
- * See {@link #createExposureSQLModelWithHttpInfo}.
+ *
See {@link #createExperimentProtocolWithHttpInfo}.
*
* @param body (required)
- * @return ExperimentsExposureSQLModelV2DTO
+ * @return ExperimentsPublicProtocolResponse
* @throws ApiException if fails to make API call
*/
- public ExperimentsExposureSQLModelV2DTO createExposureSQLModel(
- ExperimentsCreateExposureSQLModelV2Request body) throws ApiException {
- return createExposureSQLModelWithHttpInfo(body).getData();
+ public ExperimentsPublicProtocolResponse createExperimentProtocol(
+ ExperimentsCreateExperimentProtocolRequest body) throws ApiException {
+ return createExperimentProtocolWithHttpInfo(body).getData();
}
/**
- * Create exposure SQL model.
+ * Create experiment protocol.
*
- *
See {@link #createExposureSQLModelWithHttpInfoAsync}.
+ *
See {@link #createExperimentProtocolWithHttpInfoAsync}.
*
* @param body (required)
- * @return CompletableFuture<ExperimentsExposureSQLModelV2DTO>
+ * @return CompletableFuture<ExperimentsPublicProtocolResponse>
*/
- public CompletableFuture createExposureSQLModelAsync(
- ExperimentsCreateExposureSQLModelV2Request body) {
- return createExposureSQLModelWithHttpInfoAsync(body)
+ public CompletableFuture createExperimentProtocolAsync(
+ ExperimentsCreateExperimentProtocolRequest body) {
+ return createExperimentProtocolWithHttpInfoAsync(body)
.thenApply(
response -> {
return response.getData();
@@ -1118,42 +1338,44 @@ public CompletableFuture createExposureSQLMode
}
/**
- * Create an exposure SQL model. Requires at least one subject type. The warehouse connection is
- * resolved from the organization, which has exactly one.
+ * Create a draft protocol with a name and optional description and migration metadata. The
+ * organization's default subject type is selected. Use PATCH to configure the draft, then publish
+ * it before creating experiments from it.
*
* @param body (required)
- * @return ApiResponse<ExperimentsExposureSQLModelV2DTO>
+ * @return ApiResponse<ExperimentsPublicProtocolResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*
* Response details
* | Status Code | Description | Response Headers |
* | 201 | Created | - |
- * | 400 | Malformed body, validation failure, or the SQL was rejected by the warehouse validator. | - |
+ * | 400 | Invalid request or protocol settings. | - |
* | 401 | Missing or invalid authentication. | - |
- * | 403 | Authenticated caller lacks the product_analytics_warehouse_model_write permission. | - |
- * | 409 | The write collided with an existing record for the organization. | - |
- * | 415 | Request body sent with a media type other than application/json or application/vnd.api+json. | - |
+ * | 403 | The caller lacks the product_analytics_experiments_write permission. | - |
+ * | 409 | A protocol with this name already exists. | - |
+ * | 415 | Unsupported request content type. | - |
* | 429 | Too many requests | - |
+ * | 500 | Internal Server Error | - |
*
*/
- public ApiResponse createExposureSQLModelWithHttpInfo(
- ExperimentsCreateExposureSQLModelV2Request body) throws ApiException {
+ public ApiResponse createExperimentProtocolWithHttpInfo(
+ ExperimentsCreateExperimentProtocolRequest body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
- 400, "Missing the required parameter 'body' when calling createExposureSQLModel");
+ 400, "Missing the required parameter 'body' when calling createExperimentProtocol");
}
// create path and map variables
- String localVarPath = "/api/v2/experiments/exposure-sql-models";
+ String localVarPath = "/api/v2/experiments/protocols";
Map localVarHeaderParams = new HashMap();
Invocation.Builder builder =
apiClient.createBuilder(
- "v2.ExperimentsApi.createExposureSQLModel",
+ "v2.ExperimentsApi.createExperimentProtocol",
localVarPath,
new ArrayList(),
localVarHeaderParams,
@@ -1168,32 +1390,32 @@ public ApiResponse createExposureSQLModelWithH
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
+ new GenericType() {});
}
/**
- * Create exposure SQL model.
+ * Create experiment protocol.
*
- * See {@link #createExposureSQLModelWithHttpInfo}.
+ *
See {@link #createExperimentProtocolWithHttpInfo}.
*
* @param body (required)
- * @return CompletableFuture<ApiResponse<ExperimentsExposureSQLModelV2DTO>>
+ * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>>
*/
- public CompletableFuture>
- createExposureSQLModelWithHttpInfoAsync(ExperimentsCreateExposureSQLModelV2Request body) {
+ public CompletableFuture>
+ createExperimentProtocolWithHttpInfoAsync(ExperimentsCreateExperimentProtocolRequest body) {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
- CompletableFuture> result =
+ CompletableFuture> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
- 400, "Missing the required parameter 'body' when calling createExposureSQLModel"));
+ 400, "Missing the required parameter 'body' when calling createExperimentProtocol"));
return result;
}
// create path and map variables
- String localVarPath = "/api/v2/experiments/exposure-sql-models";
+ String localVarPath = "/api/v2/experiments/protocols";
Map localVarHeaderParams = new HashMap();
@@ -1201,7 +1423,7 @@ public ApiResponse createExposureSQLModelWithH
try {
builder =
apiClient.createBuilder(
- "v2.ExperimentsApi.createExposureSQLModel",
+ "v2.ExperimentsApi.createExperimentProtocol",
localVarPath,
new ArrayList(),
localVarHeaderParams,
@@ -1209,7 +1431,7 @@ public ApiResponse createExposureSQLModelWithH
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
- CompletableFuture> result =
+ CompletableFuture> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
@@ -1222,34 +1444,34 @@ public ApiResponse createExposureSQLModelWithH
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
+ new GenericType() {});
}
/**
- * Create metric.
+ * Create exposure SQL model.
*
- * See {@link #createMetricWithHttpInfo}.
+ *
See {@link #createExposureSQLModelWithHttpInfo}.
*
* @param body (required)
- * @return ExperimentsMetricV2DTO
+ * @return ExperimentsExposureSQLModelV2DTO
* @throws ApiException if fails to make API call
*/
- public ExperimentsMetricV2DTO createMetric(ExperimentsCreateMetricV2Request body)
- throws ApiException {
- return createMetricWithHttpInfo(body).getData();
+ public ExperimentsExposureSQLModelV2DTO createExposureSQLModel(
+ ExperimentsCreateExposureSQLModelV2Request body) throws ApiException {
+ return createExposureSQLModelWithHttpInfo(body).getData();
}
/**
- * Create metric.
+ * Create exposure SQL model.
*
- *
See {@link #createMetricWithHttpInfoAsync}.
+ *
See {@link #createExposureSQLModelWithHttpInfoAsync}.
*
* @param body (required)
- * @return CompletableFuture<ExperimentsMetricV2DTO>
+ * @return CompletableFuture<ExperimentsExposureSQLModelV2DTO>
*/
- public CompletableFuture createMetricAsync(
- ExperimentsCreateMetricV2Request body) {
- return createMetricWithHttpInfoAsync(body)
+ public CompletableFuture createExposureSQLModelAsync(
+ ExperimentsCreateExposureSQLModelV2Request body) {
+ return createExposureSQLModelWithHttpInfoAsync(body)
.thenApply(
response -> {
return response.getData();
@@ -1257,40 +1479,179 @@ public CompletableFuture createMetricAsync(
}
/**
- * Create a metric. The metric's type is derived from the aggregation shape: a numerator alone is
- * SIMPLE, a numerator with a denominator is RATIO, and a percentile aggregation is PERCENTILE.
- * Warehouse aggregations reference measures by UUID. Property filters use property_id or
- * measure_id UUIDs returned by the same metric SQL model; every reference must belong to the
- * aggregation's data source. The is_certified attribute is rejected. Certification cannot be
- * changed through this endpoint.
+ * Create an exposure SQL model. Requires at least one subject type. The warehouse connection is
+ * resolved from the organization, which has exactly one.
*
* @param body (required)
- * @return ApiResponse<ExperimentsMetricV2DTO>
+ * @return ApiResponse<ExperimentsExposureSQLModelV2DTO>
* @throws ApiException if fails to make API call
* @http.response.details
*
* Response details
* | Status Code | Description | Response Headers |
* | 201 | Created | - |
- * | 400 | Malformed body, validation failure, or an aggregation that does not match metric_type. | - |
+ * | 400 | Malformed body, validation failure, or the SQL was rejected by the warehouse validator. | - |
* | 401 | Missing or invalid authentication. | - |
- * | 403 | Caller lacks product_analytics_metrics_write. | - |
- * | 409 | Another metric in this organization already uses one of these values. | - |
+ * | 403 | Authenticated caller lacks the product_analytics_warehouse_model_write permission. | - |
+ * | 409 | The write collided with an existing record for the organization. | - |
* | 415 | Request body sent with a media type other than application/json or application/vnd.api+json. | - |
* | 429 | Too many requests | - |
*
*/
- public ApiResponse createMetricWithHttpInfo(
- ExperimentsCreateMetricV2Request body) throws ApiException {
+ public ApiResponse createExposureSQLModelWithHttpInfo(
+ ExperimentsCreateExposureSQLModelV2Request body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
- 400, "Missing the required parameter 'body' when calling createMetric");
+ 400, "Missing the required parameter 'body' when calling createExposureSQLModel");
}
// create path and map variables
- String localVarPath = "/api/v2/experiments/metrics";
+ String localVarPath = "/api/v2/experiments/exposure-sql-models";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.createExposureSQLModel",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create exposure SQL model.
+ *
+ * See {@link #createExposureSQLModelWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<ExperimentsExposureSQLModelV2DTO>>
+ */
+ public CompletableFuture>
+ createExposureSQLModelWithHttpInfoAsync(ExperimentsCreateExposureSQLModelV2Request body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling createExposureSQLModel"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/experiments/exposure-sql-models";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.createExposureSQLModel",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create metric.
+ *
+ * See {@link #createMetricWithHttpInfo}.
+ *
+ * @param body (required)
+ * @return ExperimentsMetricV2DTO
+ * @throws ApiException if fails to make API call
+ */
+ public ExperimentsMetricV2DTO createMetric(ExperimentsCreateMetricV2Request body)
+ throws ApiException {
+ return createMetricWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Create metric.
+ *
+ *
See {@link #createMetricWithHttpInfoAsync}.
+ *
+ * @param body (required)
+ * @return CompletableFuture<ExperimentsMetricV2DTO>
+ */
+ public CompletableFuture createMetricAsync(
+ ExperimentsCreateMetricV2Request body) {
+ return createMetricWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Create a metric. The metric's type is derived from the aggregation shape: a numerator alone is
+ * SIMPLE, a numerator with a denominator is RATIO, and a percentile aggregation is PERCENTILE.
+ * Warehouse aggregations reference measures by UUID. Property filters use property_id or
+ * measure_id UUIDs returned by the same metric SQL model; every reference must belong to the
+ * aggregation's data source. The is_certified attribute is rejected. Certification cannot be
+ * changed through this endpoint.
+ *
+ * @param body (required)
+ * @return ApiResponse<ExperimentsMetricV2DTO>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 201 | Created | - |
+ * | 400 | Malformed body, validation failure, or an aggregation that does not match metric_type. | - |
+ * | 401 | Missing or invalid authentication. | - |
+ * | 403 | Caller lacks product_analytics_metrics_write. | - |
+ * | 409 | Another metric in this organization already uses one of these values. | - |
+ * | 415 | Request body sent with a media type other than application/json or application/vnd.api+json. | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse createMetricWithHttpInfo(
+ ExperimentsCreateMetricV2Request body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createMetric");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/experiments/metrics";
Map localVarHeaderParams = new HashMap();
@@ -2096,28 +2457,48 @@ public CompletableFuture> deleteExperimentMetricGroupWithHttpI
null);
}
+ /** Manage optional parameters to deleteExperimentProtocol. */
+ public static class DeleteExperimentProtocolOptionalParameters {
+ private String expectedUpdatedAt;
+
+ /**
+ * Set expectedUpdatedAt.
+ *
+ * @param expectedUpdatedAt The updated_at value from the last read. Include the full timestamp,
+ * with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip
+ * this check. (optional)
+ * @return DeleteExperimentProtocolOptionalParameters
+ */
+ public DeleteExperimentProtocolOptionalParameters expectedUpdatedAt(String expectedUpdatedAt) {
+ this.expectedUpdatedAt = expectedUpdatedAt;
+ return this;
+ }
+ }
+
/**
- * Delete metric.
+ * Delete experiment protocol.
*
- * See {@link #deleteMetricWithHttpInfo}.
+ *
See {@link #deleteExperimentProtocolWithHttpInfo}.
*
- * @param metricId The UUID of the metric. (required)
+ * @param protocolId The UUID of the protocol. (required)
* @throws ApiException if fails to make API call
*/
- public void deleteMetric(UUID metricId) throws ApiException {
- deleteMetricWithHttpInfo(metricId);
+ public void deleteExperimentProtocol(UUID protocolId) throws ApiException {
+ deleteExperimentProtocolWithHttpInfo(
+ protocolId, new DeleteExperimentProtocolOptionalParameters());
}
/**
- * Delete metric.
+ * Delete experiment protocol.
*
- *
See {@link #deleteMetricWithHttpInfoAsync}.
+ *
See {@link #deleteExperimentProtocolWithHttpInfoAsync}.
*
- * @param metricId The UUID of the metric. (required)
+ * @param protocolId The UUID of the protocol. (required)
* @return CompletableFuture
*/
- public CompletableFuture deleteMetricAsync(UUID metricId) {
- return deleteMetricWithHttpInfoAsync(metricId)
+ public CompletableFuture deleteExperimentProtocolAsync(UUID protocolId) {
+ return deleteExperimentProtocolWithHttpInfoAsync(
+ protocolId, new DeleteExperimentProtocolOptionalParameters())
.thenApply(
response -> {
return response.getData();
@@ -2125,46 +2506,86 @@ public CompletableFuture deleteMetricAsync(UUID metricId) {
}
/**
- * Delete a metric. Certified metrics are read-only through this endpoint. The record is
- * soft-deleted and stops appearing in reads. A metric still referenced by an experiment cannot be
- * deleted; detach it from those experiments first.
+ * Delete experiment protocol.
*
- * @param metricId The UUID of the metric. (required)
+ * See {@link #deleteExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteExperimentProtocol(
+ UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) throws ApiException {
+ deleteExperimentProtocolWithHttpInfo(protocolId, parameters);
+ }
+
+ /**
+ * Delete experiment protocol.
+ *
+ *
See {@link #deleteExperimentProtocolWithHttpInfoAsync}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteExperimentProtocolAsync(
+ UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) {
+ return deleteExperimentProtocolWithHttpInfoAsync(protocolId, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Delete a protocol with no linked experiments. Draft, published, and archived protocols can be
+ * deleted. Returns 204 with no response body.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
* @return ApiResponse<Void>
* @throws ApiException if fails to make API call
* @http.response.details
*
* Response details
* | Status Code | Description | Response Headers |
- * | 204 | The metric was deleted. | - |
- * | 400 | Malformed metric ID (not a valid UUID). | - |
+ * | 204 | No Content | - |
+ * | 400 | Invalid request or protocol settings. | - |
* | 401 | Missing or invalid authentication. | - |
- * | 403 | Caller lacks product_analytics_metrics_write or edit access to this specific metric. | - |
- * | 404 | No metric with this ID exists for the organization. | - |
- * | 409 | The metric is imported, certified, managed by metric sync, or still referenced by one or more experiments and cannot be deleted. | - |
+ * | 403 | The caller lacks the product_analytics_experiments_write permission. | - |
+ * | 404 | No protocol with this ID exists in the organization. | - |
+ * | 409 | The protocol has linked experiments or expected_updated_at is stale. | - |
* | 429 | Too many requests | - |
+ * | 500 | Internal Server Error | - |
*
*/
- public ApiResponse deleteMetricWithHttpInfo(UUID metricId) throws ApiException {
+ public ApiResponse deleteExperimentProtocolWithHttpInfo(
+ UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) throws ApiException {
Object localVarPostBody = null;
- // verify the required parameter 'metricId' is set
- if (metricId == null) {
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
throw new ApiException(
- 400, "Missing the required parameter 'metricId' when calling deleteMetric");
+ 400, "Missing the required parameter 'protocolId' when calling deleteExperimentProtocol");
}
+ String expectedUpdatedAt = parameters.expectedUpdatedAt;
// create path and map variables
String localVarPath =
- "/api/v2/experiments/metrics/{metric_id}"
- .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString()));
+ "/api/v2/experiments/protocols/{protocol_id}"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+ List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt));
+
Invocation.Builder builder =
apiClient.createBuilder(
- "v2.ExperimentsApi.deleteMetric",
+ "v2.ExperimentsApi.deleteExperimentProtocol",
localVarPath,
- new ArrayList(),
+ localVarQueryParams,
localVarHeaderParams,
new HashMap(),
new String[] {"*/*"},
@@ -2181,38 +2602,47 @@ public ApiResponse deleteMetricWithHttpInfo(UUID metricId) throws ApiExcep
}
/**
- * Delete metric.
+ * Delete experiment protocol.
*
- * See {@link #deleteMetricWithHttpInfo}.
+ *
See {@link #deleteExperimentProtocolWithHttpInfo}.
*
- * @param metricId The UUID of the metric. (required)
+ * @param protocolId The UUID of the protocol. (required)
+ * @param parameters Optional parameters for the request.
* @return CompletableFuture<ApiResponse<Void>>
*/
- public CompletableFuture> deleteMetricWithHttpInfoAsync(UUID metricId) {
+ public CompletableFuture> deleteExperimentProtocolWithHttpInfoAsync(
+ UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) {
Object localVarPostBody = null;
- // verify the required parameter 'metricId' is set
- if (metricId == null) {
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
CompletableFuture> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
- 400, "Missing the required parameter 'metricId' when calling deleteMetric"));
+ 400,
+ "Missing the required parameter 'protocolId' when calling deleteExperimentProtocol"));
return result;
}
+ String expectedUpdatedAt = parameters.expectedUpdatedAt;
// create path and map variables
String localVarPath =
- "/api/v2/experiments/metrics/{metric_id}"
- .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString()));
+ "/api/v2/experiments/protocols/{protocol_id}"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+ List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt));
+
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
- "v2.ExperimentsApi.deleteMetric",
+ "v2.ExperimentsApi.deleteExperimentProtocol",
localVarPath,
- new ArrayList(),
+ localVarQueryParams,
localVarHeaderParams,
new HashMap(),
new String[] {"*/*"},
@@ -2234,27 +2664,164 @@ public CompletableFuture> deleteMetricWithHttpInfoAsync(UUID m
}
/**
- * Delete metric collection.
+ * Delete metric.
*
- * See {@link #deleteMetricCollectionWithHttpInfo}.
+ *
See {@link #deleteMetricWithHttpInfo}.
*
- * @param metricCollectionId The UUID of the metric collection. (required)
+ * @param metricId The UUID of the metric. (required)
* @throws ApiException if fails to make API call
*/
- public void deleteMetricCollection(UUID metricCollectionId) throws ApiException {
- deleteMetricCollectionWithHttpInfo(metricCollectionId);
+ public void deleteMetric(UUID metricId) throws ApiException {
+ deleteMetricWithHttpInfo(metricId);
}
/**
- * Delete metric collection.
+ * Delete metric.
*
- *
See {@link #deleteMetricCollectionWithHttpInfoAsync}.
+ *
See {@link #deleteMetricWithHttpInfoAsync}.
*
- * @param metricCollectionId The UUID of the metric collection. (required)
+ * @param metricId The UUID of the metric. (required)
* @return CompletableFuture
*/
- public CompletableFuture deleteMetricCollectionAsync(UUID metricCollectionId) {
- return deleteMetricCollectionWithHttpInfoAsync(metricCollectionId)
+ public CompletableFuture deleteMetricAsync(UUID metricId) {
+ return deleteMetricWithHttpInfoAsync(metricId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Delete a metric. Certified metrics are read-only through this endpoint. The record is
+ * soft-deleted and stops appearing in reads. A metric still referenced by an experiment cannot be
+ * deleted; detach it from those experiments first.
+ *
+ * @param metricId The UUID of the metric. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 204 | The metric was deleted. | - |
+ * | 400 | Malformed metric ID (not a valid UUID). | - |
+ * | 401 | Missing or invalid authentication. | - |
+ * | 403 | Caller lacks product_analytics_metrics_write or edit access to this specific metric. | - |
+ * | 404 | No metric with this ID exists for the organization. | - |
+ * | 409 | The metric is imported, certified, managed by metric sync, or still referenced by one or more experiments and cannot be deleted. | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteMetricWithHttpInfo(UUID metricId) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'metricId' is set
+ if (metricId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'metricId' when calling deleteMetric");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/metrics/{metric_id}"
+ .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.deleteMetric",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete metric.
+ *
+ * See {@link #deleteMetricWithHttpInfo}.
+ *
+ * @param metricId The UUID of the metric. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteMetricWithHttpInfoAsync(UUID metricId) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'metricId' is set
+ if (metricId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'metricId' when calling deleteMetric"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/metrics/{metric_id}"
+ .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.deleteMetric",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete metric collection.
+ *
+ * See {@link #deleteMetricCollectionWithHttpInfo}.
+ *
+ * @param metricCollectionId The UUID of the metric collection. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteMetricCollection(UUID metricCollectionId) throws ApiException {
+ deleteMetricCollectionWithHttpInfo(metricCollectionId);
+ }
+
+ /**
+ * Delete metric collection.
+ *
+ *
See {@link #deleteMetricCollectionWithHttpInfoAsync}.
+ *
+ * @param metricCollectionId The UUID of the metric collection. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteMetricCollectionAsync(UUID metricCollectionId) {
+ return deleteMetricCollectionWithHttpInfoAsync(metricCollectionId)
.thenApply(
response -> {
return response.getData();
@@ -6634,32 +7201,32 @@ public ApiResponse patchExperimentWithHttp
}
/**
- * Patch subject type.
+ * Update experiment protocol.
*
- * See {@link #patchSubjectTypeWithHttpInfo}.
+ *
See {@link #patchExperimentProtocolWithHttpInfo}.
*
- * @param subjectTypeId The UUID of the subject type. (required)
+ * @param protocolId The UUID of the protocol. (required)
* @param body (required)
- * @return ExperimentsSubjectTypeV2DTO
+ * @return ExperimentsPublicProtocolResponse
* @throws ApiException if fails to make API call
*/
- public ExperimentsSubjectTypeV2DTO patchSubjectType(
- UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException {
- return patchSubjectTypeWithHttpInfo(subjectTypeId, body).getData();
+ public ExperimentsPublicProtocolResponse patchExperimentProtocol(
+ UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) throws ApiException {
+ return patchExperimentProtocolWithHttpInfo(protocolId, body).getData();
}
/**
- * Patch subject type.
+ * Update experiment protocol.
*
- *
See {@link #patchSubjectTypeWithHttpInfoAsync}.
+ *
See {@link #patchExperimentProtocolWithHttpInfoAsync}.
*
- * @param subjectTypeId The UUID of the subject type. (required)
+ * @param protocolId The UUID of the protocol. (required)
* @param body (required)
- * @return CompletableFuture<ExperimentsSubjectTypeV2DTO>
+ * @return CompletableFuture<ExperimentsPublicProtocolResponse>
*/
- public CompletableFuture patchSubjectTypeAsync(
- UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) {
- return patchSubjectTypeWithHttpInfoAsync(subjectTypeId, body)
+ public CompletableFuture patchExperimentProtocolAsync(
+ UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) {
+ return patchExperimentProtocolWithHttpInfoAsync(protocolId, body)
.thenApply(
response -> {
return response.getData();
@@ -6667,54 +7234,61 @@ public CompletableFuture patchSubjectTypeAsync(
}
/**
- * Update mutable fields on a subject type. Only the fields present in the body are changed. Any
- * subject type can be updated, including the organization's default one, but the is_default flag
- * itself is read-only here: which subject type is the default cannot be changed through this
- * endpoint.
+ * Update the supplied fields of a draft protocol. Published protocols accept only name,
+ * description, and migration_metadata changes through PATCH. Use PUT to replace their settings.
+ * Archived protocols cannot be edited.
*
- * @param subjectTypeId The UUID of the subject type. (required)
+ * Omitted fields keep their current values, including fields inside analysis_plan,
+ * exposure_schedule, and enforcement. Arrays replace the stored arrays. Supported null values
+ * clear fields; see the request schema. Use primary_metric_id to select the primary metric and
+ * default_duration_days to set the experiment analysis duration. Nested metric is_primary and
+ * analysis_plan.target_duration_days fields are rejected.
+ *
+ * @param protocolId The UUID of the protocol. (required)
* @param body (required)
- * @return ApiResponse<ExperimentsSubjectTypeV2DTO>
+ * @return ApiResponse<ExperimentsPublicProtocolResponse>
* @throws ApiException if fails to make API call
* @http.response.details
*
* Response details
* | Status Code | Description | Response Headers |
* | 200 | OK | - |
- * | 400 | Malformed subject type ID, malformed body, or no updatable field supplied. | - |
+ * | 400 | Invalid request or protocol settings. | - |
* | 401 | Missing or invalid authentication. | - |
- * | 403 | Authenticated caller lacks the product_analytics_settings_write permission. | - |
- * | 404 | No subject type with this ID exists for the organization. | - |
+ * | 403 | The caller lacks the product_analytics_experiments_write permission. | - |
+ * | 404 | No protocol with this ID exists in the organization. | - |
+ * | 409 | The protocol is archived, a published protocol receives settings changes, or the name is already in use. | - |
+ * | 415 | Unsupported request content type. | - |
* | 429 | Too many requests | - |
+ * | 500 | Internal Server Error | - |
*
*/
- public ApiResponse patchSubjectTypeWithHttpInfo(
- UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException {
+ public ApiResponse patchExperimentProtocolWithHttpInfo(
+ UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) throws ApiException {
Object localVarPostBody = body;
- // verify the required parameter 'subjectTypeId' is set
- if (subjectTypeId == null) {
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
throw new ApiException(
- 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType");
+ 400, "Missing the required parameter 'protocolId' when calling patchExperimentProtocol");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
- 400, "Missing the required parameter 'body' when calling patchSubjectType");
+ 400, "Missing the required parameter 'body' when calling patchExperimentProtocol");
}
// create path and map variables
String localVarPath =
- "/api/v2/experiments/subject-types/{subject_type_id}"
+ "/api/v2/experiments/protocols/{protocol_id}"
.replaceAll(
- "\\{" + "subject_type_id" + "\\}",
- apiClient.escapeString(subjectTypeId.toString()));
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
Map localVarHeaderParams = new HashMap();
Invocation.Builder builder =
apiClient.createBuilder(
- "v2.ExperimentsApi.patchSubjectType",
+ "v2.ExperimentsApi.patchExperimentProtocol",
localVarPath,
new ArrayList(),
localVarHeaderParams,
@@ -6729,48 +7303,48 @@ public ApiResponse patchSubjectTypeWithHttpInfo(
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
+ new GenericType() {});
}
/**
- * Patch subject type.
+ * Update experiment protocol.
*
- * See {@link #patchSubjectTypeWithHttpInfo}.
+ *
See {@link #patchExperimentProtocolWithHttpInfo}.
*
- * @param subjectTypeId The UUID of the subject type. (required)
+ * @param protocolId The UUID of the protocol. (required)
* @param body (required)
- * @return CompletableFuture<ApiResponse<ExperimentsSubjectTypeV2DTO>>
+ * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>>
*/
- public CompletableFuture>
- patchSubjectTypeWithHttpInfoAsync(
- UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) {
+ public CompletableFuture>
+ patchExperimentProtocolWithHttpInfoAsync(
+ UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) {
Object localVarPostBody = body;
- // verify the required parameter 'subjectTypeId' is set
- if (subjectTypeId == null) {
- CompletableFuture> result =
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
+ CompletableFuture> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
- 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType"));
+ 400,
+ "Missing the required parameter 'protocolId' when calling patchExperimentProtocol"));
return result;
}
// verify the required parameter 'body' is set
if (body == null) {
- CompletableFuture> result =
+ CompletableFuture> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
- 400, "Missing the required parameter 'body' when calling patchSubjectType"));
+ 400, "Missing the required parameter 'body' when calling patchExperimentProtocol"));
return result;
}
// create path and map variables
String localVarPath =
- "/api/v2/experiments/subject-types/{subject_type_id}"
+ "/api/v2/experiments/protocols/{protocol_id}"
.replaceAll(
- "\\{" + "subject_type_id" + "\\}",
- apiClient.escapeString(subjectTypeId.toString()));
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
Map localVarHeaderParams = new HashMap();
@@ -6778,7 +7352,7 @@ public ApiResponse patchSubjectTypeWithHttpInfo(
try {
builder =
apiClient.createBuilder(
- "v2.ExperimentsApi.patchSubjectType",
+ "v2.ExperimentsApi.patchExperimentProtocol",
localVarPath,
new ArrayList(),
localVarHeaderParams,
@@ -6786,7 +7360,7 @@ public ApiResponse patchSubjectTypeWithHttpInfo(
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
- CompletableFuture> result =
+ CompletableFuture> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
@@ -6799,49 +7373,373 @@ public ApiResponse patchSubjectTypeWithHttpInfo(
localVarPostBody,
new HashMap(),
false,
- new GenericType() {});
- }
-
- /** Manage optional parameters to refreshExperimentResults. */
- public static class RefreshExperimentResultsOptionalParameters {
- private Boolean fullRefresh;
-
- /**
- * Set fullRefresh.
- *
- * @param fullRefresh Force a full warehouse rebuild. Defaults to false when omitted. (optional)
- * @return RefreshExperimentResultsOptionalParameters
- */
- public RefreshExperimentResultsOptionalParameters fullRefresh(Boolean fullRefresh) {
- this.fullRefresh = fullRefresh;
- return this;
- }
+ new GenericType() {});
}
/**
- * Refresh experiment results.
+ * Patch subject type.
*
- * See {@link #refreshExperimentResultsWithHttpInfo}.
+ *
See {@link #patchSubjectTypeWithHttpInfo}.
*
- * @param experimentId The UUID of the experiment. (required)
- * @return ExperimentsRefreshExperimentResultsV2DTO
+ * @param subjectTypeId The UUID of the subject type. (required)
+ * @param body (required)
+ * @return ExperimentsSubjectTypeV2DTO
* @throws ApiException if fails to make API call
*/
- public ExperimentsRefreshExperimentResultsV2DTO refreshExperimentResults(UUID experimentId)
- throws ApiException {
- return refreshExperimentResultsWithHttpInfo(
- experimentId, new RefreshExperimentResultsOptionalParameters())
- .getData();
+ public ExperimentsSubjectTypeV2DTO patchSubjectType(
+ UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException {
+ return patchSubjectTypeWithHttpInfo(subjectTypeId, body).getData();
}
/**
- * Refresh experiment results.
+ * Patch subject type.
*
- *
See {@link #refreshExperimentResultsWithHttpInfoAsync}.
+ *
See {@link #patchSubjectTypeWithHttpInfoAsync}.
*
- * @param experimentId The UUID of the experiment. (required)
- * @return CompletableFuture<ExperimentsRefreshExperimentResultsV2DTO>
- */
+ * @param subjectTypeId The UUID of the subject type. (required)
+ * @param body (required)
+ * @return CompletableFuture<ExperimentsSubjectTypeV2DTO>
+ */
+ public CompletableFuture patchSubjectTypeAsync(
+ UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) {
+ return patchSubjectTypeWithHttpInfoAsync(subjectTypeId, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update mutable fields on a subject type. Only the fields present in the body are changed. Any
+ * subject type can be updated, including the organization's default one, but the is_default flag
+ * itself is read-only here: which subject type is the default cannot be changed through this
+ * endpoint.
+ *
+ * @param subjectTypeId The UUID of the subject type. (required)
+ * @param body (required)
+ * @return ApiResponse<ExperimentsSubjectTypeV2DTO>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Malformed subject type ID, malformed body, or no updatable field supplied. | - |
+ * | 401 | Missing or invalid authentication. | - |
+ * | 403 | Authenticated caller lacks the product_analytics_settings_write permission. | - |
+ * | 404 | No subject type with this ID exists for the organization. | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse patchSubjectTypeWithHttpInfo(
+ UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'subjectTypeId' is set
+ if (subjectTypeId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling patchSubjectType");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/subject-types/{subject_type_id}"
+ .replaceAll(
+ "\\{" + "subject_type_id" + "\\}",
+ apiClient.escapeString(subjectTypeId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.patchSubjectType",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Patch subject type.
+ *
+ * See {@link #patchSubjectTypeWithHttpInfo}.
+ *
+ * @param subjectTypeId The UUID of the subject type. (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<ExperimentsSubjectTypeV2DTO>>
+ */
+ public CompletableFuture>
+ patchSubjectTypeWithHttpInfoAsync(
+ UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'subjectTypeId' is set
+ if (subjectTypeId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling patchSubjectType"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/subject-types/{subject_type_id}"
+ .replaceAll(
+ "\\{" + "subject_type_id" + "\\}",
+ apiClient.escapeString(subjectTypeId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.patchSubjectType",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Publish experiment protocol.
+ *
+ * See {@link #publishExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @return ExperimentsPublicProtocolResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ExperimentsPublicProtocolResponse publishExperimentProtocol(UUID protocolId)
+ throws ApiException {
+ return publishExperimentProtocolWithHttpInfo(protocolId).getData();
+ }
+
+ /**
+ * Publish experiment protocol.
+ *
+ *
See {@link #publishExperimentProtocolWithHttpInfoAsync}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @return CompletableFuture<ExperimentsPublicProtocolResponse>
+ */
+ public CompletableFuture publishExperimentProtocolAsync(
+ UUID protocolId) {
+ return publishExperimentProtocolWithHttpInfoAsync(protocolId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Publish a valid draft protocol. The protocol must have a name and subject type. Supplied
+ * references and settings must be valid. An exposure schedule or targeting rules require an
+ * environment. Enabled limits require their values. Configurable template fields must have a
+ * value before they can be locked.
+ *
+ * Independent configuration errors are returned together in the JSON:API errors array with
+ * source.pointer values that identify the fields. Earlier request and reference checks can stop
+ * on the first error. A failed request leaves the protocol unchanged.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @return ApiResponse<ExperimentsPublicProtocolResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Invalid request or protocol settings. | - |
+ * | 401 | Missing or invalid authentication. | - |
+ * | 403 | The caller lacks the product_analytics_experiments_write permission. | - |
+ * | 404 | No protocol with this ID exists in the organization. | - |
+ * | 409 | Only draft protocols can be published. | - |
+ * | 429 | Too many requests | - |
+ * | 500 | Internal Server Error | - |
+ *
+ */
+ public ApiResponse publishExperimentProtocolWithHttpInfo(
+ UUID protocolId) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'protocolId' when calling publishExperimentProtocol");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/protocols/{protocol_id}/publish"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.publishExperimentProtocol",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Publish experiment protocol.
+ *
+ * See {@link #publishExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>>
+ */
+ public CompletableFuture>
+ publishExperimentProtocolWithHttpInfoAsync(UUID protocolId) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'protocolId' when calling"
+ + " publishExperimentProtocol"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/protocols/{protocol_id}/publish"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.publishExperimentProtocol",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /** Manage optional parameters to refreshExperimentResults. */
+ public static class RefreshExperimentResultsOptionalParameters {
+ private Boolean fullRefresh;
+
+ /**
+ * Set fullRefresh.
+ *
+ * @param fullRefresh Force a full warehouse rebuild. Defaults to false when omitted. (optional)
+ * @return RefreshExperimentResultsOptionalParameters
+ */
+ public RefreshExperimentResultsOptionalParameters fullRefresh(Boolean fullRefresh) {
+ this.fullRefresh = fullRefresh;
+ return this;
+ }
+ }
+
+ /**
+ * Refresh experiment results.
+ *
+ * See {@link #refreshExperimentResultsWithHttpInfo}.
+ *
+ * @param experimentId The UUID of the experiment. (required)
+ * @return ExperimentsRefreshExperimentResultsV2DTO
+ * @throws ApiException if fails to make API call
+ */
+ public ExperimentsRefreshExperimentResultsV2DTO refreshExperimentResults(UUID experimentId)
+ throws ApiException {
+ return refreshExperimentResultsWithHttpInfo(
+ experimentId, new RefreshExperimentResultsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * Refresh experiment results.
+ *
+ *
See {@link #refreshExperimentResultsWithHttpInfoAsync}.
+ *
+ * @param experimentId The UUID of the experiment. (required)
+ * @return CompletableFuture<ExperimentsRefreshExperimentResultsV2DTO>
+ */
public CompletableFuture refreshExperimentResultsAsync(
UUID experimentId) {
return refreshExperimentResultsWithHttpInfoAsync(
@@ -7199,6 +8097,266 @@ public ExperimentsRefreshExperimentResultsV2DTOArray refreshExperimentResultsFor
new GenericType() {});
}
+ /** Manage optional parameters to replaceExperimentProtocol. */
+ public static class ReplaceExperimentProtocolOptionalParameters {
+ private String expectedUpdatedAt;
+
+ /**
+ * Set expectedUpdatedAt.
+ *
+ * @param expectedUpdatedAt The updated_at value from the last read. Include the full timestamp,
+ * with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip
+ * this check. (optional)
+ * @return ReplaceExperimentProtocolOptionalParameters
+ */
+ public ReplaceExperimentProtocolOptionalParameters expectedUpdatedAt(String expectedUpdatedAt) {
+ this.expectedUpdatedAt = expectedUpdatedAt;
+ return this;
+ }
+ }
+
+ /**
+ * Replace experiment protocol.
+ *
+ * See {@link #replaceExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param body (required)
+ * @return ExperimentsPublicProtocolResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ExperimentsPublicProtocolResponse replaceExperimentProtocol(
+ UUID protocolId, ExperimentsReplaceExperimentProtocolRequest body) throws ApiException {
+ return replaceExperimentProtocolWithHttpInfo(
+ protocolId, body, new ReplaceExperimentProtocolOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * Replace experiment protocol.
+ *
+ *
See {@link #replaceExperimentProtocolWithHttpInfoAsync}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param body (required)
+ * @return CompletableFuture<ExperimentsPublicProtocolResponse>
+ */
+ public CompletableFuture replaceExperimentProtocolAsync(
+ UUID protocolId, ExperimentsReplaceExperimentProtocolRequest body) {
+ return replaceExperimentProtocolWithHttpInfoAsync(
+ protocolId, body, new ReplaceExperimentProtocolOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Replace experiment protocol.
+ *
+ * See {@link #replaceExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param body (required)
+ * @param parameters Optional parameters for the request.
+ * @return ExperimentsPublicProtocolResponse
+ * @throws ApiException if fails to make API call
+ */
+ public ExperimentsPublicProtocolResponse replaceExperimentProtocol(
+ UUID protocolId,
+ ExperimentsReplaceExperimentProtocolRequest body,
+ ReplaceExperimentProtocolOptionalParameters parameters)
+ throws ApiException {
+ return replaceExperimentProtocolWithHttpInfo(protocolId, body, parameters).getData();
+ }
+
+ /**
+ * Replace experiment protocol.
+ *
+ *
See {@link #replaceExperimentProtocolWithHttpInfoAsync}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param body (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ExperimentsPublicProtocolResponse>
+ */
+ public CompletableFuture replaceExperimentProtocolAsync(
+ UUID protocolId,
+ ExperimentsReplaceExperimentProtocolRequest body,
+ ReplaceExperimentProtocolOptionalParameters parameters) {
+ return replaceExperimentProtocolWithHttpInfoAsync(protocolId, body, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Replace the template of a published protocol. Draft and archived protocols return 409. Send
+ * subject_type_id, all four required boolean settings, and metric_groups. Omitted optional
+ * template fields are cleared. Omitted enforcement keeps the existing locks.
+ *
+ * Use primary_metric_id to select the primary metric. Use default_duration_days to set
+ * target_duration_days on experiments created from the protocol. The nested metric is_primary and
+ * analysis_plan.target_duration_days fields are rejected. An unchanged GET response can be sent
+ * as the request body. Response-only fields are ignored.
+ *
+ *
Independent configuration errors are returned together in the JSON:API errors array. Each
+ * error identifies the field in source.pointer. Earlier request and reference checks can stop on
+ * the first error. A failed request leaves the protocol unchanged. Changes apply to future
+ * experiments; existing experiments keep their settings.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param body (required)
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<ExperimentsPublicProtocolResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Invalid request or protocol settings. | - |
+ * | 401 | Missing or invalid authentication. | - |
+ * | 403 | The caller lacks the product_analytics_experiments_write permission. | - |
+ * | 404 | No protocol with this ID exists in the organization. | - |
+ * | 409 | The protocol is not published or expected_updated_at is stale. | - |
+ * | 415 | Unsupported request content type. | - |
+ * | 429 | Too many requests | - |
+ * | 500 | Internal Server Error | - |
+ *
+ */
+ public ApiResponse replaceExperimentProtocolWithHttpInfo(
+ UUID protocolId,
+ ExperimentsReplaceExperimentProtocolRequest body,
+ ReplaceExperimentProtocolOptionalParameters parameters)
+ throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'protocolId' when calling replaceExperimentProtocol");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling replaceExperimentProtocol");
+ }
+ String expectedUpdatedAt = parameters.expectedUpdatedAt;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/protocols/{protocol_id}"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.replaceExperimentProtocol",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ return apiClient.invokeAPI(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Replace experiment protocol.
+ *
+ * See {@link #replaceExperimentProtocolWithHttpInfo}.
+ *
+ * @param protocolId The UUID of the protocol. (required)
+ * @param body (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>>
+ */
+ public CompletableFuture>
+ replaceExperimentProtocolWithHttpInfoAsync(
+ UUID protocolId,
+ ExperimentsReplaceExperimentProtocolRequest body,
+ ReplaceExperimentProtocolOptionalParameters parameters) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'protocolId' is set
+ if (protocolId == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'protocolId' when calling"
+ + " replaceExperimentProtocol"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling replaceExperimentProtocol"));
+ return result;
+ }
+ String expectedUpdatedAt = parameters.expectedUpdatedAt;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/experiments/protocols/{protocol_id}"
+ .replaceAll(
+ "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(
+ apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.ExperimentsApi.replaceExperimentProtocol",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
/**
* Set default subject type.
*
diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequest.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequest.java
new file mode 100644
index 00000000000..bf5033e65bc
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequest.java
@@ -0,0 +1,154 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Create a draft protocol with the organization default subject type. */
+@JsonPropertyOrder({ExperimentsCreateExperimentProtocolRequest.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class ExperimentsCreateExperimentProtocolRequest {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private ExperimentsCreateExperimentProtocolRequestData data;
+
+ public ExperimentsCreateExperimentProtocolRequest() {}
+
+ @JsonCreator
+ public ExperimentsCreateExperimentProtocolRequest(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA)
+ ExperimentsCreateExperimentProtocolRequestData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public ExperimentsCreateExperimentProtocolRequest data(
+ ExperimentsCreateExperimentProtocolRequestData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * JSON:API protocol request resource.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public ExperimentsCreateExperimentProtocolRequestData getData() {
+ return data;
+ }
+
+ public void setData(ExperimentsCreateExperimentProtocolRequestData data) {
+ this.data = data;
+ if (data != null) {
+ this.unparsed |= data.unparsed;
+ }
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return ExperimentsCreateExperimentProtocolRequest
+ */
+ @JsonAnySetter
+ public ExperimentsCreateExperimentProtocolRequest putAdditionalProperty(
+ String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this ExperimentsCreateExperimentProtocolRequest object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ExperimentsCreateExperimentProtocolRequest experimentsCreateExperimentProtocolRequest =
+ (ExperimentsCreateExperimentProtocolRequest) o;
+ return Objects.equals(this.data, experimentsCreateExperimentProtocolRequest.data)
+ && Objects.equals(
+ this.additionalProperties,
+ experimentsCreateExperimentProtocolRequest.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ExperimentsCreateExperimentProtocolRequest {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestData.java
new file mode 100644
index 00000000000..36045f63393
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestData.java
@@ -0,0 +1,193 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** JSON:API protocol request resource. */
+@JsonPropertyOrder({
+ ExperimentsCreateExperimentProtocolRequestData.JSON_PROPERTY_ATTRIBUTES,
+ ExperimentsCreateExperimentProtocolRequestData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class ExperimentsCreateExperimentProtocolRequestData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private ExperimentsCreateExperimentProtocolRequestDataAttributes attributes;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private ExperimentsPublicProtocolResponseDataType type =
+ ExperimentsPublicProtocolResponseDataType.PROTOCOLS;
+
+ public ExperimentsCreateExperimentProtocolRequestData() {}
+
+ @JsonCreator
+ public ExperimentsCreateExperimentProtocolRequestData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ ExperimentsCreateExperimentProtocolRequestDataAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE)
+ ExperimentsPublicProtocolResponseDataType type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public ExperimentsCreateExperimentProtocolRequestData attributes(
+ ExperimentsCreateExperimentProtocolRequestDataAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Create a draft protocol with the organization default subject type.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public ExperimentsCreateExperimentProtocolRequestDataAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(ExperimentsCreateExperimentProtocolRequestDataAttributes attributes) {
+ this.attributes = attributes;
+ if (attributes != null) {
+ this.unparsed |= attributes.unparsed;
+ }
+ }
+
+ public ExperimentsCreateExperimentProtocolRequestData type(
+ ExperimentsPublicProtocolResponseDataType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Protocols resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public ExperimentsPublicProtocolResponseDataType getType() {
+ return type;
+ }
+
+ public void setType(ExperimentsPublicProtocolResponseDataType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return ExperimentsCreateExperimentProtocolRequestData
+ */
+ @JsonAnySetter
+ public ExperimentsCreateExperimentProtocolRequestData putAdditionalProperty(
+ String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this ExperimentsCreateExperimentProtocolRequestData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ExperimentsCreateExperimentProtocolRequestData experimentsCreateExperimentProtocolRequestData =
+ (ExperimentsCreateExperimentProtocolRequestData) o;
+ return Objects.equals(
+ this.attributes, experimentsCreateExperimentProtocolRequestData.attributes)
+ && Objects.equals(this.type, experimentsCreateExperimentProtocolRequestData.type)
+ && Objects.equals(
+ this.additionalProperties,
+ experimentsCreateExperimentProtocolRequestData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class ExperimentsCreateExperimentProtocolRequestData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestDataAttributes.java
new file mode 100644
index 00000000000..7d4eeb40ec2
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestDataAttributes.java
@@ -0,0 +1,249 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.openapitools.jackson.nullable.JsonNullable;
+
+/** Create a draft protocol with the organization default subject type. */
+@JsonPropertyOrder({
+ ExperimentsCreateExperimentProtocolRequestDataAttributes.JSON_PROPERTY_DESCRIPTION,
+ ExperimentsCreateExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MIGRATION_METADATA,
+ ExperimentsCreateExperimentProtocolRequestDataAttributes.JSON_PROPERTY_NAME
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class ExperimentsCreateExperimentProtocolRequestDataAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DESCRIPTION = "description";
+ private JsonNullable description = JsonNullable.undefined();
+
+ public static final String JSON_PROPERTY_MIGRATION_METADATA = "migration_metadata";
+ private JsonNullable