---
title: "Update experiment rule"
method: PUT
path: "/api/experimental/experiments/rules/{experiment}"
tags: ["General"]
---

# Update experiment rule

`PUT /api/experimental/experiments/rules/{experiment}`

## Request

- Base URL: `/` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/experimental/experiments/rules/{experiment}`
- Auth: API key in header `Coder-Session-Token`

## Path parameters

- `experiment` string, required

## Request body

- CodersdkPutExperimentRuleRequest
  - `condition` string: Condition is required for the condition mode and must be empty otherwise.
  - `expected_revision` integer: ExpectedRevision must equal the current revision of the stored rule, or zero when no rule is stored or the stored rule has no readable positive revision. A different revision fails with 409 Conflict.
  - `mode` 'inherit' | 'on' | 'off' | 'condition'

## Response `200`

OK

- CodersdkExperimentRule
  - `condition` string: Condition is the CEL expression of a condition rule.
  - `mode` string: Mode is one of the ExperimentRuleMode values, or empty when the stored rule is malformed. A malformed rule decides off until it is replaced. It is a plain string so that clients can represent the malformed state.
  - `revision` integer: Revision increases on every change and starts at 1. Zero means the stored rule has no readable positive revision, so it is malformed.
  - `updated_at` string, date-time
  - `updated_by` string, uuid

## Changes

- **2026-09-29** `62a9d07a2fe6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/coder/apis/coder-api/changes/api/experimental/experiments/rules/:experiment/put.md)

---

[API](https://skmtc.dev/coder/apis/coder-api.md) - [All operations](https://skmtc.dev/coder/apis/coder-api/llms.txt) - [OpenAPI document](https://skmtc.dev/coder/apis/coder-api/revisions/4669d93796ab?raw)
