All error codes

invalid_router_rule

HTTP 422 Router rule was rejected

What happened

The router rule or port forward passed the body check but was rejected on its content: a port given without the tcp, udp or tcp_udp protocol, an address or prefix out of range (an octet above 255 such as 300.1.1.1, a prefix above /32), a port outside 1-65535 or a reversed range such as 2000-1000, or a target whose octets are out of range. Fields of the wrong form never get this far: an unknown action or protocol, a description over 120 characters or with control characters, and a value that does not look like an address or a port at all are refused earlier as invalid_request naming the field.

What to do

Fix the offending field and send the request again with a new idempotency key; the response does not always name it, so check the fields listed above. Ports are numbers, comma-separated lists or dash ranges such as 10000-20000; addresses are IPv4 or IPv4/prefix.

Retrying

Fix the request and send it again.

How it arrives

{
    "type": "https://docs.fiberax.com/errors/invalid_router_rule",
    "title": "Router rule was rejected",
    "status": 422,
    "code": "invalid_router_rule",
    "request_id": "a277dcd1ca652c65"
}

Branch your code on code, never on the wording of title.