---
title: "Update experiment analysis plan attributes"
method: PATCH
path: "/api/v2/experiments/{experiment_id}/analysis-plan"
tags: ["Experiments"]
---

# Update experiment analysis plan attributes

`PATCH /api/v2/experiments/{experiment_id}/analysis-plan`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/{experiment_id}/analysis-plan`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `product_analytics_experiments_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/experiments/:experiment_id/analysis-plan/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update selected statistical analysis settings. Omitted attributes remain unchanged and nullable attributes can be cleared with null. Protocol-locked settings cannot be changed.

## Path parameters

- `experiment_id` string, uuid, required: The UUID of the experiment.

## Request body

- ExperimentsAnalysisPlanWriteV2Request: Request to update the analysis settings for an experiment.
  - `data` ExperimentsAnalysisPlanWriteV2RequestData, required: Analysis plan resource to update.
    - `attributes` ExperimentsAnalysisPlanWriteV2RequestDataAttributes: Statistical settings and duration targets to apply to the experiment.
      - `bayesian_prior` ExperimentsAnalysisPlanWriteV2RequestDataAttributesBayesianPrior: Parameters of the prior distribution to use for Bayesian analysis.
        - `degrees_of_freedom` number, double, nullable: Degrees of freedom of the prior distribution.
        - `standard_deviation` number, double, required: Standard deviation of the prior distribution.
      - `confidence_interval_method` 'Sequential' | 'FixedSample' | 'Bayesian' | 'SequentialFixedHybrid': Statistical method used to calculate the experiment results.
      - `confidence_level` number, double: Confidence level used for statistical analysis, expressed as a fraction.
      - `cuped_lookback_period_days` integer: Only a 30-day CUPED lookback is supported.
      - `experiment_auto_end_days` integer: Number of days configured for the experiment to end automatically.
      - `experiment_min_duration` integer: Minimum experiment duration in days configured in the analysis plan.
      - `experiment_min_sample_size` integer: Minimum sample size configured in the analysis plan.
      - `is_cuped_enabled` boolean: Whether CUPED uses pre-experiment data to reduce variance in the analysis.
      - `is_multiple_testing_correction_enabled` boolean: Whether the analysis adjusts for testing multiple hypotheses.
      - `preferential_bonferroni_primary_metric_weight` number, double: Weight assigned to the primary metric in the preferential Bonferroni correction.
      - `target_duration_days` integer, nullable: Planned experiment duration in days.
    - `id` string, uuid: Identifier of the experiment. If supplied, it must match experiment_id in the path.
    - `type` 'analysis-plans', required: Analysis plans resource type.

## Response `200`

OK

- ExperimentsAnalysisPlanV2MutationResponse: Response containing the saved analysis plan and result refresh information.
  - `data` ExperimentsAnalysisPlanV2DTOData, required: Analysis plan resource with its identifier and settings.
    - `attributes` ExperimentsAnalysisPlanV2MutationResponseDataAttributes: Statistical settings and duration targets in the saved analysis plan.
      - `bayesian_prior` ExperimentsAnalysisPlanV2MutationResponseDataAttributesBayesianPrior: Parameters of the prior distribution used for Bayesian analysis.
        - `degrees_of_freedom` number, double, nullable: Degrees of freedom of the prior distribution.
        - `standard_deviation` number, double: Standard deviation of the prior distribution.
      - `confidence_interval_method` 'Sequential' | 'FixedSample' | 'Bayesian' | 'SequentialFixedHybrid': Statistical method used to calculate the experiment results.
      - `confidence_level` number, double: Confidence level used for statistical analysis, expressed as a fraction.
      - `cuped_lookback_period_days` integer: Number of days of pre-experiment data used for CUPED variance reduction.
      - `experiment_auto_end_days` integer: Number of days configured for the experiment to end automatically.
      - `experiment_min_duration` integer: Minimum experiment duration in days configured in the analysis plan.
      - `experiment_min_sample_size` integer: Minimum sample size configured in the analysis plan.
      - `has_custom_analysis_settings` boolean: Whether the experiment has custom analysis settings.
      - `is_cuped_enabled` boolean: Whether CUPED uses pre-experiment data to reduce variance in the analysis.
      - `is_multiple_testing_correction_enabled` boolean: Whether the analysis adjusts for testing multiple hypotheses.
      - `preferential_bonferroni_primary_metric_weight` number, double: Weight assigned to the primary metric in the preferential Bonferroni correction.
      - `target_duration_days` integer, nullable: Planned experiment duration in days.
    - `id` string, uuid, required: Identifier of the experiment whose analysis plan is returned.
    - `type` 'analysis-plans', required: Analysis plans resource type.
  - `meta` ExperimentsPatchExperimentV2MetaDTO: Refresh requirements and warnings returned by an experiment update.
    - `needs_pipeline_refresh` boolean, required: Whether this edit needs a full or non-full pipeline run. This operation does not start the run. A later false value does not clear a refresh required by an earlier edit.
    - `refresh_endpoint` string: POST to this endpoint after finishing your edits. The full_refresh query parameter selects the required run type. Across multiple edits any full_refresh=true requirement takes priority.
    - `warnings` ExperimentsPatchExperimentV2MetaDTOWarningsItems[]: Warnings returned after the experiment update.
      - `code` string, required: Code that identifies the warning.
      - `detail` string, required: Explanation of the warning and its effect on the update.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: The requested change conflicts with settings locked by the experiment protocol.
- `415`: Request body sent with a media type other than application/json or application/vnd.api+json.
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
