# Document methods: update, delete

URL: /code/sdk/document/records-update · Id: `page:code/sdk/document/records-update`

> The Document Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for [Document](/business/nouns/document), one group of [Document methods](/code/sdk/document).

### Document.update
Changes the given properties of a Document. [Verb page](/business/nouns/document/update?interface=sdk).

```ts
interface DocumentVerbs {
  update(input: DocumentUpdateInput, options?: SB.CallOptions): SB.Call<Document>
}
```

Emits `Document.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the Document. |
| `form` | `string` | No | One of `document`, `deck`, or `sheet`. |

**Returns**

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

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

```ts
import { $ } from 'startup-builder'

const document = await $.Document.update({ id: 'document_af2wijcmRy', form: 'document' })
```

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

```ts
interface DocumentVerbs {
  delete(input: DocumentDeleteInput, options?: SB.CallOptions): SB.Call<Document>
}
```

Emits `Document.deleted`.

**Inputs**

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

**Returns**

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

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

```ts
import { $ } from 'startup-builder'

const document = await $.Document.delete({ id: 'document_af2wijcmRy' })
```