Create task
Creates a new task. Supported task types:
type | Data source | Notes |
|---|---|---|
template_evaluation | project_id or dataset_id | Requires evaluators. Supports continuous operation. |
code_evaluation | project_id or dataset_id | Requires evaluators. Supports continuous operation. |
run_experiment | dataset_id only | Requires run_configuration. Never continuous. |
For run_experiment tasks the run configuration is stored on the task.
Each trigger (POST /v2/tasks/{task_id}/trigger) supplies per-run fields
(experiment_name, optional example subset, etc.) and starts an async run.
Poll GET /v2/task-runs/{run_id} until status reaches a terminal state.
Payload Requirements (template_evaluation / code_evaluation)
- At least one evaluator is required.
- Duplicate evaluator IDs are not allowed.
- When
dataset_idis provided,experiment_idsmust contain at least one entry. sampling_rateandis_continuousare only supported on project-based tasks.- System-managed fields (
id,created_at,updated_at) are rejected on input.
Payload Requirements (run_experiment)
dataset_idis required;project_idmust be omitted.run_configurationis required;evaluators,experiment_ids,sampling_rate,is_continuous, andquery_filtermust be omitted.
Valid example (template_evaluation, project-based)
{
"name": "Production Hallucination Check",
"type": "template_evaluation",
"project_id": "TW9kZWw6MTIzOmFCY0Q=",
"sampling_rate": 1.0,
"is_continuous": true,
"evaluators": [
{
"evaluator_id": "RXZhbHVhdG9yOjEyOmFCY0Q=",
"column_mappings": {"input": "attributes.input.value", "output": "attributes.output.value"}
}
]
}
Invalid example (run_experiment missing run_configuration)
{
"name": "My Experiment",
"type": "run_experiment",
"dataset_id": "RGF0YXNldDo1NjpxUndY"
}
Authorizations
Most Arize AI endpoints require authentication. For those endpoints that require authentication, include your API key in the request header using the format
Body
Body containing task creation parameters. The type field is the discriminator.
type | Schema |
|---|---|
template_evaluation | CreateTemplateEvaluationTaskRequest |
code_evaluation | CreateCodeEvaluationTaskRequest |
run_experiment | CreateRunExperimentTaskRequest |
run_experiment tasks do not run continuously — they must be triggered
explicitly via POST /v2/tasks/{task_id}/trigger each time.
For template_evaluation / code_evaluation tasks, exactly one of project_id
or dataset_id must be provided. When dataset_id is provided, experiment_ids
must contain at least one entry. is_continuous and sampling_rate are only
supported for project-based tasks.
- Option 1
- Option 2
- Option 3
Request body for creating a template_evaluation task. Requires evaluators
and exactly one of project_id or dataset_id. When dataset_id is provided,
experiment_ids must contain at least one entry.
Task name
1Task type discriminator. Must be "template_evaluation".
template_evaluation Evaluators to attach (at least one required).
1Project identifier (base64). Required when dataset_id is not provided.
Mutually exclusive with dataset_id.
Dataset identifier (base64). Required when project_id is not provided.
Mutually exclusive with project_id.
Experiment identifiers (base64). Required when dataset_id is provided
(at least one entry). Must be omitted or empty for project-based tasks.
Sampling rate between 0 and 1. Only supported on project-based tasks.
0 <= x <= 1Whether the task runs continuously. Only supported on project-based tasks.
Must be false or omitted for dataset-based tasks.
Task-level query filter applied to all evaluated data.
Response
Returns the created task
A task is a typed, configurable unit of work that ties one or more evaluators
to a data source (project or dataset). run_experiment tasks additionally
carry a run_configuration that defines the LLM or evaluator settings for
each triggered run.
The unique identifier for the task
The name of the task
The task type.
- template_evaluation - An LLM template-based evaluation task.
- code_evaluation - A code-based evaluation task.
- run_experiment - A task that runs experiments.
template_evaluation, code_evaluation, run_experiment Whether the task runs continuously on incoming data.
Task-level query filter applied to all data.
The evaluators attached to this task. Empty for run_experiment tasks.
Experiment identifiers (base64) for dataset-based tasks.
When the task was last run.
When the task was created.
When the task was last updated.
The unique identifier for the user who created the task.
The project identifier (base64). Present for project-based tasks.
The dataset identifier (base64). Present for dataset-based tasks.
Sampling rate between 0 and 1. Only applicable for project-based tasks.
0 <= x <= 1The run configuration for a run_experiment task. Present only when
type is run_experiment. Null for all other task types.
- Option 1
- Option 2