Skip to main content
PATCH
Update Experiment

Overview

Changes an active experiment’s traffic split, schedule, dates, or quota. The variant and baseline are fixed for the experiment’s life; to test a different version, stop it and create a new one. Only the fields below are accepted: any other key returns 400 BAD_REQUEST, and so does an empty body. Completed experiments cannot be edited and return 409 CONFLICT, as does a second update that arrives while one is still being applied (retry it). Requires an admin, owner, operator, or prompter role.

Headers

string
required
Your API key for authentication.

Path Parameters

string
required
The agent’s unique identifier.
string
required
The experiment’s unique identifier. Must be a valid UUID; returns 400 BAD_REQUEST otherwise.

Body Parameters

Send at least one field. Fields you omit keep their current value.
integer
New share of eligible calls routed to the variant, 1 to 100. Use this to ramp the variant up or down.
object | null
New weekly schedule, with the same shape and rules as on Create Experiment: an IANA timezone and a days object keyed mon through sun whose values are { "start": "HH:mm", "end": "HH:mm" } windows. Pass null to remove the schedule and make the variant always eligible.
string | null
ISO 8601 datetime before which the variant receives no traffic. Pass null to clear it.
string | null
ISO 8601 datetime at which the experiment completes with date_ended. Must be in the future and after the effective starts_at (the one in this request, or the stored one if not sent). Pass null to remove the end date.
integer | null
New cap on connected variant calls, 1 to 1000000, or null for no cap. Lowering it to or below the current variant_calls_routed completes the experiment immediately with quota_reached, and the response reflects that.

Response

object
The experiment after the update.
null | array
null on success, or a list of error objects if the request failed.

Docs for agents: llms.txt