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
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"success": false,
"message": "<string>",
"error": "<string>"
}Datasets API
Create Dataset Version from File
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
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"success": false,
"message": "<string>",
"error": "<string>"
}Legacy Dataset, Evaluation, and Report endpoints are deprecated for new workflows. Use the Tables API for new dataset import, evaluation, scoring, recalculation, and reporting workflows.
Behavior Notes
- The draft dataset starts with
version_number = -1and receives a real version number after processing succeeds. - The
dataset_version_created_by_filewebhook event is sent when processing succeeds. - The
dataset_version_created_by_file_failedwebhook event is sent when processing fails. - Decoded file content must be 100MB or smaller.
- Failed drafts are automatically cleaned up.
Related
Authorizations
Body
application/json
ID of the dataset group where the new version will be created.
Required range:
x >= 1Name of the CSV or JSON file. Must end with .csv or .json.
Required string length:
1 - 255Base64-encoded file content. Maximum decoded file size is 100MB.
Minimum string length:
1Was this page helpful?

