## Update Directory

`DirectoryUpdateResponse Beta.Directories.Update(DirectoryUpdateParamsparameters, CancellationTokencancellationToken = default)`

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

Update directory metadata.

### Parameters

- `DirectoryUpdateParams parameters`

  - `required string directoryID`

    Path param

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `string? description`

    Body param: Updated description for the directory.

  - `string? name`

    Body param: Updated name for the directory.

### Returns

- `class DirectoryUpdateResponse:`

  API response schema for a directory.

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

### Example

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

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

Console.WriteLine(directory);
```

#### Response

```json
{
  "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"
}
```
