# Campaign

URL: /business/nouns/campaign · Id: `noun:campaign`

> A Campaign is a bounded effort toward a Goal, with a budget, a window, and the Ads or Messages it sends to Audiences.

A Campaign is a bounded effort toward a [Goal](/business/nouns/goal), with a budget, a window, and the [Ads](/business/nouns/ad) or [Messages](/business/nouns/message) it sends to [Audiences](/business/nouns/audience).

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `budget` | `money` | No | What it may spend. |
| `startsAt` | `datetime` | No | When it starts. |
| `endsAt` | `datetime` | No | When it ends. |

## Object
```json
{
  "$id": "https://api.sb/tutorloop.com/campaigns/campaign_1",
  "$type": "Campaign",
  "budget": {
    "amount": 60,
    "currency": "USD"
  },
  "startsAt": "2026-10-22T12:00:00Z",
  "endsAt": "2026-10-22T12:00:00Z"
}
```

## Relationships
- <a id="rel-advances"></a>A Campaign **advances** one [Goal](/business/nouns/goal): a Campaign spends its budget and window toward one [Goal](/business/nouns/goal). `advances`, inverse [`advancedBy`](/business/nouns/goal#rel-advanced-by).
- <a id="rel-runs"></a>A Campaign **runs** many [Ads](/business/nouns/ad): a Campaign places [Ads](/business/nouns/ad) that share its budget and window. `runs`, inverse [`runIn`](/business/nouns/ad#rel-run-in).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| <a id="create"></a>[Campaign.create](/business/nouns/campaign/create) | Creates a Campaign. Inherited from [Noun](/business/nouns/noun). | None. | `Campaign.created` | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Campaign.get](/business/nouns/campaign/get) | Returns one Campaign by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Campaign.list](/business/nouns/campaign/list) | Returns Campaigns, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="update"></a>[Campaign.update](/business/nouns/campaign/update) | Changes the given properties of a Campaign. Inherited from [Noun](/business/nouns/noun). | None. | `Campaign.updated` | Two-way: `try`, `send`, `do` |
| <a id="delete"></a>[Campaign.delete](/business/nouns/campaign/delete) | Deletes a Campaign; its history is kept. Inherited from [Noun](/business/nouns/noun). | None. | `Campaign.deleted` | One-way: `send`, `do` |

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Campaign.create` | Yes | Yes | Yes | No |
| `Campaign.get` | Yes | Yes | Yes | Yes |
| `Campaign.list` | Yes | Yes | Yes | Yes |
| `Campaign.update` | Yes | Yes | Yes | No |
| `Campaign.delete` | Yes | Yes | Yes | No |

## Call it

**Ask**

```text
Add a campaign to QuietCopy.
```

**API**

```bash
curl -X POST https://api.sb/quietcopy.com/campaigns \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"budget":{"amount":39,"currency":"USD"}}'
```

```json
{
  "api": "https://api.sb/quietcopy.com",
  "campaign": {
    "$id": "https://api.sb/quietcopy.com/campaigns/campaign_1",
    "$type": "Campaign",
    "budget": {
      "amount": 39,
      "currency": "USD"
    },
    "startsAt": "2026-10-22T12:00:00Z"
  },
  "action": {
    "$id": "https://api.sb/quietcopy.com/actions/action_1",
    "operation": "Campaign.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/quietcopy.com/actions/action_1"
  }
}
```

**SDK**

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

const campaign = await $.Campaign.create({ budget: { amount: 39, currency: 'USD' } })
```

**CLI**

```bash
npx startup-builder do Campaign.create --json '{"budget":{"amount":39,"currency":"USD"}}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Campaign.create({ budget: { amount: 39, currency: 'USD' } })"
  }
}
```

## Example
A three-week Campaign for a dropship store of espresso-machine filters spends $1,500 on short-video [Ads](/business/nouns/ad). Its [Goal](/business/nouns/goal) is 120 first [Orders](/business/nouns/order), and it ends on day 21 even if the Goal falls short.