## Create Directory `DirectoryCreateResponse beta().directories().create(DirectoryCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())` **post** `/api/v1/beta/directories` Create a new directory within the specified project. ### Parameters - `DirectoryCreateParams params` - `Optional organizationId` - `Optional projectId` - `String name` Human-readable name for the directory. - `Optional description` Optional description shown to users. - `Optional expiresAt` When this directory expires. Required for ephemeral directories. - `Optional systemMetadata` Reserved system-managed metadata. - `Optional type` Directory type. Use 'ephemeral' for batch processing with automatic cleanup. - `USER("user")` - `EPHEMERAL("ephemeral")` ### Returns - `class DirectoryCreateResponse:` API response schema for a directory. - `String id` Unique identifier for the directory. - `String name` Human-readable name for the directory. - `String projectId` Project the directory belongs to. - `Optional createdAt` Creation datetime - `Optional deletedAt` Optional timestamp of when the directory was deleted. Null if not deleted. - `Optional description` Optional description shown to users. - `Optional expiresAt` When this directory expires and is eligible for cleanup. - `Optional systemMetadata` Reserved system-managed metadata. - `Optional type` Directory type: 'user', 'index', 'ephemeral', or 'system_ephemeral'. - `USER("user")` - `INDEX("index")` - `EPHEMERAL("ephemeral")` - `SYSTEM_EPHEMERAL("system_ephemeral")` - `Optional updatedAt` Update datetime ### Example ```java package com.llamacloud_prod.api.example; import com.llamacloud_prod.api.client.LlamaCloudClient; import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient; import com.llamacloud_prod.api.models.beta.directories.DirectoryCreateParams; import com.llamacloud_prod.api.models.beta.directories.DirectoryCreateResponse; public final class Main { private Main() {} public static void main(String[] args) { LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); DirectoryCreateParams params = DirectoryCreateParams.builder() .name("x") .build(); DirectoryCreateResponse directory = client.beta().directories().create(params); } } ``` #### 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": "user", "updated_at": "2019-12-27T18:11:19.117Z" } ```