Update Routing Rule Set

API Details

Replaces the whole routing rule set of the type with the body and creates a new version: every field must be sent in full. Omitting defaultQueueId clears the default queue, and omitting reservationTimeout keeps the current one. An agent step without a queueId uses the queue of the previous agent step, and the first agent step of every routing rule needs one.

Rate Limit

Limit TypeValue
Requests per second10

If you exceed this limit, you will receive a 429 Rate Limit Exceeded response.

Path Params
string
enum
required

Type of the routing rule set to update.

Body Params

Request body for a full-overwrite update of an existing routing rule set. All fields must be provided.

integer
≤ 86400

Default reservation timeout in seconds, from 1 to 86400.

uuid

Id of the fallback queue used when no routing rule matches.

routingRules
array of objects
required
length ≥ 1

Ordered list of routing rules, evaluated top-to-bottom; the first routing rule whose taskExpression matches wins. At least one routing rule is required.

routingRules*
string
required
length ≤ 175

Display name of this routing rule. It cannot be blank and can have at most 175 characters. Use a different name for each routing rule.

string
length ≤ 2998

Twilio TaskRouter task-matching expression for this routing rule. It is evaluated against the task, so its attributes are written without a prefix, for example campaignInfo.tier == 'vip'. Omit/empty to match any task. It can have at most 2998 characters, and it cannot be only spaces.

agentSteps
array of objects
required
length ≥ 1

Ordered list of agent steps for tasks matching this routing rule.

agentSteps*
uuid

Id of the queue this agent step routes to (same id used by the public Queues API). Omit it to use the queue of the previous agent step; the first agent step of a routing rule must have one.

integer

Task priority assigned at this agent step.

integer
≥ 0

Seconds to wait at this agent step before moving to the next one.

object
required

Which worker(s) are eligible for this agent step. Does not include hidden/system expressions the platform injects automatically.

string
length ≤ 1900

Twilio TaskRouter skip expression. When no matching agent can be offered the task immediately and it evaluates to true, this agent step is skipped. It only supports the number of agents in the queue of this agent step by activity: workers.available, workers.unavailable or workers.<ActivitySid> (the sid of an activity, such as WA...), compared with numbers and joined with AND or OR, or 1 == 1 to always skip. Task and agent attributes (task.x, worker.x) are not supported here and are rejected. Examples: workers.available == 0, 1 == 1. Omit to never skip. It can have at most 1900 characters.

boolean

Whether the agent can receive a call while on another call. Only applies to the Inbound Call, Transfer and Outbound Call types. For Outbound Call, only use it for preview dial tasks or tasks routed to AI agents.

Responses

400

Invalid type or body, a queue id the brand does not have, or routing rules that are not valid for the task type.

403

The user is not a brand admin.

404

The brand has no routing rule set of that type.

429

Exceeded rate limit.

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json