# Create Folder — Box

> Creates a new empty folder within the specified parent folder. Parent folder ID 0 is the root (All Files). Folder names must be 1-255 characters, use only Unicode Basic Multilingual Plane (BMP) characters, and cannot contain non-printable…

- Key: `box-create-folder`
- Type: Action (Write)
- Version: 0.0.2
- App: Box (`box`) — https://pipedream.com/apps/box.md
- This page (HTML): https://pipedream.com/apps/box/actions/create-folder
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/box/actions/create-folder/create-folder.mjs

## Description

Creates a new empty folder within the specified parent folder. Parent folder ID `0` is the root (All Files). Folder names must be 1-255 characters, use only Unicode Basic Multilingual Plane (BMP) characters, and cannot contain non-printable characters, `/` or `\`, leading or trailing spaces, or be `.` or `..`. Names must be unique within the parent (case-insensitive). Use **List Folder Items** to inspect contents, or **Move Folder** / **Delete Folder** to reorganize afterward. [See folder name restrictions](https://support.box.com/hc/en-us/articles/360044196773-Troubleshooting-Uploads-to-Box). [See the documentation](https://developer.box.com/reference/post-folders/).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `parentId` | `string` | No | The parent folder to create the new folder in. Use 0 for the root folder. Use the List Folders action to retrieve folder IDs. Options are loaded from the connected account. |
| `name` | `string` | Yes | The name of the new folder. Must be 1-255 characters and use only Unicode Basic Multilingual Plane (BMP) characters. Cannot contain non-printable characters, / or \, leading or trailing spaces, or be . or ... See folder name restrictions. |
| `fields` | `string[]` | No | A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response, e.g. id,type,name |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "box",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "box-create-folder",
  arguments: {
    parentId: "Parent Folder",
    name: "Folder Name",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "box-create-folder",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    box: { authProvisionId: "apn_xxxxxxx" },
    parentId: "Parent Folder",
    name: "Folder Name",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "box-create-folder",
    "configured_props": {
      "box": { "authProvisionId": "apn_xxxxxxx" },
      "parentId": "Parent Folder",
      "name": "Folder Name"
    }
  }'
```

---

- App: https://pipedream.com/apps/box.md · All apps: https://pipedream.com/apps
