Skip to content

Routing (Template) ​

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

OperationMethodSummary
getTemplateGridPolicyRoutingGETGet site template's policy routing list
createTemplatePolicyRoutingPOSTCreate site template's policy routing
deleteTemplatePolicyRoutingDELETEDelete site template's policy routing
modifyTemplatePolicyRoutingPUTModify site template's policy routing
modifyTemplatePolicyRoutingIndexPOSTModify site template's policy routing Index
getTemplateGridStaticRoutingGETGet site template's static routing list
createTemplateStaticRoutingPOSTCreate site template's static routing
deleteTemplateStaticRoutingDELETEDelete site template's static routing
modifyTemplateStaticRoutingPUTModify site template's static routing

getTemplateGridPolicyRouting ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/policy-routings

Get site template's policy routing list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
json
// omada_call_operation
{
  "operationId": "getTemplateGridPolicyRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  }
}
Details, permissions and error codes

Get site template's policy routing list.
The interface requires one of the permissions:
Global Site Template Manager View Only

createTemplatePolicyRouting ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/policy-routings

Create site template's policy routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template 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": "createTemplatePolicyRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create site template's policy routing.
The interface requires one of the permissions:
Global Site Template 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.
-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.

deleteTemplatePolicyRouting ​

DELETE /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/policy-routings/{policyRoutingId}

Delete site template's policy routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
policyRoutingIdpathstringyesPolicy routing ID
json
// omada_call_operation
{
  "operationId": "deleteTemplatePolicyRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "policyRoutingId": "<policyRoutingId>"
  }
}
Details, permissions and error codes

Delete site template's policy routing.
The interface requires one of the permissions:
Global Site Template Manager Modify

modifyTemplatePolicyRouting ​

PUT /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/policy-routings/{policyRoutingId}

Modify site template's policy routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
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": "modifyTemplatePolicyRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "policyRoutingId": "<policyRoutingId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify site template's policy routing.
The interface requires one of the permissions:
Global Site Template 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.
-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.

modifyTemplatePolicyRoutingIndex ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/policy-routings/modifyIndex

Modify site template's policy routing Index

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID

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": "modifyTemplatePolicyRoutingIndex",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify site template's policy routing Index.
The interface requires one of the permissions:
Global Site Template Manager Modify

getTemplateGridStaticRouting ​

GET /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/static-routings

Get site template's static routing list

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
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": "getTemplateGridStaticRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  }
}
Details, permissions and error codes

Get site template static routing list.
The interface requires one of the permissions:
Global Site Template Manager View Only

createTemplateStaticRouting ​

POST /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/static-routings

Create site template's static routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID

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

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 template' interface, and LAN Network ID can be obtained from 'Get LAN network list template' interface.
metricintegeryesMetric should be within the range of 0–15.
json
// omada_call_operation
{
  "operationId": "createTemplateStaticRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create site template static routing.
The interface requires one of the permissions:
Global Site Template 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.
-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.

deleteTemplateStaticRouting ​

DELETE /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/static-routings/{staticRoutingId}

Delete site template's static routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
staticRoutingIdpathstringyesStatic routing ID
json
// omada_call_operation
{
  "operationId": "deleteTemplateStaticRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "staticRoutingId": "<staticRoutingId>"
  }
}
Details, permissions and error codes

Delete site template's static routing.
The interface requires one of the permissions:
Global Site Template Manager Modify

modifyTemplateStaticRouting ​

PUT /openapi/v1/{omadacId}/sitetemplates/{siteTemplateId}/routing/static-routings/{staticRoutingId}

Modify site template's static routing

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteTemplateIdpathstringyesSite Template ID
staticRoutingIdpathstringyesStatic routing ID

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

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 template' interface, and LAN Network ID can be obtained from 'Get LAN network list template' interface.
metricintegeryesMetric should be within the range of 0–15.
json
// omada_call_operation
{
  "operationId": "modifyTemplateStaticRouting",
  "params": {
    "siteTemplateId": "<siteTemplateId>",
    "staticRoutingId": "<staticRoutingId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify site template's static routing.
The interface requires one of the permissions:
Global Site Template 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.
-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.

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