# Thing routes: update, delete

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

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

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

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

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

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

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Thing. |
| `type` | list of [Noun](/business/nouns/noun) | No | The Nouns this Thing is an instance of. |
| `outside` | `json` | No | The ids this Thing has in outside tools, one per Integration, so a re-run matches instead of duplicating. |

**Returns**

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

**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/things/thing_8ds0r9vvRl \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type":["noun_v0akLUrXCN"]}'
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "thing": {
    "$id": "https://api.sb/leaseline.app/things/thing_8ds0r9vvRl",
    "$type": "Thing",
    "id": "Example id",
    "type": [
      "noun_v0akLUrXCN"
    ]
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Thing.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

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

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

Path: `id`. Emits `Thing.deleted`.

**Inputs**

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

**Returns**

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

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

```json
{
  "api": "https://api.sb/leaseline.app",
  "thing": {
    "$id": "https://api.sb/leaseline.app/things/thing_8ds0r9vvRl",
    "$type": "Thing",
    "id": "Example id",
    "type": [
      "noun_v0akLUrXCN"
    ]
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Thing.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```