## Update a file

**patch** `/v5/files/{file_id}`

Update a file's mutable metadata by id.

Only the file's `tags` can be modified; filename, content, size, and other
attributes are immutable through this endpoint. The supplied tags replace the
file's existing tags. Returns the updated file metadata.

### Path Parameters

- `file_id: string`

### Header Parameters

- `"x-project-id": optional string`

### Body Parameters

- `tags: optional map[unknown]`

### Returns

- `SGPFile object { id, created_at, created_by, 7 more }`

  - `id: string`

    The unique identifier of the entity.

  - `created_at: string`

    The date and time when the entity was created in ISO format.

  - `created_by: Identity`

    The identity that created the entity.

    - `id: string`

    - `type: "user" or "service_account"`

      - `"user"`

      - `"service_account"`

    - `object: optional "identity"`

      - `"identity"`

  - `filename: string`

  - `md5_checksum: string`

  - `mime_type: string`

  - `size: number`

  - `duration_seconds: optional number`

  - `object: optional "file"`

    - `"file"`

  - `tags: optional map[unknown]`

### Example

```http
curl https://api.egp.scale.com/v5/files/$FILE_ID \
    -X PATCH \
    -H 'Content-Type: application/json' \
    -H "x-api-key: $SGP_API_KEY" \
    -d '{}'
```

#### Response

```json
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": {
    "id": "id",
    "type": "user",
    "object": "identity"
  },
  "filename": "filename",
  "md5_checksum": "md5_checksum",
  "mime_type": "mime_type",
  "size": 0,
  "duration_seconds": 0,
  "object": "file",
  "tags": {
    "foo": "bar"
  }
}
```
