---
title: "Create Folder"
method: POST
path: "/api/public/v2/folders"
tags: ["folders"]
---

# Create Folder

`POST /api/public/v2/folders`

## Request body

- CreateFolderRequest
  - `name` string, required — The name of the folder. Must be unique within its parent folder.
  - `parent_id` integer, nullable — The ID of the parent folder. If null or not provided, the folder will be created at the root level of the workspace.
  - `workspace_id` integer — Optional workspace ID. If not provided, uses the workspace associated with your API key.
  - `external_ids` ExternalId[] — Identifiers from other systems.
    - `source` string, required — The external system or namespace that owns the ID.
    - `external_id` string, required — The identifier for this entity in the external system.

## Response `201`

Folder created successfully

- CreateFolderSuccessResponse
  - `success` boolean — Indicates if the operation was successful
  - `folder` Folder
    - `id` integer — Unique identifier for the folder
    - `name` string — The name of the folder
    - `created_at` string, date-time — Timestamp when the folder was created
    - `updated_at` string, date-time — Timestamp when the folder was last updated
    - `path` object[], nullable — JSON array representing the folder hierarchy path. Contains the IDs and names of all parent folders. Null for root-level folders.
    - `workspace_id` integer — ID of the workspace this folder belongs to
    - `parent_id` integer, nullable — ID of the parent folder. Null for root-level folders.
    - `external_ids` ExternalId[] — External ID mappings for the folder.
      - `source` string, required — The external system or namespace that owns the ID.
      - `external_id` string, required — The identifier for this entity in the external system.

## Other responses

- `400` — Bad request - Invalid input or folder name already exists
- `401` — Unauthorized - Missing or invalid API key
- `404` — Parent folder not found
- `409` — External ID conflict
- `422` — Validation error - request parameters or body are invalid.

---

[API](https://skmtc.net/promptlayer/apis/promptlayer-api.md) · [All operations](https://skmtc.net/promptlayer/apis/promptlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/promptlayer/promptlayer-api/versions/a23093a0a506/schema)
