Skip to main content
POST
Create Rule

Authorizations

Authorization
string
header
required

Use Tuner API key (tr_api_...) or user session token. Find your API key in Workspace Settings > API Keys.

Path Parameters

agent_id
integer
required

Tuner's internal numeric ID for the agent.

workspace_id
integer
required

Workspace ID. Find this in Workspace > General Settings.

Body

application/json

Schema for creating a rule.

condition_source_type
enum<string>
required

Category of call data the condition tests.

Available options:
eval,
voice_metric,
data_extraction_field,
call_metadata,
latency
condition_source_id
integer
required

ID of the specific eval, metric, or field within condition_source_type, as returned by List Rule Conditions.

Example:

12

operator
enum<string>
required

How to compare. Which operators are valid depends on the source's input_datatype.

Available options:
=,
!=,
>=,
<=,
>,
<,
exists,
not_exists,
contains,
starts_with
Example:

"="

condition_value
any
required

Value to compare against. Its type follows the source's input_datatype — a string, number, or boolean. Ignored for exists and not_exists.

Example:

"FAIL"

output_type
enum<string>
required

Whether a matching call gets a label or a red flag.

Available options:
label,
red_flag
output_tag_name
string
required

Tag applied to matching calls. Appears on the call record and as a value in the labels_and_redflags filter on List Calls.

Required string length: 1 - 200
Example:

"Missed disclosure"

output_description
string | null

Optional note explaining what this rule is for.

Response

Successful Response

Response schema for a rule.

id
integer
required

Tuner's ID for this rule.

condition_source_type
string
required

Category of call data the condition tests.

condition_source_id
integer
required

ID of the eval, metric, or field the condition tests.

operator
string
required

How the value is compared.

condition_value
any
required

Value the condition compares against.

output_type
string
required

Whether matching calls get a label or a red flag.

output_tag_name
string
required

Tag applied to matching calls.

created_at
string<date-time>
required

When the rule was created.

updated_at
string<date-time>
required

When the rule was last updated.

condition_source_name
string | null

Display name of the referenced eval, metric, or field.

output_description
string | null

Note explaining what this rule is for.