Skip to main content
POST
/
api
/
public
/
v2
/
dataset-versions
/
save-draft
Save Draft Dataset Version
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/dataset-versions/save-draft \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '
{
  "dataset_group_id": 2
}
'
{
  "success": true,
  "message": "<string>",
  "draft_dataset_id": 123
}
Publish a draft dataset version by assigning it a real version number. The save is processed asynchronously in the background.

Authentication

This endpoint requires API key authentication only.

Asynchronous Processing

This endpoint queues a background job to finalize the draft. The draft’s version number is updated from -1 to the next sequential version number. Returns 202 immediately.

Workflow

This is the final step in the dataset version creation workflow:
  1. Create draft — Use Create Draft
  2. Add rows — Use Add Request Log to add request logs
  3. Save — Use this endpoint to publish as a new version

Notes

  • Returns 404 if no draft version exists for the dataset group.

Headers

X-API-KEY
string
required

API key for authentication. This endpoint supports API key authentication only.

Body

application/json
dataset_group_id
integer
required

ID of the dataset group containing the draft to save

Required range: x >= 1

Response

Dataset save job queued

success
boolean
required
message
string
required
draft_dataset_id
integer
required

ID of the draft dataset being saved