# apply

URL: /business/nouns/play/apply · Id: `verb:Play.apply` · Call: `await $.Play.apply({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> Apply runs a Play across a Portfolio cohort, one wave at a time, measured as an Experiment.

Apply runs a [Play](/business/nouns/play) across a [Portfolio](/business/nouns/portfolio) cohort, one wave at a time, measured as an [Experiment](/business/nouns/experiment).

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `play` | [Play](/business/nouns/play) | Yes | The Play to run. |
| `cohort` | `string` | Yes | The Portfolio query that selects the Startups. |

## Outputs
| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `experiment` | [Experiment](/business/nouns/experiment) | Yes | The Experiment that measures the rollout. |
| `play` | [Play](/business/nouns/play) | Yes | The Play applied. |

## Effects
- Emits [`Play.applied`](/business/events/Play.applied).
- Performed by the [Marketing Lead](/agents/marketing/marketing-lead).
- Tags every write with the Play, so one `revert` undoes the rollout.

## 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. | [Play.apply](/business/nouns/play/apply) |
| 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. | [Play.apply](/business/nouns/play/apply) |

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Low: two-way, nothing at stake |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | None: it runs once review passes. |
| Limit | The call [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Apply the latest play.
```

**API**

```bash
curl -X POST https://api.sb/kilnbakery.com/plays/play_1/apply \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cohort":"Example cohort"}'
```

```json
{
  "api": "https://api.sb/kilnbakery.com",
  "experiment": {
    "$id": "https://api.sb/kilnbakery.com/experiments/experiment_1",
    "$type": "Experiment",
    "variants": {}
  },
  "play": {
    "$id": "https://api.sb/kilnbakery.com/plays/play_1",
    "$type": "Play",
    "family": "demand"
  },
  "action": {
    "$id": "https://api.sb/kilnbakery.com/actions/action_1",
    "operation": "Play.apply",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/kilnbakery.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const { experiment, play } = await $.Play.apply({ play: 'play_1', cohort: 'Example cohort' })
```

**CLI**

```bash
npx startup-builder do Play.apply --json '{"play":"play_1","cohort":"Example cohort"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Play.apply({ play: 'play_1', cohort: 'Example cohort' })"
  }
}
```