Skip to content

Local User ​

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

OperationMethodSummary
downloadLocalUsersGETDownload local user file (excel or csv) by localhost
uploadLocalUsersPOSTUpload local user file (excel or csv) by localhost
getLocalUsersGETGet local user list
createLocalUserPOSTCreate a new local user
deleteLocalUserDELETEDelete an existing localuser
getLocalUserGETGet a local user for given localuserId
modifyLocalUserPOSTModify an existing localuser
clearLocalUserDynamicMacPOSTClear dynamic mac
deleteSelectedLocalUsersPOSTBatch delete local users

downloadLocalUsers ​

GET /openapi/v1/{omadacId}/sites/{siteId}/files/hotspot/local-users

Download local user file (excel or csv) by localhost

ParameterInTypeRequiredDescription
omadacIdpathstringautoOmada ID (filled in automatically)
siteIdpathstringyesSite ID (site ID or site name)
portalsquerystringyesPortal ids of the portals to download local user file from.
searchKeyquerystringnoFuzzy query parameters, support field name,username
fileTypequerystringyesLocal user file format: csv or xlsx.
json
// omada_call_operation
{
  "operationId": "downloadLocalUsers",
  "params": {
    "siteId": "<siteId>",
    "portals": "<portals>",
    "fileType": "<fileType>"
  }
}
Details, permissions and error codes

Download local user file (excel or csv) by localhost.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1 - Something went wrong. Please try again later or contact our technical support.
-1001 - Invalid request parameters.
-33000 - This site does not exist.

uploadLocalUsers ​

POST /openapi/v1/{omadacId}/sites/{siteId}/files/hotspot/local-users

Upload local user file (excel or csv) by localhost

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

Request body — application/json (optional)

FieldTypeRequiredDescription
configHotspotPortalsOpenApiVOyesBound portal ID list,need to specify Content-Type of this form part as application/json.
filestring (binary)yes
json
// omada_call_operation
{
  "operationId": "uploadLocalUsers",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Upload local user file (excel or csv) by localhost.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1 - Something went wrong. Please try again later or contact our technical support.
-1001 - Invalid request parameters.
-1005 - Operation forbidden.
-1200 - You have been logged out of the controller. This may have been caused by web application switching, data restore, reboot, session timeout or disabled cloud access. Please try to log in again later.
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-33712 - This file is empty.
-42037 - Please select at least one portal before creating local users.
-7131 - Controller ID not exist.

getLocalUsers ​

GET /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers

Get local user 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)
sorts.namequerystringnoSort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect
searchKeyquerystringnoFuzzy query parameters, support field user_name
json
// omada_call_operation
{
  "operationId": "getLocalUsers",
  "params": {
    "siteId": "<siteId>"
  }
}
Details, permissions and error codes

Get local user list in a site with the given omadacId, siteId, params.
The interface requires one of the permissions:
Site Hotspot Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.

createLocalUser ​

POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers

Create a new local user

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

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

FieldTypeRequiredDescription
userNamestringyesUser name should contain 1 to 128 ASCII visible characters, with no spaces at the beginning and end, and spaces in the middle, cannot be changed after creation.
passwordstringyesPassword should contain 1 to 128 characters.
enablebooleanyesWhether to enable.
expirationTimeintegeryesExpiration timestamp. Unit:ms.
bindingTypeintegeryesMAC binding type should be a value as follows: 0: no binding; 1: static binding; 2: dynamic binding.
macAddressstringnoMac address,the value is only available when the macType is static binding or dynamic binding.
maxUsersintegernoThe maximum number of users online at the same time when the MAC binding type is No Binding. It cannot be modified after initialization. MaxUsers should be within the range of 1–2048.
namestringnoName should contain 1 to 128 characters, with no spaces at the beginning and end, and spaces in the middle
phonestringnoPhone number should contain 1 to 20 characters.
rateLimitRateLimitOpenApiVOyes(RateLimitOpenApiVO not expanded; call omada_get_schema "RateLimitOpenApiVO")
trafficLimitEnablebooleanyesWhether to enable traffic limit.
trafficLimitintegernoTraffic limit in MB. It should be within the range of 1–10485760.
trafficLimitFrequencyintegernoFrequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly.
portalsarray<string>yesBound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface
logoutbooleannolocal user logout. enable local user logout
applyToAllPortalsbooleannoIs the localuser effective for all portals, including all newly created portals
dailyLimitEnablebooleannoWhether to enable localuser daily time limit
dailyLimitDailyAuthTimeOpenApiVOno(DailyAuthTimeOpenApiVO not expanded; call omada_get_schema "DailyAuthTimeOpenApiVO")
json
// omada_call_operation
{
  "operationId": "createLocalUser",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Create a local user with the given params.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-42012 - The number of local users has reached the limit. New local users cannot be created.
-42013 - Local user already exists.
-42020 - The MAC address that is bound to the local user account is invalid.
-42037 - Please select at least one portal before creating local users.
-42039 - Failed to bind to the portals. Please select the portals with local user authentication enabled.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.

deleteLocalUser ​

DELETE /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}

Delete an existing localuser

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

Delete an existing local user with the given omadacId, siteId, localuserId.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.

getLocalUser ​

GET /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}

Get a local user for given localuserId

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

Get a local user with the given omadacId, siteId, local user ID.
The interface requires one of the permissions:
Site Hotspot Manager View Only
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.

modifyLocalUser ​

POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}

Modify an existing localuser

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

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

FieldTypeRequiredDescription
passwordstringyesPassword should contain 1 to 128 characters.
enablebooleanyesWhether to enable.
expirationTimeintegeryesExpiration timestamp. Unit:ms.
bindingTypeintegeryesMAC binding type should be a value as follows: 0: no binding; 1: static binding; 2: dynamic binding.
macAddressstringnoMac address,the value is only available when the macType is static binding or dynamic binding.
maxUsersintegernoThe maximum number of users online at the same time when the MAC binding type is No Binding. It cannot be modified after initialization. MaxUsers should be within the range of 1–2048.
namestringnoName should contain 1 to 128 characters, with no spaces at the beginning and end, and spaces in the middle
phonestringnoPhone number should contain 1 to 20 characters.
rateLimitRateLimitOpenApiVOyes(RateLimitOpenApiVO not expanded; call omada_get_schema "RateLimitOpenApiVO")
trafficLimitEnablebooleanyesWhether to enable traffic limit.
trafficLimitintegernoTraffic limit in MB. It should be within the range of 1–10485760.
trafficLimitFrequencyintegernoFrequency of traffic limit should be a value as follows: 0: total; 1: daily; 2: weekly; 3: monthly.
portalsarray<string>yesBound portal ID list. Portal can be created using 'Add portal' interface, and portal ID can be obtained from 'Get portal list in a site' interface
logoutbooleannolocal user logout. enable local user logout
applyToAllPortalsbooleannoIs the localuser effective for all portals, including all newly created portals
json
// omada_call_operation
{
  "operationId": "modifyLocalUser",
  "params": {
    "siteId": "<siteId>",
    "id": "<id>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify an existing local user with the given omadacId, siteId, localuserId.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-42013 - Local user already exists.
-42020 - The MAC address that is bound to the local user account is invalid.
-42037 - Please select at least one portal before creating local users.
-42039 - Failed to bind to the portals. Please select the portals with local user authentication enabled.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.

clearLocalUserDynamicMac ​

POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id}/clear-dynamic-mac

Clear dynamic mac

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

Clear dynamic mac with the given omadacId, siteId, localuserId. The mac address binding type should be dynamic binding.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.

deleteSelectedLocalUsers ​

POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/batch/delete

Batch delete local users

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

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

FieldTypeRequiredDescription
typeintegeryesSelect type. It should be a value as follows: 0: Represents selecting all localUsers, this selection does not pass parameter [ids]. 1: Parameter [ids] includes the IDs of the localUsers to be selected. 2: Parameter [ids] includes the IDs of the localUsers not to be selected
idsarray<string>noIDs of localUsers to be deleted in batch operation
json
// omada_call_operation
{
  "operationId": "deleteSelectedLocalUsers",
  "params": {
    "siteId": "<siteId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Delete multiple local users by operation type and the selected IDs.
The interface requires one of the permissions:
Site Hotspot Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-1001 - Invalid request parameters.
-33000 - This site does not exist.
-33004 - Operation failed because other operations (site copying, restoring, template synchronizing, etc.) are being performed on this site. Please wait and try again later.
-44111 - The Grant Type is Invalid.
-44112 - The access token has expired. Please re-initiate the refreshToken process to obtain the access token.

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