Reorder Routing Rules

POST /v1/endpoints/{uuid}/routing-rules/reorder

Rewrite the priority column for every routing rule under an endpoint based on a client-supplied order of rule uuids. Used by the dashboard's drag-to-reorder UI on the routing-rules tab — the cards record their new order and POST it here in one shot.

Priorities are reassigned in a single transaction (1, 2, 3, …) so two rules can never share the same priority after a reorder. Every uuid resolves under this endpoint only: a rule of another endpoint is a 404, exactly like an unknown one.

Request body

ordered_uuids string[] (uuid) Req
Rule uuids in the desired order. Index 0 becomes priority 1 (highest), index 1 becomes 2, and so on. Rules not in this list keep their current priority but will sort AFTER the listed ones (the next reorder fixes the gap).

Deprecated: ordered_ids (integers) is still accepted until the sunset. Send ordered_uuids; sending both is allowed only when they name the same rules in the same order, otherwise it is a 400 id_uuid_mismatch.

Response (200 OK)

success bool
Always true when the call returns 200.

Errors

400
Empty ordered_uuids (ordered_uuids cannot be empty), malformed body, a malformed uuid (ordered_uuids must be a uuid), ordered_ids and ordered_uuids disagreeing (id_uuid_mismatch), or integer ids after the sunset (integer_id_unsupported).
401
Missing auth.
403
Plan doesn't include the endpoint_routing_rules entitlement.
404
Endpoint not owned by the caller (or doesn't exist), or an ordered_uuids entry isn't one of this endpoint's rules (ordered_uuids not found).
500
Transactional update failed — every priority change is rolled back; original order is preserved.
Request
curl -X POST "https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/routing-rules/reorder" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{ "ordered_uuids": [ "019b962b-971a-77df-97b0-e3905fa06cd4", "019b8b02-732f-7d67-b36a-271ec6e8d5fa", "019b8fb6-15a9-7138-b248-5dfbccf9448f" ] }'
Response — 200 OK
{"success": true}
Was this helpful?
On this page
Reorder Routing Rules
Was this helpful?