Skip to main content
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: <api-key>' \
  --data '
{
  "name": "<string>",
  "parent_id": 123,
  "workspace_id": 2,
  "external_ids": [
    {
      "source": "<string>",
      "external_id": "<string>"
    }
  ]
}
'
{
  "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,
    "external_ids": [
      {
        "source": "<string>",
        "external_id": "<string>"
      }
    ]
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.promptlayer.com/llms.txt

Use this file to discover all available pages before exploring further.

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).

Authorizations

X-API-KEY
string
header
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.

workspace_id
integer

Optional workspace ID. If not provided, uses the workspace associated with your API key.

Required range: x >= 1
external_ids
ExternalId · object[]

Identifiers from other systems.

Response

Folder created successfully

success
boolean

Indicates if the operation was successful

folder
Folder · object