Create Rule
Create a rule for an agent.
The condition must reference a valid source — fetch the options from List Rule Conditions rather than hardcoding IDs, since they’re specific to this agent’s evals and metrics.
Matching calls receive the tag named in output_tag_name, which then becomes
available as a filter on List Calls.
Authorizations
Use Tuner API key (tr_api_...) or user session token. Find your API key in Workspace Settings > API Keys.
Path Parameters
Tuner's internal numeric ID for the agent.
Workspace ID. Find this in Workspace > General Settings.
Body
Schema for creating a rule.
Category of call data the condition tests.
eval, voice_metric, data_extraction_field, call_metadata, latency ID of the specific eval, metric, or field within condition_source_type, as returned by List Rule Conditions.
12
How to compare. Which operators are valid depends on the source's input_datatype.
=, !=, >=, <=, >, <, exists, not_exists, contains, starts_with "="
Value to compare against. Its type follows the source's input_datatype — a string, number, or boolean. Ignored for exists and not_exists.
"FAIL"
Whether a matching call gets a label or a red flag.
label, red_flag Tag applied to matching calls. Appears on the call record and as a value in the labels_and_redflags filter on List Calls.
1 - 200"Missed disclosure"
Optional note explaining what this rule is for.
Response
Successful Response
Response schema for a rule.
Tuner's ID for this rule.
Category of call data the condition tests.
ID of the eval, metric, or field the condition tests.
How the value is compared.
Value the condition compares against.
Whether matching calls get a label or a red flag.
Tag applied to matching calls.
When the rule was created.
When the rule was last updated.
Display name of the referenced eval, metric, or field.
Note explaining what this rule is for.