# Brand routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Brand. |
| `name` | `string` | No | The name customers see. |
| `voice` | `text` | No | How the Brand writes and speaks. |
| `logo` | `url` | No | The logo image. |

**Returns**

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

**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/brands/brand_PluVQrB1HF \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Leaseline"}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "brand": {
    "$id": "https://api.sb/leaseline.app/brands/brand_PluVQrB1HF",
    "$type": "Brand",
    "name": "Leaseline"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Brand.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

```text
DELETE /{namespace}/brands/{id}
```

Path: `id`. Emits `Brand.deleted`.

**Inputs**

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

**Returns**

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

**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 DELETE https://api.sb/leaseline.app/brands/brand_PluVQrB1HF \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "brand": {
    "$id": "https://api.sb/leaseline.app/brands/brand_PluVQrB1HF",
    "$type": "Brand",
    "name": "Leaseline"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Brand.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```