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. evaluator_version_idpins an evaluator to one version. Omit it (or send null) to run that evaluator’s latest version, which is the default. The version must belong to the evaluator named byevaluator_id, and every evaluator on the task must resolve to the same data scope — both return 422. List an evaluator’s versions withGET /v2/evaluators/{evaluator_id}/versions.
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"}
}
]
}
Valid example (pinned to a specific evaluator version)
{
"name": "Hallucination Check v3",
"type": "TEMPLATE_EVALUATION",
"project_id": "TW9kZWw6MTIzOmFCY0Q=",
"evaluators": [
{
"evaluator_id": "RXZhbHVhdG9yOjEyOmFCY0Q=",
"evaluator_version_id": "RXZhbHVhdG9yVmVyc2lvbjo5OTphQmNE",
"column_mappings": {"input": "attributes.input.value"}
}
]
}
Invalid example (run_experiment missing run_configuration)
{
"name": "My Experiment",
"type": "RUN_EXPERIMENT",
"dataset_id": "RGF0YXNldDo1NjpxUndY"
}
Invalid example (422 — the version belongs to a different evaluator)
{
"name": "Mismatched Pin",
"type": "TEMPLATE_EVALUATION",
"project_id": "TW9kZWw6MTIzOmFCY0Q=",
"evaluators": [
{
"evaluator_id": "RXZhbHVhdG9yOjEyOmFCY0Q=",
"evaluator_version_id": "RXZhbHVhdG9yVmVyc2lvbjo3OmFCY0Q="
}
]
}
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.
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 task. The type field is the discriminator.
RUN_EXPERIMENT tasks do not run continuously — they must be triggered
explicitly via POST /v2/tasks/{task_id}/trigger each time.
Task name
1Evaluators to attach (at least one required). Evaluators use one of two
mutually exclusive shapes by data granularity. Span evaluators use
query_filter + per-evaluator column_mappings/query_filter.
Trace/session evaluators use task-level query_filters plus
per-evaluator query_mappings. Mixing the two shapes returns 400. The
granularity must match the chosen shape (enforced server-side).
1An evaluator attachment supplied when creating or updating a task. At least
one entry is required on evaluation-task requests. Evaluators carry one of
two mutually exclusive shapes: span evaluators use query_filter +
column_mappings; trace/session evaluators use query_mappings.
- Option 1
- Option 2
Task type discriminator. Must be "TEMPLATE_EVALUATION".
TEMPLATE_EVALUATION Project 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 (span shape).
Mutually exclusive with query_filters.
Named query filters plus optional expression for trace/session
evaluators. Mutually exclusive with query_filter.
Response
Returns a single task object
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, evaluator, or agent
settings for each triggered run.
Evaluation tasks (TEMPLATE_EVALUATION and CODE_EVALUATION) use one of
two mutually exclusive query-filter shapes depending on the granularity of
the data each evaluator processes:
- Span shape —
query_filter(task-level) plus per-evaluatorcolumn_mappings/query_filter. For tasks where each evaluated unit is a single span.query_filtersis null. - Trace/session shape —
query_filters(namedfiltersplus optionalexpression) at the task level, and per-evaluatorquery_mappings. For tasks where each evaluated unit is a complete trace or session.query_filteris null.
All evaluators on a task must use the same shape; mixing shapes returns 400.
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. Span-granularity shape only.
Null when the task uses the trace/session shape (query_filters).
Mutually exclusive with query_filters.
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 <= 1Named query filters plus optional boolean expression for
trace/session-granularity evaluators. Null for span-granularity tasks
(which use query_filter). Mutually exclusive with query_filter.
The run configuration for a RUN_EXPERIMENT task. Present only when
type is RUN_EXPERIMENT. Null for all other task types.
- Option 1
- Option 2
- Option 3