---
title: "(-- api-linter: core::0136::http-method=disabled aip.dev/not-precedent: MakeDirectory is a custom method on a singleton resource, not a standard Create method. It uses POST for consistency with other custom methods on the Filesystem singleton. --) (-- api-linter: core::0133::synonyms=disabled aip.dev/not-precedent: MakeDirectory is a custom method on a singleton resource. The \"make\" verb follows Unix convention (mkdir) and clearly conveys imperative action. --) Creates a directory (similar to Unix mkdir). If the path already exists (including if it's a symbolic link to a directory), returns an error."
method: POST
path: "/v1/{name}/filesystem:makeDirectory"
tags: ["FilesystemService"]
---

# (-- api-linter: core::0136::http-method=disabled aip.dev/not-precedent: MakeDirectory is a custom method on a singleton resource, not a standard Create method. It uses POST for consistency with other custom methods on the Filesystem singleton. --) (-- api-linter: core::0133::synonyms=disabled aip.dev/not-precedent: MakeDirectory is a custom method on a singleton resource. The "make" verb follows Unix convention (mkdir) and clearly conveys imperative action. --) Creates a directory (similar to Unix mkdir). If the path already exists (including if it's a symbolic link to a directory), returns an error.

`POST /v1/{name}/filesystem:makeDirectory`

## Request

- Base URL: `https://docs.h2o.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.h2o.ai/v1/{name}/filesystem:makeDirectory`
- Auth: none declared
- TypeScript: <https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/docs/v1/:name/filesystem:makeDirectory/post.ts> (a function with typed inputs; its response is checked against the schema)

Authorization: Only the creator of the parent SandboxEngine is allowed to call this method.

## Path parameters

- `name` string, required

## Request body

- object: Request to create a directory.
  - `path` string, required: Required. The path where the directory should be created. All paths are rooted at the sandbox filesystem root. Must start with a forward slash (e.g., "/data", "/workspace/data"). The directory will be created with 0755 permissions (rwxr-xr-x).
  - `createParentDirectories` boolean: Optional. If true, creates parent directories if they don't exist. If false or unspecified, the operation will fail if parent directories don't exist.

## Response `200`

A successful response.

- V1MakeDirectoryResponse: Response from creating a directory.
  - `fileInfo` V1FileInfo: FileInfo contains metadata about a file or directory.
    - `path` string: Output only. The absolute path of the file or directory.
    - `size` string, int64: Output only. The size of the file in bytes. For directories, this is typically 0 or the size of the directory metadata.
    - `type` 'FILE_TYPE_UNSPECIFIED' | 'FILE_TYPE_REGULAR' | 'FILE_TYPE_DIRECTORY' | 'FILE_TYPE_SYMLINK': FileType indicates the type of filesystem entry. - FILE_TYPE_UNSPECIFIED: The file type is not specified. - FILE_TYPE_REGULAR: A regular file. - FILE_TYPE_DIRECTORY: A directory. - FILE_TYPE_SYMLINK: A symbolic link.
    - `modifyTime` string, date-time: Output only. The last modification time of the file or directory (mtime).
    - `mode` string: Output only. Unix file mode and permission bits in octal notation. The format follows standard Unix permissions represented as a string. Examples: "0644" (rw-r--r--), "0755" (rwxr-xr-x), "0777" (rwxrwxrwx).

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto.md) - [All operations](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/revisions/297cfadc1d39?raw)
