POST
/
api
/
public
/
v2
/
folders
Create Folder
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/folders \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '{
  "name": "<string>",
  "parent_id": 123
}'
{
  "success": true,
  "folder": {
    "id": 123,
    "name": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "path": [
      {}
    ],
    "workspace_id": 123,
    "parent_id": 123
  }
}
Creates a new folder in the workspace. Folders can be nested within other folders by providing a parent_id. The folder name must be unique within its parent folder (or at the root level if no parent is specified).

Headers

X-API-KEY
string
required

Body

application/json
name
string
required

The name of the folder. Must be unique within its parent folder.

Required string length: 1 - 255
parent_id
integer | null

The ID of the parent folder. If null or not provided, the folder will be created at the root level of the workspace.

Response

Folder created successfully

success
boolean

Indicates if the operation was successful

folder
object