Create Task
POSThttps://api.confident-ai.com/v2/datasets/{datasetId}/dataset-ingestion-tasks
Creates a standing rule that harvests matching production traces, spans or threads into the dataset as goldens, starting immediately unless enabled is false, and returns its id. dataModel must match the dataset: THREAD for multi-turn, TRACE or SPAN for single-turn. Requires the Starter plan or above.
curl -X POST "https://api.confident-ai.com/v2/datasets/{datasetId}/dataset-ingestion-tasks" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Harvest failed lookups",
"dataModel": "TRACE",
"description": "Traces where the assistant failed to name a capital.",
"enabled": true,
"sampleRate": 0.1,
"filters": {
"operator": "AND",
"groups": [
{
"operator": "AND",
"filters": [
{
"category": "Name",
"condition": "Is",
"value": "capital-lookup"
}
]
}
]
},
"maxGoldens": 500,
"inputTransformerId": "<TRANSFORMER-ID>",
"outputTransformerId": null,
"includeInput": true,
"includeActualOutput": true,
"includeExpectedOutput": false,
"includeRetrievalContext": false,
"includeContext": false,
"includeToolsCalled": false,
"includeExpectedTools": false
}'{
"success": true,
"data": {
"id": "<DATASET-INGESTION-TASK-ID>"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/workflows",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
datasetIdstringRequiredThe unique id of the dataset.
Request body
namestringRequiredA name for the task, unique within the dataset.
dataModelenumRequiredWhat kind of production item an ingestion task harvests. THREAD tasks fill multi-turn datasets; TRACE and SPAN tasks fill single-turn ones.
Show 3 enum valuesHide 3 enum values
TRACESPANTHREAD
descriptionstring | nullA note about what the task harvests. Send null to clear it.
enabledbooleanWhether the task runs. Disabling it unschedules the harvesting job, and goldens already created are kept. Defaults to false.
sampleRatenumberThe fraction of matching items to ingest, between 0 and 1. Defaults to 1, all of them.
filtersobjectA set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as
NameorUser Id, against a value with a condition such asIsorContains.Show 2 propertiesHide 2 properties
operatorenumRequiredShow 2 enum valuesHide 2 enum values
ANDOR
groupslist of objectsRequiredShow 2 propertiesHide 2 properties
operatorenumRequiredShow 2 enum valuesHide 2 enum values
ANDOR
filterslist of objectsRequiredShow 4 propertiesHide 4 properties
categoryenumRequiredShow 80 enum valuesHide 80 enum values
User IdThread IdTrace UuidTrace NameTrace VersionTrace StatusTrace TagsTraceSpan UuidNameSpan NameSpan TypeSpan StatusMetrics StatusError StatusNameModelProviderIntegrationEmbedderChunk SizeTop-KHyperparameterDatasetDataset NameTest Run IDIdentifierTest FileStatusOfficialEvals ModeTests PassedTests FailedPass RateFail RateStar RatingThumbs RatingExplanationExpected OutputExpected OutcomeAnnotatorEnd UserAnnotation TypeAnnotation NameCriteriaAnnotation DateMetric ScoreMetric StatusNameMetadataClassifierMetricMetric NameTrace CountTest Case IDRequested review fromAssigned toTagsLabelsTools CalledFinalizedGolden IDIngestion TaskLatencyEnvironmentReview flagVulnerabilityVulnerability TypeAttack MethodRisk CategoryFrameworkAssessment IDPrompt AliasPrompt VersionPrompt LabelPrompt Commit HashPromptAnnotationsStatus CodeActor Type
conditionenum | enum | enum | enum | enum | enum | enum | enum | enum | enumRequiredShow 10 variantsHide 10 variants
enum
Show 6 enum valuesHide 6 enum values
Is less thanIs equal or less thanIs greater thanIs equal or greater thanIs equal toDoes not equal
- OR
enum
Show 2 enum valuesHide 2 enum values
HasHas not
- OR
enum
Show 2 enum valuesHide 2 enum values
IsIs not
- OR
enum
Show 2 enum valuesHide 2 enum values
Is one ofIs not one of
- OR
enum
Show 4 enum valuesHide 4 enum values
IsIs notIs emptyIs not empty
- OR
enum
Show 2 enum valuesHide 2 enum values
ContainsDoes not contain
- OR
enum
Show 3 enum valuesHide 3 enum values
ContainsContains onlyDoes not contain
- OR
enum
Show 4 enum valuesHide 4 enum values
Has decreased by more thanHas decreased by less thanHas increased by more thanHas increased by less than
- OR
enum
Show 1 enum valueHide 1 enum value
Has changed from
- OR
enum
Show 1 enum valueHide 1 enum value
Is between
valuestring | number | list of stringsRequiredShow 3 variantsHide 3 variants
string
- OR
number
- OR
list of strings
keystring
maxGoldensinteger | nullThe maximum number of goldens this task will ever create. Send null to remove the cap.
inputTransformerIdstring | nullThe id of a transformer that reshapes the harvested input before it is stored. Send null to detach it.
outputTransformerIdstring | nullThe id of a transformer that reshapes the harvested output before it is stored. Send null to detach it.
includeInputbooleanPopulate the golden's
inputfrom the harvested item. Defaults to true; every other include flag defaults to false.includeActualOutputbooleanPopulate the golden's
actualOutputfrom the harvested item.includeExpectedOutputbooleanPopulate the golden's
expectedOutputfrom the harvested item.includeRetrievalContextbooleanPopulate the golden's
retrievalContextfrom the harvested item.includeContextbooleanPopulate the golden's
contextfrom the harvested item.includeToolsCalledbooleanPopulate the golden's
toolsCalledfrom the harvested item.includeExpectedToolsbooleanPopulate the golden's
expectedToolsfrom the harvested item.
Response
Create Task succeeded.
successbooleanIndicates if the request was successful.
dataobjectShow 1 propertyHide 1 property
idstringThe unique id of the ingestion task.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.