# Experiment routes: conclude, start

URL: /code/api/experiment/verbs · Id: `page:code/api/experiment/verbs`

> The Experiment Verbs conclude, start as api.sb routes, with inputs, result, refusals and an example.

Reference for [Experiment](/business/nouns/experiment), one group of [Experiment routes](/code/api/experiment).

### Experiment.conclude
Conclude ends an Experiment with a decision to ship, kill, or iterate, recorded as a Decision. [Verb page](/business/nouns/experiment/conclude?interface=api).

```text
POST /{namespace}/experiments/{experiment}/conclude
```

Path: `experiment`. Body, as JSON: the other inputs. Emits [`Experiment.concluded`](/business/events/Experiment.concluded).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `experiment` | [Experiment](/business/nouns/experiment) | Yes | The running Experiment. |
| `decision` | `string` | Yes | One of `ship`, `kill`, `iterate`. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `decision` | [Decision](/business/nouns/decision) | Yes | The recorded Decision. |
| `experiment` | [Experiment](/business/nouns/experiment) | Yes | The Experiment, now concluded. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The input does not match the schema of the operation. | [`invalid-input`](/code/api/errors/invalid-input) | Read the schema of the operation, then send every required field with the right type. | None. |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/experiments/experiment_IyIJJPngKt/conclude \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"decision":"ship"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "decision": {
    "$id": "https://api.sb/leaseline.app/decisions/decision_ipoch3tTJh",
    "$type": "Decision",
    "choice": "Example choice",
    "reason": "Example reason"
  },
  "experiment": {
    "$id": "https://api.sb/leaseline.app/experiments/experiment_IyIJJPngKt",
    "$type": "Experiment",
    "variants": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Experiment.conclude",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

### Experiment.start
Start opens an Experiment, splits traffic across its variants, and begins measuring its primary and guardrail Metrics. [Verb page](/business/nouns/experiment/start?interface=api).

```text
POST /{namespace}/experiments/{experiment}/start
```

Path: `experiment`. Emits [`Experiment.started`](/business/events/Experiment.started).

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `experiment` | [Experiment](/business/nouns/experiment) | Yes | The Experiment to open. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `experiment` | [Experiment](/business/nouns/experiment) | Yes | The running Experiment. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The input does not match the schema of the operation. | [`invalid-input`](/code/api/errors/invalid-input) | Read the schema of the operation, then send every required field with the right type. | None. |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | [`refused`](/code/api/errors/refused) | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |

**Example**

```bash
curl -X POST https://api.sb/leaseline.app/experiments/experiment_IyIJJPngKt/start \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "experiment": {
    "$id": "https://api.sb/leaseline.app/experiments/experiment_IyIJJPngKt",
    "$type": "Experiment",
    "variants": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Experiment.start",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```