Create Rule
Create a rule that labels or red-flags matching calls.
Describe the condition with condition_tree: AND/OR groups of conditions, nested as
deep as you need. Get valid condition sources from List Rule Conditions.
Authorizations
Path Parameters
Body
Schema for creating a rule.
Describe the condition with condition_tree.
The condition a call must match. The root is always a group (AND or OR) of predicates and nested groups, even for a single condition, and every node needs a type (group or predicate). Build each predicate from an item in List Rule Conditions: for an eval, a data extraction field or a voice metric, lhs is the item's name, source its source_type and field_id its id; for a latency percentile, lhs is the item's id (such as "p90_latency"); for Call Outcome, Call Intent, Call Duration, Call Cost, Call Outcome Type and Call Ended Reason, lhs is call_outcome, call_intent, call_duration, call_cost, call_outcome_type or call_ended_reason; for Extra Metadata, lhs is metadata.<key>. op is a word (eq, neq, gt, gte, lt, lte, exists, not_exists, contains, starts_with), not the symbol List Rule Conditions returns. eq, neq, contains and starts_with on text ignore case. exists and not_exists work on any field, even where List Rule Conditions doesn't list them. A field with no value for the call counts as not existing. A field the analysis skipped, such as an eval that didn't run or the intent of a call whose outcome stopped the analysis, matches only not_exists, not even neq. Groups nest at most 10 levels deep, and a tree holds at most 50 conditions.
Response
Successful Response
Response schema for a rule.
The rule's conditions: a group of predicates and nested groups, in the format condition_tree takes when you create or update a rule. For an eval, a voice metric or a data extraction field, lhs is the item's current name. null only for an older rule whose condition could not be converted; it never matches.