Skip to main content

Reorder Routing Rules

Reorder routing rules by providing an ordered array of rule IDs. Priority values are reassigned sequentially based on the new order.

Reassign priority values for all routing rules at once. Pass an ordered array of rule IDs — the first ID receives priority 1, the second receives priority 2, and so on. This is the recommended way to change evaluation order after initial creation.

Use this endpoint when you need to rearrange the evaluation order of multiple rules at once — for example, when promoting a new rule to the top of the chain or inserting a rule between two existing ones. This is more reliable than patching individual rule priorities, which can create gaps or collisions.

The response returns a reordered array with each rule's id and new priority value. Priority 1 is evaluated first. The reorder takes effect immediately — the next document_classified event uses the new priority sequence.

List all rules first via GET /v1/routing-rules to get the current IDs and order, then construct the reordered array. Include both active and inactive rules in the array to maintain a consistent priority sequence. Omitting any rule ID results in a validation error.

All active rule IDs must be included in the rule_ids array. Omitting any rule returns a validation error. Inactive rules should also be included to maintain a consistent priority sequence.
POST/v1/routing-rules/reorder

Response

Response fields

reorderedarrayArray of rules with their updated priority values.
reordered[].idstringRouting rule UUID.
reordered[].priorityintegerNew priority assigned to this rule.

Response

{
  "reordered": [
    { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012", "priority": 1 },
    { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "priority": 2 },
    { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "priority": 3 }
  ]
}

Errors

Error responses

401unauthorizedMissing or invalid API key.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.