Skip to content

MSP User and Role ​

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

OperationMethodSummary
createCustomerRolePOSTCreate new customer role
deleteCustomerRoleDELETEDelete an existing customer role
modifyCustomerRolePUTModify an existing customer role
getMspAppGridUsersGETGet msp user list for app
getAllCustomerRolesGETGet customer role list in msp
getMFAStatusGETGet the status of the MSP system's Two-Factor Authentication.
modifyMspMFAStatusPOSTModify the status of the MSP system's Two-Factor Authentication.
getAllMspRolesGETGet msp role list
createNewMspRolePOSTCreate new msp role
deleteMspRoleDELETEDelete an existing msp role
getMspRoleGETGet msp role info
modifyMspRolePUTModify an existing msp role
getAvailableMspRolesGETGet available MSP roles for creating new user
getAvailableCustomerRolesGETGet available customer roles for creating new user
getGridUsers_1GETGet msp user list
createNewMspUserPOSTCreate new msp user
deleteMspUserDELETEDelete an existing msp user
getUser_1GETGet msp user info
modifyMspUserPUTModify an existing msp user
modifyMspUserBatchPATCHBatch modify MSP users.
getAllMspCloudUsersExcludeRootGETGet all MSP cloud users exclude owner
getAllMspLocalUsersExcludeRootGETGet all MSP local users exclude owner

createCustomerRole ​

POST /openapi/v1/msp/{mspId}/account/customer-roles

Create new customer role

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)

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

FieldTypeRequiredDescription
namestringyesRole name should contain 1 to 128 ASCII characters.
typeintegernoRole Type should be a value as follows: 0: standard; 1: customer; 2: msp.
defaultRolebooleannoWhether role is default role.
sourceintegernoRole created resource. It should be a value as follows: 0: default; 1:create by standard controller or customer controller; 2: create by MSP
privilegeRoleVOno(RoleVO not expanded; call omada_get_schema "RoleVO")
hasAllPrivilegebooleannoWhether role has all site privilege.
ownerbooleannoWhether role is owner.
json
// omada_call_operation
{
  "operationId": "createCustomerRole",
  "body": "{...}"
}
Details, permissions and error codes

Create new customer role
The interface requires one of the permissions:
MSP Roles Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30156 - This role already exists.
-30158 - An error occurred while creating the role.
-30161 - The number of roles has reached the limit.

deleteCustomerRole ​

DELETE /openapi/v1/msp/{mspId}/account/customer-roles/{roleId}

Delete an existing customer role

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
roleIdpathstringyesRole ID
json
// omada_call_operation
{
  "operationId": "deleteCustomerRole",
  "params": {
    "roleId": "<roleId>"
  }
}
Details, permissions and error codes

Delete an existing customer role
The interface requires one of the permissions:
MSP Roles Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30102 - This role does not exist.
-30153 - The default role cannot be deleted.
-30154 - An error occurred while deleting the role.
-30155 - The role cannot be deleted since someone has bound to it.
-30173 - The SSO bound role cannot be deleted!

modifyCustomerRole ​

PUT /openapi/v1/msp/{mspId}/account/customer-roles/{roleId}

Modify an existing customer role

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
roleIdpathstringyesRole ID

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

FieldTypeRequiredDescription
namestringyesRole name should contain 1 to 128 ASCII characters.
typeintegernoRole Type should be a value as follows: 0: standard; 1: customer; 2: msp.
defaultRolebooleannoWhether role is default role.
sourceintegernoRole created resource. It should be a value as follows: 0: default; 1:create by standard controller or customer controller; 2: create by MSP
privilegeRoleVOno(RoleVO not expanded; call omada_get_schema "RoleVO")
hasAllPrivilegebooleannoWhether role has all site privilege.
ownerbooleannoWhether role is owner.
json
// omada_call_operation
{
  "operationId": "modifyCustomerRole",
  "params": {
    "roleId": "<roleId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify an existing customer role.
The interface requires one of the permissions:
MSP Roles Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30102 - This role does not exist.
-30156 - This role already exists.
-30157 - An error occurred while modifying the role.
-30159 - The default role cannot be modified.
-30162 - Cannot change the target account. An account with user management permission must have a role permission scope that covers its sub-users.

getMspAppGridUsers ​

GET /openapi/v1/msp/{mspId}/all-users

Get msp user list for app

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
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
sorts.roleIdquerystringnoSort 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
sorts.emailquerystringnoSort 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
sorts.customerRoleIdquerystringnoSort 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 userName
json
// omada_call_operation
{
  "operationId": "getMspAppGridUsers"
}
Details, permissions and error codes

Get msp user list. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
The interface requires one of the permissions:
MSP Users 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):
-44118 - This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.

getAllCustomerRoles ​

GET /openapi/v1/msp/{mspId}/customer-roles

Get customer role list in msp

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
json
// omada_call_operation
{
  "operationId": "getAllCustomerRoles"
}
Details, permissions and error codes

Get customer role list in msp
The interface requires one of the permissions:
MSP Roles Manager View Only

getMFAStatus ​

GET /openapi/v1/msp/{mspId}/mfa/status

Get the status of the MSP system's Two-Factor Authentication.

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
json
// omada_call_operation
{
  "operationId": "getMFAStatus"
}
Details, permissions and error codes

Get the status of the system's Two-Factor Authentication.
The interface requires one of the permissions:
MSP Other Settings View Only

modifyMspMFAStatus ​

POST /openapi/v1/msp/{mspId}/mfa/status

Modify the status of the MSP system's Two-Factor Authentication.

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)

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

FieldTypeRequiredDescription
enablebooleannoWhether to turn on two-factor authentication for your account
json
// omada_call_operation
{
  "operationId": "modifyMspMFAStatus",
  "body": "{...}"
}
Details, permissions and error codes

Modify the status of the system's Two-Factor Authentication.
The interface requires one of the permissions:
MSP Other Settings Modify

getAllMspRoles ​

GET /openapi/v1/msp/{mspId}/roles

Get msp role list

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
json
// omada_call_operation
{
  "operationId": "getAllMspRoles"
}
Details, permissions and error codes

Get msp role list
The interface requires one of the permissions:
MSP Roles Manager View Only

createNewMspRole ​

POST /openapi/v1/msp/{mspId}/roles

Create new msp role

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)

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

FieldTypeRequiredDescription
namestringyesRole name should contain 1 to 128 ASCII characters.
privilegeMspRoleVOyes(MspRoleVO not expanded; call omada_get_schema "MspRoleVO")
json
// omada_call_operation
{
  "operationId": "createNewMspRole",
  "body": "{...}"
}
Details, permissions and error codes

Create new msp role
The interface requires one of the permissions:
MSP Roles Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30156 - This role already exists.
-30158 - An error occurred while creating the role.
-30161 - The number of roles has reached the limit.

deleteMspRole ​

DELETE /openapi/v1/msp/{mspId}/roles/{roleId}

Delete an existing msp role

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
roleIdpathstringyesRole ID
json
// omada_call_operation
{
  "operationId": "deleteMspRole",
  "params": {
    "roleId": "<roleId>"
  }
}
Details, permissions and error codes

Delete an existing msp role
The interface requires one of the permissions:
MSP Roles Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30102 - This role does not exist.
-30153 - The default role cannot be deleted.
-30154 - An error occurred while deleting the role.
-30155 - The role cannot be deleted since someone has bound to it.
-30173 - The SSO bound role cannot be deleted!

getMspRole ​

GET /openapi/v1/msp/{mspId}/roles/{roleId}

Get msp role info

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
roleIdpathstringyesRole ID
json
// omada_call_operation
{
  "operationId": "getMspRole",
  "params": {
    "roleId": "<roleId>"
  }
}
Details, permissions and error codes

Get msp role info
The interface requires one of the permissions:
MSP Roles 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):
-30102 - This role does not exist.

modifyMspRole ​

PUT /openapi/v1/msp/{mspId}/roles/{roleId}

Modify an existing msp role

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
roleIdpathstringyesRole ID

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

FieldTypeRequiredDescription
namestringyesRole name should contain 1 to 128 ASCII characters.
privilegeRoleVOno(RoleVO not expanded; call omada_get_schema "RoleVO")
json
// omada_call_operation
{
  "operationId": "modifyMspRole",
  "params": {
    "roleId": "<roleId>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify an existing msp role.
The interface requires one of the permissions:
MSP Roles Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30102 - This role does not exist.
-30156 - This role already exists.
-30157 - An error occurred while modifying the role.
-30159 - The default role cannot be modified.
-30162 - Cannot change the target account. An account with user management permission must have a role permission scope that covers its sub-users.

getAvailableMspRoles ​

GET /openapi/v1/msp/{mspId}/roles/available

Get available MSP roles for creating new user

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
json
// omada_call_operation
{
  "operationId": "getAvailableMspRoles"
}
Details, permissions and error codes

Get available MSP roles for creating new user.
The interface requires one of the permissions:
MSP Roles Manager View Only

getAvailableCustomerRoles ​

GET /openapi/v1/msp/{mspId}/roles/customer/roles/available

Get available customer roles for creating new user

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
json
// omada_call_operation
{
  "operationId": "getAvailableCustomerRoles"
}
Details, permissions and error codes

Get available customer roles for creating new user.
The interface requires one of the permissions:
Global Roles Manager View Only

getGridUsers_1 ​

GET /openapi/v1/msp/{mspId}/users

Get msp user list

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
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
sorts.roleIdquerystringnoSort 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
sorts.emailquerystringnoSort 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
sorts.customerRoleIdquerystringnoSort 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 userName
json
// omada_call_operation
{
  "operationId": "getGridUsers_1"
}
Details, permissions and error codes

Get msp user list. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
The interface requires one of the permissions:
MSP Users 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):
-44118 - This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.

createNewMspUser ​

POST /openapi/v1/msp/{mspId}/users

Create new msp user

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)

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

FieldTypeRequiredDescription
typeintegeryesType of user should be a value as follows: 0:local user; 1: cloud user
namestringyesUser name. When creating cloud user, you should set TP-LINK ID. It should contain 1 to 128 ASCII visible characters and start with letters, numbers, and underscores.
passwordstringnoPassword of local user should contain 8 to 128 ASCII visible characters.And password must be a combination of uppercase letters, lowercase letters, numbers, and special symbols. Symbols such as ! # $ % & * @ ^ are supported.
emailstringnoEmail of user
roleIdstringyesMsp role ID of user
customerRoleIdstringyesMsp user's customer role ID when visit customer
allCustomerbooleanyesWhether msp user has all customer permission, including new created customer.
customersarray<string>noUser customer privilege list
alertbooleannoWhether this user wants to receive alert, event, and incident emails. Make sure your email is not null.
temporaryEnablebooleannoWhether the user wants to enable the temporary worker permission
startTimeintegernoThe start time of the user's validity period. time range: start timestamp (Millisecond).
endTimeintegernoThe end time of the user's validity period. time range: end timestamp (Millisecond).
json
// omada_call_operation
{
  "operationId": "createNewMspUser",
  "body": "{...}"
}
Details, permissions and error codes

Create new msp user. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
The interface requires one of the permissions:
MSP Users Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30103 - Invalid email address.
-30104 - Invalid username.
-30105 - Invalid password.
-30106 - This username is already registered.
-30124 - The number of users has reached the limit.
-44118 - This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.

deleteMspUser ​

DELETE /openapi/v1/msp/{mspId}/users/{userID}

Delete an existing msp user

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
userIDpathstringyesUser ID

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

FieldTypeRequiredDescription
forceDeletebooleannoForce delete target user. If false, target user can not be deleted, when target user has child users. If true, target user will be deleted anyway. Target user's child users will be root's child user.
json
// omada_call_operation
{
  "operationId": "deleteMspUser",
  "params": {
    "userID": "<userID>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Delete an existing msp user. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
The interface requires one of the permissions:
MSP Users Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30112 - This user does not exist.
-30114 - An error occurred while deleting the user.
-30132 - Are you sure you want to delete the account %Username%? Once deleted, all sub-users created by this account will be transferred to your account.
-44118 - This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.

getUser_1 ​

GET /openapi/v1/msp/{mspId}/users/{userID}

Get msp user info

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
userIDpathstringyesUser ID
json
// omada_call_operation
{
  "operationId": "getUser_1",
  "params": {
    "userID": "<userID>"
  }
}
Details, permissions and error codes

Get msp user info. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
The interface requires one of the permissions:
MSP Users Manager View Only

modifyMspUser ​

PUT /openapi/v1/msp/{mspId}/users/{userID}

Modify an existing msp user

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
userIDpathstringyesUser ID

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

FieldTypeRequiredDescription
namestringyesUser name. When creating cloud user, you should set TP-LINK ID. It should contain 1 to 128 ASCII characters and start with letters, numbers, and underscores.
passwordstringnoPassword of local user. User can only modify his child local user's password. It should contain 8 to 128 ASCII characters.And password must be a combination of uppercase letters, lowercase letters, numbers, and special symbols. Symbols such as ! # $ % & * @ ^ are supported.
emailstringnoEmail of user
customerRoleIdstringyesCustomer role ID of msp user
allCustomerbooleanyesAll customers including new created customer
customersarray<string>noCustomer ID list of msp user
alertbooleannoAlert email
roleIdstringyesRole ID of user
forceModifybooleannoForce modify
temporaryEnablebooleannoWhether the user wants to enable the temporary worker permission
startTimeintegernoThe start time of the user's validity period. time range: start timestamp (Millisecond).
endTimeintegernoThe end time of the user's validity period. time range: end timestamp (Millisecond).
json
// omada_call_operation
{
  "operationId": "modifyMspUser",
  "params": {
    "userID": "<userID>"
  },
  "body": "{...}"
}
Details, permissions and error codes

Modify an existing msp user. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
The interface requires one of the permissions:
MSP Users Manager Modify
The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30103 - Invalid email address.
-30104 - Invalid username.
-30105 - Invalid password.
-30106 - This username is already registered.
-30108 - This username does not exist.
-30133 - The account should not have privileges to fewer sites than its sub-users.
-30134 - Failed to add Site. Sub-users should not have privileges to more sites than their parent account.
-30135 - Are you sure you want to change the role of %Username% from Administrator to Viewer?If its role is changed, the viewer accounts it has created will be moved to your account.
-30136 - Failed to save. If the editing is saved, the viewer account will have privileges to more sites than that of its immediate superior account.
-44118 - This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.

modifyMspUserBatch ​

PATCH /openapi/v1/msp/{mspId}/users/batch-temporary-users

Batch modify MSP users.

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)

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

FieldTypeRequiredDescription
userIdsarray<string>noThe list of user IDs that need to be configured in bulk
temporaryEnablebooleannoWhether the user wants to enable the temporary worker permission
startTimeintegernoThe start time of the user's validity period. time range: start timestamp (Millisecond).
endTimeintegernoThe end time of the user's validity period. time range: end timestamp (Millisecond).
json
// omada_call_operation
{
  "operationId": "modifyMspUserBatch",
  "body": "{...}"
}
Details, permissions and error codes

Batch modify MSP users.
The interface requires one of the permissions:
MSP Users Manager Modify

getAllMspCloudUsersExcludeRoot ​

GET /openapi/v1/msp/{mspId}/users/cloud

Get all MSP cloud users exclude owner

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
json
// omada_call_operation
{
  "operationId": "getAllMspCloudUsersExcludeRoot"
}
Details, permissions and error codes

The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30194 - This user does not exist.

getAllMspLocalUsersExcludeRoot ​

GET /openapi/v1/msp/{mspId}/users/local

Get all MSP local users exclude owner

ParameterInTypeRequiredDescription
mspIdpathstringautoMSP ID (filled in automatically)
json
// omada_call_operation
{
  "operationId": "getAllMspLocalUsersExcludeRoot"
}
Details, permissions and error codes

The possible error code for the interface in the returned body is one of the following error codes (non generic error codes):
-30194 - This user does not exist.

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