---
title: "Update experiment"
method: PUT
path: "/experiments/{id}"
tags: ["experiments"]
---

# Update experiment

`PUT /experiments/{id}`

Update an existing experiment's configuration.

Supports two modes:

**1. Partial updates:** Provide individual fields (name, description, stages, prolificConfig).
Only provided fields are updated. Omit fields you don't want to change.

**2. Full template update:** Provide a complete `template` object (ExperimentTemplate).
This replaces the entire experiment including all stages and agents.
Other fields are ignored when template is provided.

**Stages replacement (partial mode):** If `stages` is provided, it completely replaces all existing stages.
To modify a single stage, first GET the experiment, modify the stages array, then PUT the full array back.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string — (Partial update) Updated experiment name
  - `description` string — (Partial update) Updated description
  - `prolificRedirectCode` string — (Partial update) Updated Prolific completion redirect code
  - `stages` Stage[] — (Partial update) Complete array of stage configurations. If provided, **replaces all existing stages**. Omit this field to leave stages unchanged. — unresolved $ref
  - `agentMediators` object[] — (Partial update) Complete array of agent mediator templates. If provided, **replaces all existing agent mediators**. Each agent includes persona config and a promptMap with stage-specific prompts. Omit this field to leave agent mediators unchanged.
  - `agentParticipants` object[] — (Partial update) Complete array of agent participant templates. If provided, **replaces all existing agent participants**. Each agent includes persona config and a promptMap with stage-specific prompts. Omit this field to leave agent participants unchanged.
  - `template` object — (Full template update) Complete ExperimentTemplate object. When provided, replaces the entire experiment including all stages and agents. All other fields (name, description, stages, agentMediators, agentParticipants) are ignored. Use this mode when you need atomic replacement of the entire experiment.

## Response `200`

Experiment updated successfully

- object
  - `updated` boolean
  - `id` string

## Other responses

- `400` — Bad request - Invalid input
- `401` — Unauthorized - Missing or invalid API key
- `403` — Forbidden - Insufficient permissions or browser access attempted
- `404` — Not found - Resource doesn't exist
- `429` — Too many requests - Rate limit exceeded

---

[API](https://skmtc.dev/pair-code/apis/deliberate-lab-api.md) · [All operations](https://skmtc.dev/pair-code/apis/deliberate-lab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pair-code/deliberate-lab-api/revisions/f58e6c25e4f8/schema)
