# Mailbox routes: update

URL: /code/api/mailbox/records-update · Id: `page:code/api/mailbox/records-update`

> The Mailbox Verbs update as api.sb routes, with inputs, result, refusals and an example.

Reference for [Mailbox](/business/nouns/mailbox), one group of [Mailbox routes](/code/api/mailbox).

### Mailbox.update
Changes the given properties of a Mailbox. [Verb page](/business/nouns/mailbox/update?interface=api).

```text
PATCH /{namespace}/mailboxes/{id}
```

Path: `id`. Body, as JSON: the other inputs. Emits `Mailbox.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Mailbox. |
| `medium` | `string` | No | The platform type, such as `email`, `sms`, or `chat`. |
| `organization` | [Organization](/business/nouns/organization) | No | The outside Organization the Channel is shared with; its new Messages open Conversations for that Customer. |
| `external` | `boolean` | No | True when people from another Organization post in it, as in a channel two companies share. |
| `areaCode` | `string` | No | For an `sms` Channel, the phone area code its number is drawn from, such as `512`. |
| `number` | `string` | No | For an `sms` Channel, its phone number in international form, assigned when it is created. |
| `address` | `email` | No | The email address. |
| `stream` | `string` | No | What it sends: receipts and resets, broadcasts, or cold outbound; one stream per Mailbox. |
| `tenant` | [Tenant](/business/nouns/tenant) | No | The Tenant it sends for, at a Domain that Tenant’s Customer holds; replies land in the Tenant’s Threads. |

**Returns**

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

**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**

```bash
curl -X PATCH https://api.sb/leaseline.app/mailboxes/mailbox_93HvOnR17L \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"address":"dana@leaseline.app"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "mailbox": {
    "$id": "https://api.sb/leaseline.app/mailboxes/mailbox_93HvOnR17L",
    "$type": "Mailbox",
    "medium": "email",
    "address": "dana@leaseline.app",
    "stream": "transactional"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Mailbox.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```