## Create Directory

`DirectoryCreateResponse Beta.Directories.Create(DirectoryCreateParamsparameters, CancellationTokencancellationToken = default)`

**post** `/api/v1/beta/directories`

Create a new directory within the specified project.

### Parameters

- `DirectoryCreateParams parameters`

  - `required string name`

    Body param: Human-readable name for the directory.

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `string? description`

    Body param: Optional description shown to users.

  - `IReadOnlyDictionary<string, JsonElement>? systemMetadata`

    Body param: Reserved system-managed metadata.

  - `Type type`

    Body param: Directory type. Use 'ephemeral' for batch processing with automatic cleanup.

    - `"ephemeral"Ephemeral`

    - `"user"User`

### Returns

- `class DirectoryCreateResponse:`

  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
DirectoryCreateParams parameters = new() { Name = "x" };

var directory = await client.Beta.Directories.Create(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"
}
```
