---
title: "Create a folder"
method: POST
path: "/folder/create/"
tags: ["Folders"]
---

# Create a folder

`POST /folder/create/`

## Request

- Base URL: `https://hovercode.com/api/v2`
- URL: `https://hovercode.com/api/v2/folder/create/`
- Auth: API key in header `Authorization`

Creates a folder, optionally nested under `parent` (id or slug). If a folder with the same name already exists under the same parent it is returned with 200 instead of creating a duplicate.

## Request body

- object
  - `workspace` string, uuid, required
  - `name` string, required
  - `parent` string: Folder id or slug.

## Response `200`

Existing folder returned.

- Folder
  - `id` string, uuid, required
  - `name` string, required
  - `slug` string, nullable, required
  - `path` string, required
  - `parent` string, uuid, nullable, required
  - `code_count` integer, required
  - `created` string, date-time, required

## Other responses

- `201`: Folder created.
- `400`: Validation error.
- `401`: Missing or invalid API token.
- `404`: Not found, or not in a workspace you belong to.
- `415`: Request body was not JSON.
- `429`: Rate limit exceeded. Wait `Retry-After` seconds before retrying.

---

[API](https://skmtc.dev/hovercode/apis/hovercode-api.md) · [All operations](https://skmtc.dev/hovercode/apis/hovercode-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hovercode/apis/hovercode-api/revisions/4a9bc3cafe41?raw)
