curl --request POST \
--url https://api.promptlayer.com/api/public/v2/dataset-versions/from-filter-params \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"dataset_group_id": 123,
"request_log_ids": [
1001,
1002,
1003
]
}
'{
"success": true,
"message": "Dataset version creation queued",
"dataset_id": 456,
"dataset_group_id": 123,
"version_number": -1
}{
"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>"
}
]
}Datasets API
Create Dataset Version from Request History
POST
/
api
/
public
/
v2
/
dataset-versions
/
from-filter-params
curl --request POST \
--url https://api.promptlayer.com/api/public/v2/dataset-versions/from-filter-params \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"dataset_group_id": 123,
"request_log_ids": [
1001,
1002,
1003
]
}
'{
"success": true,
"message": "Dataset version creation queued",
"dataset_id": 456,
"dataset_group_id": 123,
"version_number": -1
}{
"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>"
}
]
}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
- If both
request_log_idsandfilter_groupare present, explicit request IDs take precedence. - The endpoint queues a background job and reuses the draft dataset for the dataset group when one already exists.
- Jobs are capped at 50,000 request logs.
- Filter-based datasets persist their filter parameters so refresh flows can replay the same query later.
- Completion triggers the
dataset_version_created_from_filter_paramswebhook.
Related
Authorizations
Body
application/json
Dataset version creation payload from request IDs or request-log filters.
Dataset group that will receive the generated dataset version.
Explicit request log IDs to snapshot. When provided, this mode takes precedence over filter_group.
Maximum array length:
50000Structured request-log filters used to populate the dataset asynchronously.
Show child attributes
Show child attributes
Free-text request-log search query applied with filter_group.
Available options:
request_start_time, input_tokens, output_tokens, cost, latency_ms, status Available options:
asc, desc Request fields or variables to parse into dataset columns.
Maximum number of request logs to include. When set, only the first N matching rows (in the current sort order) are added to the dataset version.
Required range:
x >= 1Was this page helpful?

