# API: Experiments

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/mkt/experiments/:id` | A test with its results (intervals, always-valid p-values, guardrails), its winner and its log | `marketing:read` |
| PATCH | `/v1/mkt/experiments/:id` | Change a draft test's name, hypothesis, variants, goal or guardrails (a person; fixed once it starts) | `marketing:write` |
| POST | `/v1/mkt/experiments/:id/begin` | Start showing a drafted test on your site (checked against overlapping tests and your policies) | `marketing:write` |
| POST | `/v1/mkt/experiments/:id/code-flag` | Add a code flag to a draft page test (a person): each variant also writes its key into a hidden flag element your site's code can read (web app only) | `marketing:write` |
| GET | `/v1/mkt/experiments/:id/skill` | A skill (SKILL.md, or a .zip skill bundle) a coding agent follows to build this test's variants into your site's code as a feature flag read from the tag | `marketing:read` |
| POST | `/v1/mkt/experiments/:id/stop` | Stop a test now: everyone sees the original again (no approval of its own) | `marketing:write` |
| POST | `/v1/mkt/experiments/:id/winner` | Show a variant to everyone as the winner (a person's approval; checked by your policies; refused if it harmed a guardrail) | `marketing:write` |
| POST | `/v1/mkt/experiments/:id/winner/decline` | Turn down a proposed winner (the test keeps its current state) | `marketing:write` |
| POST | `/v1/mkt/experiments/:id/winner/withdraw` | Withdraw an applied winner: everyone sees the original page again (never waits for approval) | `marketing:write` |
| GET | `/v1/mkt/experiments/copy-plans` | Copy experiment plans handed over from content, newest first: waiting for setup, or the draft test each became | `marketing:read` |
| GET | `/v1/mkt/experiments/copy-plans/:id` | A copy experiment plan: its versions, hypotheses, people needed per version, and the test it became | `marketing:read` |
| POST | `/v1/mkt/experiments/copy-plans/:id/setup` | Choose where a copy plan runs (a person): a page and the element each version replaces, or an email template; it becomes a draft test you start (web app only) | `marketing:write` |
| GET | `/v1/mkt/experiments/ideas` | Test ideas with the numbers behind each: busy pages that convert poorly, pages losing search clicks, winners to try elsewhere | `marketing:read` |
| GET | `/v1/mkt/experiments/landing-tests` | Landing page tests, newest first (at most 50) | `marketing:read` |
| POST | `/v1/mkt/experiments/landing-tests` | Test landing page variants: each is a content piece (your text or generated from the brief) a person approves before the test can start | `marketing:write` |
| GET | `/v1/mkt/experiments/landing-tests/:id` | A landing page test's variants: their pieces, approval, CMS drafts and what happens to each after the test | `marketing:read` |
| POST | `/v1/mkt/experiments/landing-tests/:id/begin` | Start a landing page test once every variant is approved: CMS drafts made (never published), then the test starts through your policies | `marketing:write` |
| POST | `/v1/mkt/experiments/landing-tests/:id/product-copy` | Apply a product page test's winner to the Shopify product: its approved title, description or both (read first, checked after, once) (web app only) | `marketing:write` |
| GET | `/v1/mkt/experiments/landing-tests/products` | Your connected Shopify stores and their products (up to 50, by title), for a product page test | `marketing:read` |
| GET | `/v1/mkt/experiments/outside` | Tests from your connected experimentation tool, most recently changed first (at most 100): what the tool reported and our own check of it | `marketing:read` |
| PUT | `/v1/mkt/experiments/outside/accounts/:id/product` | Say which Optimizely product an account is: Web Experimentation (pages) or Feature Experimentation (flags and their A/B rules) | `marketing:write` |
| POST | `/v1/mkt/experiments/outside/accounts/:id/refresh` | Read a connected experimentation tool's tests and results now (read only; filed, nothing acts on it) | `marketing:write` |
| GET | `/v1/mkt/experiments/personalization` | Personalization rules (by source, campaign, landing page or search keyword) and their status | `marketing:read` |
| POST | `/v1/mkt/experiments/personalization` | Draft a personalization rule: what a page says to visitors from a source, campaign or search keyword | `marketing:write` |
| POST | `/v1/mkt/experiments/personalization/:id/off` | Turn a personalization rule off (never waits for approval) | `marketing:write` |
| POST | `/v1/mkt/experiments/personalization/:id/publish` | Show a personalization rule on your site (a person's approval; checked by your policies) | `marketing:write` |
| POST | `/v1/mkt/experiments/plan` | How many visitors and days a test needs to detect a lift, from the baseline rate and daily traffic | `marketing:read` |
| GET | `/v1/mkt/experiments/proposals` | Proposals to try a finished test's winner on another channel (web, email, push), with what the test measured | `marketing:read` |
| POST | `/v1/mkt/experiments/proposals/drafts` | Draft a test from a proposal (an email subject test or a page test); a person starts it | `marketing:write` |
| GET | `/v1/mkt/experiments/settings` | Experiment settings: the automatic stop on a harmed guardrail, tests at once, confidence and how long visitor data is kept | `marketing:read` |
| PUT | `/v1/mkt/experiments/settings` | Change experiment settings (owners) | `settings:write` |
| GET | `/v1/mkt/experiments/tests` | Tests, newest first, with the program's win rate, running count, overlapping tests and tests without visitors | `marketing:read` |
| POST | `/v1/mkt/experiments/tests` | Draft a test: variants (the first is the original), the goal, guardrails and an optional sample-size plan | `marketing:write` |

## Examples

### GET /v1/mkt/experiments/$ID

A test with its results (intervals, always-valid p-values, guardrails), its winner and its log

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/$ID" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### PATCH /v1/mkt/experiments/$ID

Change a draft test's name, hypothesis, variants, goal or guardrails (a person; fixed once it starts)

```bash
curl -s -X PATCH "https://api.scheeleworks.com/v1/mkt/experiments/$ID" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/$ID/begin

Start showing a drafted test on your site (checked against overlapping tests and your policies)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/$ID/begin" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}/begin`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/$ID/skill

A skill (SKILL.md, or a .zip skill bundle) a coding agent follows to build this test's variants into your site's code as a feature flag read from the tag

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/$ID/skill" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}/skill`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/mkt/experiments/$ID/stop

Stop a test now: everyone sees the original again (no approval of its own)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/$ID/stop" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}/stop`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/$ID/winner

Show a variant to everyone as the winner (a person's approval; checked by your policies; refused if it harmed a guardrail)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/$ID/winner" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}/winner`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/$ID/winner/decline

Turn down a proposed winner (the test keeps its current state)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/$ID/winner/decline" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}/winner/decline`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/$ID/winner/withdraw

Withdraw an applied winner: everyone sees the original page again (never waits for approval)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/$ID/winner/withdraw" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/${id}/winner/withdraw`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/copy-plans

Copy experiment plans handed over from content, newest first: waiting for setup, or the draft test each became

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/copy-plans" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/copy-plans`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/mkt/experiments/copy-plans/$ID

A copy experiment plan: its versions, hypotheses, people needed per version, and the test it became

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/copy-plans/$ID" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/copy-plans/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/mkt/experiments/ideas

Test ideas with the numbers behind each: busy pages that convert poorly, pages losing search clicks, winners to try elsewhere

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/ideas" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/ideas`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/mkt/experiments/landing-tests

Landing page tests, newest first (at most 50)

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/landing-tests" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/landing-tests`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/mkt/experiments/landing-tests

Test landing page variants: each is a content piece (your text or generated from the brief) a person approves before the test can start

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/landing-tests" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/landing-tests`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/landing-tests/$ID

A landing page test's variants: their pieces, approval, CMS drafts and what happens to each after the test

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/landing-tests/$ID" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/landing-tests/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/mkt/experiments/landing-tests/$ID/begin

Start a landing page test once every variant is approved: CMS drafts made (never published), then the test starts through your policies

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/landing-tests/$ID/begin" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/landing-tests/${id}/begin`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/landing-tests/products

Your connected Shopify stores and their products (up to 50, by title), for a product page test

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/landing-tests/products" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/landing-tests/products`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/mkt/experiments/outside

Tests from your connected experimentation tool, most recently changed first (at most 100): what the tool reported and our own check of it

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/outside" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/outside`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### PUT /v1/mkt/experiments/outside/accounts/$ID/product

Say which Optimizely product an account is: Web Experimentation (pages) or Feature Experimentation (flags and their A/B rules)

```bash
curl -s -X PUT "https://api.scheeleworks.com/v1/mkt/experiments/outside/accounts/$ID/product" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/outside/accounts/${id}/product`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/outside/accounts/$ID/refresh

Read a connected experimentation tool's tests and results now (read only; filed, nothing acts on it)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/outside/accounts/$ID/refresh" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/outside/accounts/${id}/refresh`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/personalization

Personalization rules (by source, campaign, landing page or search keyword) and their status

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/personalization" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/personalization`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/mkt/experiments/personalization

Draft a personalization rule: what a page says to visitors from a source, campaign or search keyword

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/personalization" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/personalization`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/personalization/$ID/off

Turn a personalization rule off (never waits for approval)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/personalization/$ID/off" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/personalization/${id}/off`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/personalization/$ID/publish

Show a personalization rule on your site (a person's approval; checked by your policies)

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/personalization/$ID/publish" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/personalization/${id}/publish`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### POST /v1/mkt/experiments/plan

How many visitors and days a test needs to detect a lift, from the baseline rate and daily traffic

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/plan" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/plan`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/proposals

Proposals to try a finished test's winner on another channel (web, email, push), with what the test measured

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/proposals" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/proposals`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/mkt/experiments/proposals/drafts

Draft a test from a proposal (an email subject test or a page test); a person starts it

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/proposals/drafts" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/proposals/drafts`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/settings

Experiment settings: the automatic stop on a harmed guardrail, tests at once, confidence and how long visitor data is kept

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/settings" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/settings`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### PUT /v1/mkt/experiments/settings

Change experiment settings (owners)

```bash
curl -s -X PUT "https://api.scheeleworks.com/v1/mkt/experiments/settings" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/settings`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

### GET /v1/mkt/experiments/tests

Tests, newest first, with the program's win rate, running count, overlapping tests and tests without visitors

```bash
curl -s "https://api.scheeleworks.com/v1/mkt/experiments/tests" \
  -H "Authorization: Bearer $MA_API_KEY"
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/tests`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}` },
});
const data = await res.json();
```

### POST /v1/mkt/experiments/tests

Draft a test: variants (the first is the original), the goal, guardrails and an optional sample-size plan

```bash
curl -s -X POST "https://api.scheeleworks.com/v1/mkt/experiments/tests" \
  -H "Authorization: Bearer $MA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
```

```js
const res = await fetch(`https://api.scheeleworks.com/v1/mkt/experiments/tests`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.MA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();
```

Request and response schemas: [https://www.scheeleworks.com/openapi.json](https://www.scheeleworks.com/openapi.json). All resources: [API reference](https://www.scheeleworks.com/docs/api).
