POST/api/networks/{networkId}/routers

Create a network router

Creates a router in the specified network. Provide metric, masquerade, and enabled; the metric must be between 1 and 9999. Set either peer or peer_groups to associate the router with peers, but not both.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 5 body fields
networkIdstringrequired
The unique identifier of the network in which to create the router.

Router configuration. metric, masquerade, and enabled are required.

enabledbooleanrequired
Network router status
masqueradebooleanrequired
Indicate if peer should masquerade traffic to this route's prefix
metricintegerrequired
Route metric number. Lowest number has higher priority
peerstringoptional
Peer Identifier associated with route. This property can not be set together with `peer_groups`
peer_groupsarray<string>optional
Peers Group Identifier associated with route. This property can not be set together with `peer`

5 status codes
200Returns the created router object, including its identifier, metric, masquerade and enabled settings, and any associated peer or peer groups.
idstringrequired
Network Router Id
enabledbooleanrequired
Network router status
masqueradebooleanrequired
Indicate if peer should masquerade traffic to this route's prefix
metricintegerrequired
Route metric number. Lowest number has higher priority
peerstringoptional
Peer Identifier associated with route. This property can not be set together with `peer_groups`
peer_groupsarray<string>optional
Peers Group Identifier associated with route. This property can not be set together with `peer`
400Returned when the request is invalid, including when required fields are missing, `metric` is outside the allowed range, or both `peer` and `peer_groups` are set.
401Returned when the request lacks valid authentication.
403Returned when the authenticated user is not permitted to create a router in the network.
500Returned when an internal server error occurs.

Error handling

A 400 indicates an invalid request; a 401 indicates missing or invalid authentication; a 403 indicates insufficient permission; and a 500 indicates an internal server error. The networkId path parameter must identify the network. The body must include metric, masquerade, and enabled; metric must be from 1 to 9999, and peer and peer_groups cannot both be set.