Skip to main content
POST
/
api
/
public
/
v2
/
dataset-versions
/
from-file
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/dataset-versions/from-file \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "dataset_group_id": 123,
  "file_name": "support-eval.csv",
  "file_content_base64": "cXVlc3Rpb24sZXhwZWN0ZWRfYW5zd2VyCldoYXQgaXMgUHJvbXB0TGF5ZXI/LEEgcHJvbXB0IG1hbmFnZW1lbnQgcGxhdGZvcm0="
}
'
{
  "success": true,
  "message": "Dataset version creation job queued",
  "dataset_id": 456
}

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 dataset version by submitting a base64-encoded CSV or JSON file. PromptLayer queues the file for asynchronous processing and creates a draft dataset while the job runs.

Behavior Notes

  • The draft dataset starts with version_number = -1 and receives a real version number after processing succeeds.
  • The dataset_version_created_by_file webhook event is sent when processing succeeds.
  • The dataset_version_created_by_file_failed webhook event is sent when processing fails.
  • Decoded file content must be 100MB or smaller.
  • Failed drafts are automatically cleaned up.

Authorizations

X-API-KEY
string
header
required

Body

application/json
dataset_group_id
integer
required

ID of the dataset group where the new version will be created.

Required range: x >= 1
file_name
string
required

Name of the CSV or JSON file. Must end with .csv or .json.

Required string length: 1 - 255
file_content_base64
string
required

Base64-encoded file content. Maximum decoded file size is 100MB.

Minimum string length: 1

Response

Dataset version creation job queued.

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

ID of the draft dataset created for asynchronous processing.