Skip to main content
POST
/
api
/
public
/
v2
/
dataset-groups
Create Dataset Group
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/dataset-groups \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '
{
  "name": "<string>",
  "workspace_id": 2,
  "folder_id": 2
}
'
{
  "success": true,
  "message": "<string>",
  "dataset_group": {
    "id": 123,
    "name": "<string>",
    "workspace_id": 123,
    "is_deleted": true
  },
  "dataset": {
    "id": 123,
    "dataset_group_id": 123,
    "version_number": 123,
    "column_names": [
      "<string>"
    ],
    "is_deleted": true,
    "user_id": 123,
    "filter_params": {},
    "dataset_group": {
      "id": 123,
      "name": "<string>",
      "workspace_id": 123,
      "is_deleted": true
    }
  }
}
Create a new dataset group within a workspace. When a dataset group is created, an initial draft dataset (version_number = -1) is automatically created. Dataset group names must be unique within a workspace.

Authentication

This endpoint requires API key authentication.

Request Parameters

ParameterTypeRequiredDescription
namestringYesName for the dataset group. Must be unique within the workspace.
workspace_idintegerNoWorkspace ID. Defaults to the workspace associated with the API key.
folder_idintegerNoFolder ID to create the dataset group in. If omitted, the dataset group is created at the workspace root. Use Resolve Folder ID by Path to look up an ID from a path, or Create Folder to make one.

Example: create a dataset group inside a folder

import requests

response = requests.post(
    "https://api.promptlayer.com/api/public/v2/dataset-groups",
    headers={"X-API-KEY": "your-api-key"},
    json={
        "name": "Customer support eval set",
        "folder_id": 17,
    },
)

Headers

X-API-KEY
string
required

Your PromptLayer API key.

Body

application/json
name
string
required

Name of the dataset group. Must be unique within the workspace.

Minimum string length: 1
workspace_id
integer

Optional: ID of the workspace where the dataset group will be created. If not provided, uses the workspace associated with your API key.

Required range: x >= 1
folder_id
integer | null

Optional folder ID to create the dataset group inside. If omitted, the dataset group is created at the workspace root.

Required range: x >= 1

Response

Dataset group created successfully

success
boolean
required
message
string
required
dataset_group
DatasetGroup · object
required
dataset
Dataset · object
required