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_id
Phone number to attach this rule to
match_type
Allowed values:
target_agent_id
Agent ID to route matching calls to
priority
Rule priority (lower = evaluated first)
match_value
Keyword or regex pattern. Required for keyword and regex match types.
Response
Routing rule created
id
Routing rule ID
workspace_id
number_id
Phone number this rule applies to
priority
Rule evaluation order (lowest number = highest priority)
match_type
How to match the caller's first utterance. 'default' matches all unmatched calls.
match_value
Keyword or regex pattern to match against. Null for ‘default’ match_type.
target_agent_id
Agent to route matching calls to
created_at
Errors
400
Create Routing Rule Request Bad Request Error
401
Create Routing Rule Request Unauthorized Error