## Update Directory File

`FileUpdateResponse Beta.Directories.Files.Update(FileUpdateParamsparameters, CancellationTokencancellationToken = default)`

**patch** `/api/v1/beta/directories/{directory_id}/files/{directory_file_id}`

Update directory-file metadata by `directory_file_id`; set `directory_id` to move the file to a different directory. To resolve from `unique_id`, list with a filter first.

### Parameters

- `FileUpdateParams parameters`

  - `required string directoryID`

    Path param

  - `required string directoryFileID`

    Path param

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `string? displayName`

    Body param: Updated display name.

  - `IReadOnlyDictionary<string, Metadata>? metadata`

    Body param: User-defined metadata key-value pairs. Replaces the user metadata layer.

    - `string`

    - `Long`

    - `Double`

    - `Boolean`

    - `JsonElement`

    - `IReadOnlyList<string>`

  - `string? targetDirectoryID`

    Body param: Move file to a different directory.

  - `string? uniqueID`

    Body param: Updated unique identifier.

### Returns

- `class FileUpdateResponse:`

  API response schema for a directory file.

  - `required string ID`

    Unique identifier for the directory file.

  - `required string DirectoryID`

    Directory the file belongs to.

  - `required string DisplayName`

    Display name for the file.

  - `required string ProjectID`

    Project the directory file belongs to.

  - `required string UniqueID`

    Unique identifier for the file in the directory

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `DateTimeOffset? DeletedAt`

    Soft delete marker when the file is removed upstream or by user action.

  - `PresignedUrl? DownloadUrl`

    Schema for a presigned URL.

    - `required DateTimeOffset ExpiresAt`

      The time at which the presigned URL expires

    - `required string Url`

      A presigned URL for IO operations against a private file

    - `IReadOnlyDictionary<string, string>? FormFields`

      Form fields for a presigned POST request

  - `string? FileID`

    File ID for the storage location.

  - `IReadOnlyDictionary<string, Metadata> Metadata`

    Merged metadata from all sources. Higher-priority sources override lower.

    - `string`

    - `Long`

    - `Double`

    - `Boolean`

    - `JsonElement`

    - `IReadOnlyList<string>`

  - `DateTimeOffset? UpdatedAt`

    Update datetime

### Example

```csharp
FileUpdateParams parameters = new()
{
    DirectoryID = "directory_id",
    DirectoryFileID = "directory_file_id",
};

var file = await client.Beta.Directories.Files.Update(parameters);

Console.WriteLine(file);
```

#### Response

```json
{
  "id": "id",
  "directory_id": "directory_id",
  "display_name": "x",
  "project_id": "project_id",
  "unique_id": "x",
  "created_at": "2019-12-27T18:11:19.117Z",
  "deleted_at": "2019-12-27T18:11:19.117Z",
  "download_url": {
    "expires_at": "2019-12-27T18:11:19.117Z",
    "url": "https://example.com",
    "form_fields": {
      "foo": "string"
    }
  },
  "file_id": "file_id",
  "metadata": {
    "foo": "string"
  },
  "updated_at": "2019-12-27T18:11:19.117Z"
}
```
