# Create Folder

Source: https://agenta.ai/docs/reference/api/create-folder

`POST /folders/`

Base URL: `https://us.cloud.agenta.ai/api` (US cloud), `https://eu.cloud.agenta.ai/api` (EU cloud) or `$AGENTA_HOST/api` (self-hosted). Authentication: `Authorization: ApiKey YOUR_API_KEY`.

Create a folder.

The folder name must match `[\w -]+` (letters, digits, underscore,
space, hyphen); other characters return `400`. The resulting path
(the slug joined to the parent's path with a dot) must be unique
within the project, otherwise the call returns `409`. Passing a
`parent_id` that does not exist returns `404`. Paths are capped at
10 levels of nesting and slugs at 64 characters.

## Request body schema

Content type: `application/json` (required)

- `folder` (object, required): Folder to create. `slug` is required; `parent_id` nests the new folder under an existing one.
  - `flags` (object, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `slug` (string, nullable)
  - `kind` (string, one of: "applications", nullable): Resource family the folder organizes. Defaults to `applications` when omitted.
  - `parent_id` (string (uuid), nullable): Id of the parent folder. Omit or set to `null` to create a root folder.

## Response schemas

### 200: Successful Response

- `count` (integer): Number of folders returned (`0` or `1`). Default: `0`.
- `folder` (object, nullable): The folder, when found. Omitted when `count` is `0`.
  - `flags` (object, nullable)
  - `tags` (object, nullable)
  - `meta` (object, nullable)
  - `name` (string, nullable)
  - `description` (string, nullable)
  - `created_at` (string (date-time), nullable)
  - `updated_at` (string (date-time), nullable)
  - `deleted_at` (string (date-time), nullable)
  - `created_by_id` (string (uuid), nullable)
  - `updated_by_id` (string (uuid), nullable)
  - `deleted_by_id` (string (uuid), nullable)
  - `slug` (string, nullable)
  - `id` (string (uuid), nullable)
  - `kind` (string, one of: "applications", nullable): Resource family this folder organizes. Only `applications` is defined today, and it also covers workflows, evaluators, and testsets (they share the artifact table).
  - `path` (string, nullable): Dot-separated materialized path built from the folder's slug and its ancestors' slugs. Read-only; derived by the server.
  - `parent_id` (string (uuid), nullable): Id of the parent folder, or `null` for a root folder.

### 422: Validation Error

- `detail` (array of object)
  - `loc` (array of string | integer, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (Context)
