# Campaign programs: update, delete

URL: /code/mcp/campaign/records-update · Id: `page:code/mcp/campaign/records-update`

> The Campaign Verbs update, delete as MCP do programs, with inputs, result, refusals and an example.

Reference for [Campaign](/business/nouns/campaign), one group of [Campaign programs](/code/mcp/campaign).

### Campaign.update
Changes the given properties of a Campaign. [Verb page](/business/nouns/campaign/update?interface=mcp).

```text
do: return await $.Campaign.update(input)
```

Emits `Campaign.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Campaign. |
| `budget` | `money` | No | What it may spend. |
| `startsAt` | `datetime` | No | When it starts. |
| `endsAt` | `datetime` | No | When it ends. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign` | [Campaign](/business/nouns/campaign) | Yes | The Campaign. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| 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. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Campaign.update({ id: 'campaign_NYwCp4DcII', budget: { amount: 29, currency: 'USD' } })"
  }
}
```

### Campaign.delete
Deletes a Campaign: a soft delete that keeps its history, undone by `Thing.restore`. [Verb page](/business/nouns/campaign/delete?interface=mcp).

```text
do: return await $.Campaign.delete(input)
```

Emits `Campaign.deleted`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Campaign. |

**Returns**

| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign` | [Campaign](/business/nouns/campaign) | Yes | The Campaign. |

**Refuses when**

| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| 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. |

**Example**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Campaign.delete({ id: 'campaign_NYwCp4DcII' })"
  }
}
```