Trigger a task run
Triggers a new run on an existing task. The run is queued and processed
asynchronously. Poll GET /v2/task-runs/{run_id} until the run reaches a
terminal status (completed, failed, or cancelled).
Payload Requirements
- Fields must match the task’s type; sending inapplicable fields returns 400.
- For
template_evaluation/code_evaluationtasks, all trigger fields are optional — an empty body uses server defaults. - For
run_experimenttasks,experiment_nameis required.
For run_experiment tasks
Supply experiment_name (required) plus any of the optional per-run fields:
dataset_version_id, example_ids (exclusive with max_examples),
max_examples, tracing_metadata, evaluation_task_ids.
The fields data_start_time, data_end_time, max_spans,
override_evaluations, and experiment_ids are not applicable and will
return 400 if supplied.
The response includes experiment_id once the experiment is provisioned.
For template_evaluation / code_evaluation tasks
Supply data_start_time, data_end_time, max_spans,
override_evaluations, and/or experiment_ids as needed.
run_experiment-specific fields are not applicable for these task types.
Valid example (trigger a run_experiment run)
{
"experiment_name": "GPT-4o Baseline v2",
"max_examples": 50
}
Invalid example (run_experiment trigger missing required experiment_name)
{
"max_examples": 50
}
Authorizations
Most Arize AI endpoints require authentication. For those endpoints that require authentication, include your API key in the request header using the format
Path Parameters
The unique task identifier (base64) A universally unique identifier (base64-encoded opaque string).
"RW50aXR5OjEyMzQ1"
Body
Trigger body for POST /v2/tasks/{task_id}/trigger. The server derives
the task type from the URL's task record and selects the appropriate
schema; the body itself does not carry a task_type field.
| Task type | Schema |
|---|---|
template_evaluation | TriggerEvaluationTaskRunRequest |
code_evaluation | TriggerEvaluationTaskRunRequest |
run_experiment | TriggerRunExperimentTaskRunRequest |
Sending a field that is not valid for the resolved task type returns 400.
For template_evaluation and code_evaluation tasks all trigger fields
are optional — an empty body is valid and uses server defaults.
- Option 1
- Option 2
Trigger request for template_evaluation or code_evaluation tasks.
data_start_time and data_end_time together must span no more than 30 days.
data_start_time must be before data_end_time.
ISO 8601 start of the data window to evaluate. For model-based tasks, defaults to the task's last run time. Required on the first run (when no previous run exists). Not applicable to dataset-based tasks.
ISO 8601 end of the data window to evaluate. For model-based tasks, defaults to now. Not applicable to dataset-based tasks.
Maximum number of spans to process (default 10000).
x >= 1Whether to re-evaluate data that already has evaluation labels
(default false).
Experiment identifiers (base64) to run against. Only for dataset-based
template_evaluation / code_evaluation tasks.
Response
Returns the created task run
A task run is an async job that executes the work defined on a task. Runs are
created by triggering an existing task (POST /v2/tasks/{task_id}/trigger).
For run_experiment tasks, experiment_id is populated after the experiment
is provisioned; poll GET /v2/task-runs/{run_id} until status reaches a
terminal state.
The unique identifier for the task run.
The parent task identifier (base64).
Status of a task run.
- pending - The run has been created but not yet started.
- running - The run is currently in progress.
- completed - The run finished successfully.
- failed - The run encountered an error and stopped.
- cancelled - The run was cancelled before completion.
pending, running, completed, failed, cancelled When the run started processing.
When the run finished processing.
Start of the data window evaluated. Null for run_experiment runs.
End of the data window evaluated. Null for run_experiment runs.
Number of successfully evaluated items.
Number of items that errored during evaluation.
Number of items that were skipped.
When the run was created.
The unique identifier for the user who triggered the run.
Created experiment identifier (base64). Present only for run_experiment
task runs; null for all other task types.