Skip to main content
POST
/
api
/
public
/
v2
/
dataset-versions
/
create-draft
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/dataset-versions/create-draft \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "dataset_group_id": 123
}
'
{
  "success": true,
  "message": "Draft dataset version created",
  "draft_dataset_id": 789
}

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.

Create a mutable draft dataset version for a dataset group. Drafts use version_number = -1 until they are saved as a published version.

Behavior Notes

  • Only one draft can exist per dataset group at a time; creating another draft returns 409.
  • Without source_dataset_id, PromptLayer creates an empty draft and returns 201.
  • With source_dataset_id, rows are copied from the source dataset asynchronously and the endpoint returns 202.
  • The source dataset must belong to the same dataset group.

Authorizations

X-API-KEY
string
header
required

Body

application/json
dataset_group_id
integer
required

ID of the dataset group to create a draft version for.

Required range: x >= 1
source_dataset_id
integer | null

Optional existing dataset version to copy rows from. Must belong to the same dataset group.

Required range: x >= 1

Response

Empty draft created.

success
enum<boolean>
required
Available options:
true
message
string
required
draft_dataset_id
integer
required

ID of the draft dataset.