Skip to content

Routing ​

10 operations. Call any of them with omada_call_operation (or, in full tool mode, as a tool named by its operationId).

OperationMethodSummary
getGridPolicyRoutingGETGet policy routing list
createPolicyRoutingPOSTCreate new policy routing
deletePolicyRoutingDELETEDelete policy routing
modifyPolicyRoutingPUTModify policy routing
modifyPolicyRoutingIndexPOSTModify policy routing Index
getGridStaticRouting_1GETGet static routing list
createStaticRouting_1POSTCreate new static routing
deleteStaticRouting_1DELETEDelete static routing
modifyStaticRouting_1PUTModify static routing
getStaticRoutingInterfaceListGETGet static routing interface list

getGridPolicyRouting ​

GET /openapi/v1/{omadacId}/sites/{siteId}/routing/policy-routings

Get policy routing list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
pagequeryintegernoStart page number. Start from 1. (default 1)
pageSizequeryintegernoNumber of entries per page. It should be within the range of 1–1000. (default 100)
json
// omada_call_operation
{
  "operationId": "getGridPolicyRouting",
  "params": {
    "siteId": "<siteId>"
  }
}
Details, permissions and error codes

Get policy routing list.
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
Site Device Manager View Only

createPolicyRouting ​

POST /openapi/v1/{omadacId}/sites/{siteId}/routing/policy-routings

Create new policy routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)

Request body — application/json (required) — schema PolicyRoutingConfig

FieldTypeRequiredDescription
namestringyesName, name should contain 1 to 64 characters.
statusbooleanyesStatus
protocolsarray<integer>yesFor the values of protocols, refer to section 5.5.2 of the Open API Access Guide.
interfaceTypeintegernoInterfaceType should be a value as follows: 0: WAN; 2: L2TP; 3: PPTP; 4: multi-select WAN or VPN or virtual WAN.
interfaceIdstringnoInterface ID
wanPortIdsarray<string>noWAN port list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
vpnIdsarray<string>noVPN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
virtualWanIdsarray<string>noVirtual WAN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
backupInterfacebooleanyesUse the other WAN port if the current one is down
sourceTypeintegeryesSourceType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group
sourceIdsarray<string>yesSource IDs, which depends on sourceType, for example: if sourceType is network, sourceIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
destinationTypeintegeryesDestinationType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group
destinationIdsarray<string>yesDestination IDs, which depends on destinationType, for example: if destinationType is network, destinationIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
json
// omada_call_operation
{
  "operationId": "createPolicyRouting",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create new policy routing.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33006 - This name already exists in this site.
-33474 - This feature is not supported for the DS-Lite or Map-E WAN connection types.
-33600 - Invalid Source Type.
-33601 - Invalid Destination Type.
-33603 - Source or Destination entry does not exist.
-33608 - Invalid protocols.
-34204 - The number of Policy Routing entries has reached the limit.
-34267 - Only one WAN interface can be configured for Policy Routing.
-34268 - Unable to select a virtual WAN as the WAN interface for Policy Routing.
-34269 - Unable to select Location Group as the Destination for Policy Routing.
-34270 - Unable to select Domain Group as the Destination for Policy Routing.
-34602 - This VPN policy does not exist.

deletePolicyRouting ​

DELETE /openapi/v1/{omadacId}/sites/{siteId}/routing/policy-routings/{policyRoutingId}

Delete policy routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
policyRoutingIdpathstringyesPolicy routing ID
json
// omada_call_operation
{
  "operationId": "deletePolicyRouting",
  "params": {
    "siteId": "<siteId>",
    "policyRoutingId": "<policyRoutingId>"
  }
}
Details, permissions and error codes

Delete policy routing.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

modifyPolicyRouting ​

PUT /openapi/v1/{omadacId}/sites/{siteId}/routing/policy-routings/{policyRoutingId}

Modify policy routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
policyRoutingIdpathstringyesPolicy routing ID

Request body — application/json (required) — schema PolicyRoutingConfig

FieldTypeRequiredDescription
namestringyesName, name should contain 1 to 64 characters.
statusbooleanyesStatus
protocolsarray<integer>yesFor the values of protocols, refer to section 5.5.2 of the Open API Access Guide.
interfaceTypeintegernoInterfaceType should be a value as follows: 0: WAN; 2: L2TP; 3: PPTP; 4: multi-select WAN or VPN or virtual WAN.
interfaceIdstringnoInterface ID
wanPortIdsarray<string>noWAN port list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
vpnIdsarray<string>noVPN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
virtualWanIdsarray<string>noVirtual WAN list. When interfaceType is 4, at least one of the wanPortIds or vpnIds or virtualWanIds is not empty.
backupInterfacebooleanyesUse the other WAN port if the current one is down
sourceTypeintegeryesSourceType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group
sourceIdsarray<string>yesSource IDs, which depends on sourceType, for example: if sourceType is network, sourceIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
destinationTypeintegeryesDestinationType should be a value as follows: 0: Network; 1: IP Group; 2: IP port Group
destinationIdsarray<string>yesDestination IDs, which depends on destinationType, for example: if destinationType is network, destinationIds should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
json
// omada_call_operation
{
  "operationId": "modifyPolicyRouting",
  "params": {
    "siteId": "<siteId>",
    "policyRoutingId": "<policyRoutingId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify policy routing.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33006 - This name already exists in this site.
-33474 - This feature is not supported for the DS-Lite or Map-E WAN connection types.
-33600 - Invalid Source Type.
-33601 - Invalid Destination Type.
-33603 - Source or Destination entry does not exist.
-33608 - Invalid protocols.
-34267 - Only one WAN interface can be configured for Policy Routing.
-34268 - Unable to select a virtual WAN as the WAN interface for Policy Routing.
-34269 - Unable to select Location Group as the Destination for Policy Routing.
-34270 - Unable to select Domain Group as the Destination for Policy Routing.
-34602 - This VPN policy does not exist.

modifyPolicyRoutingIndex ​

POST /openapi/v1/{omadacId}/sites/{siteId}/routing/policy-routings/modifyIndex

Modify policy routing Index

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)

Request body — application/json (required) — schema PolicyRoutingDragSortIndexOpenApiVO

FieldTypeRequiredDescription
indexesobjectyesThe order in which items take effect, this object is a Map, the key is item ID and the value is the index you want to set.
json
// omada_call_operation
{
  "operationId": "modifyPolicyRoutingIndex",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify policy routing Index.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

getGridStaticRouting_1 ​

GET /openapi/v1/{omadacId}/sites/{siteId}/routing/static-routings

Get static routing list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
pagequeryintegernoStart page number. Start from 1. (default 1)
pageSizequeryintegernoNumber of entries per page. It should be within the range of 1–1000. (default 100)
json
// omada_call_operation
{
  "operationId": "getGridStaticRouting_1",
  "params": {
    "siteId": "<siteId>"
  }
}
Details, permissions and error codes

Get static routing list.
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
Site Device Manager View Only

createStaticRouting_1 ​

POST /openapi/v1/{omadacId}/sites/{siteId}/routing/static-routings

Create new static routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)

Request body — application/json (required) — schema StaticRoutingConfig

FieldTypeRequiredDescription
namestringyesName, name should contain 1 to 64 characters.
statusbooleanyesStatus
destinationsarray<string>yesIP address/SubNet
routeTypeintegeryesRouteType should be a value as follows: 0: NextHop; 1: Interface
nextHopIpstringnoOnly for routeType:0 or routeType:1 and selected WAN is Static IP/Dynamic IP mode
interfaceTypeintegernoOnly for routeType:1, interfaceType should be a value as follows: 0: Internet(WAN); 1: Network(LAN); 2: L2TP, 3: PPTP, 5: Virtual WAN.
interfaceIdstringnoInterface ID, for example: if interfaceType is network, interfaceId should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
metricintegeryesMetric should be within the range of 0–15.
json
// omada_call_operation
{
  "operationId": "createStaticRouting_1",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create new static routing.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33006 - This name already exists in this site.
-33474 - This feature is not supported for the DS-Lite or Map-E WAN connection types.
-33503 - This network does not exist.
-34203 - The number of Static Route entries has reached the limit.
-34256 - The interface or next hop is duplicate and there are duplicate items in the destination.
-34257 - The Gateway does not support select VPN Client in Static Routing
-34258 - The Gateway does not support select Virtual WAN in Static Routing
-34602 - This VPN policy does not exist.

deleteStaticRouting_1 ​

DELETE /openapi/v1/{omadacId}/sites/{siteId}/routing/static-routings/{staticRoutingId}

Delete static routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
staticRoutingIdpathstringyesStatic routing ID
json
// omada_call_operation
{
  "operationId": "deleteStaticRouting_1",
  "params": {
    "siteId": "<siteId>",
    "staticRoutingId": "<staticRoutingId>"
  }
}
Details, permissions and error codes

Delete static routing.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify

modifyStaticRouting_1 ​

PUT /openapi/v1/{omadacId}/sites/{siteId}/routing/static-routings/{staticRoutingId}

Modify static routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
staticRoutingIdpathstringyesStatic routing ID

Request body — application/json (required) — schema StaticRoutingConfig

FieldTypeRequiredDescription
namestringyesName, name should contain 1 to 64 characters.
statusbooleanyesStatus
destinationsarray<string>yesIP address/SubNet
routeTypeintegeryesRouteType should be a value as follows: 0: NextHop; 1: Interface
nextHopIpstringnoOnly for routeType:0 or routeType:1 and selected WAN is Static IP/Dynamic IP mode
interfaceTypeintegernoOnly for routeType:1, interfaceType should be a value as follows: 0: Internet(WAN); 1: Network(LAN); 2: L2TP, 3: PPTP, 5: Virtual WAN.
interfaceIdstringnoInterface ID, for example: if interfaceType is network, interfaceId should be LAN network ID. LAN Network can be created using 'Create LAN network' interface, and LAN Network ID can be obtained from 'Get LAN network list' interface.
metricintegeryesMetric should be within the range of 0–15.
json
// omada_call_operation
{
  "operationId": "modifyStaticRouting_1",
  "params": {
    "siteId": "<siteId>",
    "staticRoutingId": "<staticRoutingId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify static routing.
The interface requires one of the permissions:
Site Settings Manager Modify
Network Config Page Modify
Site Device Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33006 - This name already exists in this site.
-33474 - This feature is not supported for the DS-Lite or Map-E WAN connection types.
-33503 - This network does not exist.
-34256 - The interface or next hop is duplicate and there are duplicate items in the destination.
-34257 - The Gateway does not support select VPN Client in Static Routing
-34258 - The Gateway does not support select Virtual WAN in Static Routing
-34602 - This VPN policy does not exist.

getStaticRoutingInterfaceList ​

GET /openapi/v1/{omadacId}/sites/{siteId}/routing/static-routings/interfaces

Get static routing interface list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
json
// omada_call_operation
{
  "operationId": "getStaticRoutingInterfaceList",
  "params": {
    "siteId": "<siteId>"
  }
}
Details, permissions and error codes

Get static routing interface list.
The interface requires one of the permissions:
Site Settings Manager View Only
Network Config Page View Only
Site Device Manager View Only

Released under the MIT License. Not affiliated with or endorsed by TP-Link.