# File commands: update, delete

URL: /code/cli/file/records-update · Id: `page:code/cli/file/records-update`

> The File Verbs update, delete as CLI commands, with inputs, result, refusals and an example.

Reference for [File](/business/nouns/file), one group of [File commands](/code/cli/file).

### File.update
Changes the given properties of a File. [Verb page](/business/nouns/file/update?interface=cli).

```text
npx startup-builder do File.update --json '<input>' [--try | --send | --do]
```

Emits `File.updated`.

**Inputs**

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The id of the File. |
| `contentType` | `string` | No | The media type, such as `application/pdf`. |
| `size` | `integer` | No | The size in bytes. |
| `name` | `string` | No | The file name it was uploaded with. |
| `visibility` | `string` | No | Who may read it: `Owner`, `Customer`, or `Public`. The default is `Owner`. |

**Returns**

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

**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
npx startup-builder do File.update --json '{"id":"file_V1AuhyCTsH","size":1}'
```

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

```text
npx startup-builder do File.delete --json '<input>' [--try | --send | --do]
```

Emits `File.deleted`.

**Inputs**

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

**Returns**

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

**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
npx startup-builder do File.delete --json '{"id":"file_V1AuhyCTsH"}'
```