# Noun routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Noun. |
| `name` | `string` | No | The singular, capitalized name. |
| `properties` | `json` | No | Its properties, each with a name, a type, and whether it is required. |
| `publishedIn` | [Version](/business/nouns/version) | No | The first published Version that serves it; from then on, edits go through a Change and `delete` refuses. |

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "noun": {
    "$id": "https://api.sb/leaseline.app/nouns/noun_v0akLUrXCN",
    "$type": "Noun",
    "name": "Leaseline",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Noun.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Noun.deleted`.

**Inputs**

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

**Returns**

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

**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/nouns/noun_v0akLUrXCN \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "noun": {
    "$id": "https://api.sb/leaseline.app/nouns/noun_v0akLUrXCN",
    "$type": "Noun",
    "name": "Leaseline",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Noun.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```