# Message programs: update, delete

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

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

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

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

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

Emits `Message.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Message. |
| `medium` | `string` | No | One of `email`, `sms`, `voice`, or `chat`. |
| `direction` | `string` | No | One of `inbound` or `outbound`. |
| `body` | `text` | No | What it says. |
| `from` | `string` | No | The sender: an address, a number, or a Channel id. |
| `to` | `string` | No | The recipient: an address, a number, or a Person id. |
| `subject` | `string` | No | The subject line, for email. |
| `purpose` | `string` | No | Why it goes out, such as onboarding; consent and suppression rules read it. |

**Returns**

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

**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 $.Message.update({ id: 'message_3Dg8ysSOyQ', medium: 'email' })"
  }
}
```

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

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

Emits `Message.deleted`.

**Inputs**

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

**Returns**

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

**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 $.Message.delete({ id: 'message_3Dg8ysSOyQ' })"
  }
}
```