> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openinary.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Folder

> Create an empty folder in storage

Post the path you want as a multipart `folder` field. Nested paths are created in one call.

```
POST /upload/createfolder
```

```bash theme={null}
curl -X POST https://cdn.openinary.dev/upload/createfolder \
  -H "Authorization: Bearer <api_key>" \
  -F "folder=products/2024"
```

**Auth:** API Key required
**Content-Type:** `multipart/form-data`

## Form fields

| Field | Type | Description |
| - | - | - |
| `folder` | `string` | Required. Path of the folder to create, nested paths supported (`uploads/2024/january`) |

## Response

`201` on success:

```json theme={null}
{
  "success": true,
  "folder": "uploads/2024",
  "error": null
}
```

`409` when the folder already exists:

```json theme={null}
{
  "success": false,
  "folder": null,
  "error": "Folder already exists"
}
```

A `400` means the folder path is invalid.

Note that `folder` is `null` on the `409`, not the path you asked for. Read the path you sent from your own request, not from this response.

## Related

> [card] [Upload Files](https://docs.openinary.dev/api-reference/files/upload.md)
>
> Upload files into a folder.

> [card] [List Storage](https://docs.openinary.dev/api-reference/storage/list.md)
>
> Browse the folder tree.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.