Stop an experiment
Stops the agent's running experiment: every new conversation is served the champion again, the conversations already assigned keep their version, and the figures stay readable with `GET /experiments/{experimentId}`. The champion stays live. `agent_experiment_not_running` when the experiment already ended. Records an audit entry (`agent.experiment_stopped`) attributed to the API key.
Authorization
ApiKeyAuth A WorkOS org-scoped API key, created from the dashboard's organization settings page. Identifies the tenant every read and write is scoped to. Missing, malformed, unknown, revoked, expired, or non-organization-owned keys all return 401 (no distinction, so the response can't be used to probe which keys or org ids exist).
In: header
Path Parameters
The site id (prefixed site_). A site id that isn't yours is a 404, same as any other cross-tenant id.
The agent id (prefixed agt_).
The experiment id (prefixed agxp_). An experiment of another agent, or another organization, is a 404.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
No field: a body that names anything is refused with 400.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/api/v1/sites/string/agents/string/experiments/string/stop" \ -H "Content-Type: application/json" \ -d '{}'{ "data": { "id": "string", "agentId": "string", "status": "running", "state": "below_floor", "endedReason": "string", "startedAt": "2019-08-24T14:15:22Z", "endedAt": "2019-08-24T14:15:22Z", "floorPerVersion": 0, "maxConversationsPerVersion": 0, "detectionLimitPer1000": 0, "metric": "conversion_rate", "alpha": 0, "championVersionId": "string", "candidateVersionId": "string", "champion": { "versionId": "string", "assignedConversations": 0, "matureConversations": 0, "mainDriver": { "id": "conversion_rate", "role": "main", "convertedConversations": 0, "matureConvertedConversations": 0, "rate": 0, "matureRate": 0 }, "secondaryDrivers": [ { "id": "string", "role": "secondary", "unit": "conversations", "value": 0, "currency": "string" } ], "mixedCurrencies": true, "band": { "lower": 0, "upper": 0 }, "progress": 0 }, "candidate": { "versionId": "string", "assignedConversations": 0, "matureConversations": 0, "mainDriver": { "id": "conversion_rate", "role": "main", "convertedConversations": 0, "matureConvertedConversations": 0, "rate": 0, "matureRate": 0 }, "secondaryDrivers": [ { "id": "string", "role": "secondary", "unit": "conversations", "value": 0, "currency": "string" } ], "mixedCurrencies": true, "band": { "lower": 0, "upper": 0 }, "progress": 0 }, "verdict": { "winner": "champion", "gapPer1000": 0, "confirmableGapPer1000": 0 } }}Get an experiment
Returns one experiment with its figures per version, its verdict, its bands and the daily cumulative series of the live chart. The verdict is on the conversion rate only (the main driver); the funnel, orders, revenue and order value are secondary drivers that explain a result and never decide it. Before the floor there is no verdict, and a result that is not conclusive gives the gap the test could confirm (`verdict.confirmableGapPer1000`), never a claim of no difference. Figures are attributed to the assistant (last touch), not incremental. Only conversations with a shopper message count, the starters shown before the first message are the champion's, recent conversations are credited with a delay of up to 24 hours, and tests running at the same time on the site may mix. `404` for an experiment that is not this agent's.
Promote the candidate
Puts the candidate of the running experiment live, through the same path as `go-live`, and ends the experiment as promoted. This changes what shoppers are served, whatever the verdict says. Refused with `version_not_ready` when a condition to go live is unmet, which leaves the experiment running, and with `agent_experiment_not_running` when the experiment already ended. Records `agent.experiment_promoted` and the go-live's own audit entry, attributed to the API key.