## List Directory Files

`FileListPageResponse Beta.Directories.Files.List(FileListParamsparameters, CancellationTokencancellationToken = default)`

**get** `/api/v1/beta/directories/{directory_id}/files`

List all files within the specified directory with optional filtering and pagination.

### Parameters

- `FileListParams parameters`

  - `required string directoryID`

  - `string? displayName`

  - `string? displayNameContains`

  - `IReadOnlyList<string>? expand`

    Fields to expand on each directory file.

  - `string? fileID`

  - `Boolean includeDeleted`

  - `string? organizationID`

  - `Long? pageSize`

  - `string? pageToken`

  - `string? projectID`

  - `string? uniqueID`

  - `DateTimeOffset? updatedAtOnOrAfter`

    Include items updated at or after this timestamp (inclusive)

  - `DateTimeOffset? updatedAtOnOrBefore`

    Include items updated at or before this timestamp (inclusive)

### Returns

- `class FileListPageResponse:`

  API query response schema for directory files.

  - `required IReadOnlyList<FileListResponse> Items`

    The list of items.

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

  - `string? NextPageToken`

    A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.

  - `Long? TotalSize`

    The total number of items available. This is only populated when specifically requested. The value may be an estimate and can be used for display purposes only.

### Example

```csharp
FileListParams parameters = new() { DirectoryID = "directory_id" };

var page = await client.Beta.Directories.Files.List(parameters);
await foreach (var item in page.Paginate())
{
    Console.WriteLine(item);
}
```

#### Response

```json
{
  "items": [
    {
      "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"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```
