## List Directories

`DirectoryListPageResponse Beta.Directories.List(DirectoryListParams?parameters, CancellationTokencancellationToken = default)`

**get** `/api/v1/beta/directories`

List Directories

### Parameters

- `DirectoryListParams parameters`

  - `Boolean includeDeleted`

    Include deleted directories.

  - `string? name`

    Directory name to match.

  - `string? organizationID`

  - `Long? pageSize`

  - `string? pageToken`

  - `string? projectID`

  - `Type? type`

    Directory type to include.

    - `"ephemeral"Ephemeral`

    - `"index"Index`

    - `"user"User`

  - `IReadOnlyList<Type>? types`

    Filter by one or more directory types. Repeat the parameter for multiple values.

    - `"ephemeral"Ephemeral`

    - `"index"Index`

    - `"user"User`

### Returns

- `class DirectoryListPageResponse:`

  API query response schema for directories.

  - `required IReadOnlyList<DirectoryListResponse> Items`

    The list of items.

    - `required string ID`

      Unique identifier for the directory.

    - `required string Name`

      Human-readable name for the directory.

    - `required string ProjectID`

      Project the directory belongs to.

    - `DateTimeOffset? CreatedAt`

      Creation datetime

    - `DateTimeOffset? DeletedAt`

      Optional timestamp of when the directory was deleted. Null if not deleted.

    - `string? Description`

      Optional description shown to users.

    - `DateTimeOffset? ExpiresAt`

      When this directory expires and is eligible for cleanup.

    - `IReadOnlyDictionary<string, JsonElement>? SystemMetadata`

      Reserved system-managed metadata.

    - `Type? Type`

      Directory type: 'user', 'index', or 'ephemeral'.

      - `"ephemeral"Ephemeral`

      - `"index"Index`

      - `"user"User`

    - `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
DirectoryListParams parameters = new();

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

#### Response

```json
{
  "items": [
    {
      "id": "id",
      "name": "x",
      "project_id": "project_id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "deleted_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "expires_at": "2019-12-27T18:11:19.117Z",
      "system_metadata": {
        "foo": "bar"
      },
      "type": "ephemeral",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```
