# Ad

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

> An Ad is one paid or house placement promoting an Offer to an Audience, in a format such as search, display, or video.

An Ad is one paid or house placement promoting an [Offer](/business/nouns/offer) to an [Audience](/business/nouns/audience), in a format such as search, display, or video.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `format` | `string` | Yes | One of `search`, `display`, `image`, or `video`. |
| `spend` | `money` | No | What it has cost so far. |

## Object
```json
{
  "$id": "https://api.sb/patentpad.com/ads/ad_1",
  "$type": "Ad",
  "format": "search",
  "spend": {
    "amount": 499,
    "currency": "USD"
  }
}
```

## Relationships
- <a id="rel-promotes"></a>An Ad **promotes** one [Offer](/business/nouns/offer): each Ad sells one [Offer](/business/nouns/offer). `promotes`, inverse [`promotedBy`](/business/nouns/offer#rel-promoted-by).
- <a id="rel-run-in"></a>An Ad **is run in** one [Campaign](/business/nouns/campaign): a [Campaign](/business/nouns/campaign) places Ads that share its budget and window. `runIn`, inverse [`runs`](/business/nouns/campaign#rel-runs).
- <a id="rel-targets"></a>An Ad **targets** many [Audiences](/business/nouns/audience): an Ad is shown to the people its [Audiences](/business/nouns/audience) select. `targets`, inverse [`targetedBy`](/business/nouns/audience#rel-targeted-by).

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

## Call it

**Ask**

```text
Add an ad to ShiftNote.
```

**API**

```bash
curl -X POST https://api.sb/shiftnote.app/ads \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"format":"search"}'
```

```json
{
  "api": "https://api.sb/shiftnote.app",
  "ad": {
    "$id": "https://api.sb/shiftnote.app/ads/ad_1",
    "$type": "Ad",
    "format": "search"
  },
  "action": {
    "$id": "https://api.sb/shiftnote.app/actions/action_1",
    "operation": "Ad.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/shiftnote.app/actions/action_1"
  }
}
```

**SDK**

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

const ad = await $.Ad.create({ format: 'search' })
```

**CLI**

```bash
npx startup-builder do Ad.create --json '{"format":"search"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Ad.create({ format: 'search' })"
  }
}
```

## Example
A short-video Ad shows a meal-planning [App](/business/nouns/app) filling a week of dinners from one fridge photo. It targets an [Audience](/business/nouns/audience) of parents who save recipe posts, spends $40 a day, and links to the 7-day trial [Offer](/business/nouns/offer).