Create a routing rule

Create a rule that routes inbound calls on a phone number to a specific agent based on keyword or regex matching. Rules are evaluated in priority order (lowest number first). A ‘default’ rule catches all unmatched calls.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
number_idstringRequired
Phone number to attach this rule to
match_typeenumRequired
Allowed values:
target_agent_idstringRequired
Agent ID to route matching calls to
priorityintegerOptionalDefaults to 0

Rule priority (lower = evaluated first)

match_valuestringOptional
Keyword or regex pattern. Required for keyword and regex match types.

Response

Routing rule created
idstringOptional
Routing rule ID
workspace_idstringOptional
number_idstringOptional
Phone number this rule applies to
priorityintegerOptionalDefaults to 0

Rule evaluation order (lowest number = highest priority)

match_typeenumOptional
How to match the caller's first utterance. 'default' matches all unmatched calls.
match_valuestringOptional

Keyword or regex pattern to match against. Null for ‘default’ match_type.

target_agent_idstringOptional
Agent to route matching calls to
created_atdatetimeOptional

Errors

400
Create Routing Rule Request Bad Request Error
401
Create Routing Rule Request Unauthorized Error