Skip to main content
Version: Mosquitto 2.8

User Management

User Management operations

Available API Paths


Path: /api/user-management/roles

Methods

GET

Retrieve all possible roles in the system. Must be admin to access

Responses

Status Description Response Content or Scheme
200 An array of existing MMC roles

Example

[
"admin",
"editor",
"viewer",
"connectionManager",
"monitoringViewer"
]
Status Description Response Content or Scheme
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

Path: /api/user-management/users

Methods

GET

Retrieve all users. Must be admin to access

Responses

Status Description Response Content or Scheme
200 An array of all the users
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

POST

Create a new user. Must be admin to access

Parameters

Name Required Type Request Properties or Schema
body true object undefined.
body true object undefined.

Responses

Status Description Response Content or Scheme
200 An array of all the users
400 Request data is invalid
{
"code": {
"type": "string",
"enum": [
"INVALID"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User object invalid",
"Group object invalid",
"User must have at least one role",
"Invalid. userName doesn't match the issuing user"
],
"description": "Message of the error"
}
}
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
409 Requested entity already exists
{
"code": {
"type": "string",
"enum": [
"CONFLICT"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User already exists",
"Group already exists"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

Path: /api/user-management/users/{userName}

Methods

GET

Retrieve a user by username. Must be admin to access

Parameters

NameLocationTypeRequiredDescription
userNamepathstringtrueUsername of the user to retrieve

Responses

Status Description Response Content or Scheme
200 User object corresponding to userName
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
410 Requested entity does not exists or was removed
{
"code": {
"type": "string",
"enum": [
"GONE"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User does not exist",
"User group does not exist"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

PUT

Update a user by username. Must be admin to access

Parameters

NameLocationTypeRequiredDescription
userNamepathstringtrueUsername of the user to update

Parameters

Name Required Type Request Properties or Schema
body true object undefined.
body true object undefined.

Responses

Status Description Response Content or Scheme
200 An array of all the users
400 Request data is invalid
{
"code": {
"type": "string",
"enum": [
"INVALID"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User object invalid",
"Group object invalid",
"User must have at least one role",
"Invalid. userName doesn't match the issuing user"
],
"description": "Message of the error"
}
}
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
410 Requested entity does not exists or was removed
{
"code": {
"type": "string",
"enum": [
"GONE"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User does not exist",
"User group does not exist"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

DELETE

Delete a user by username. Must be admin to access

Parameters

NameLocationTypeRequiredDescription
userNamepathstringtrueUsername of the user to delete

Responses

Status Description Response Content or Scheme
200 An array of all the users
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
410 Requested entity does not exists or was removed
{
"code": {
"type": "string",
"enum": [
"GONE"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User does not exist",
"User group does not exist"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

Path: /api/user-management/groups

Methods

GET

Retrieve all user groups. Must be admin to access

Responses

Status Description Response Content or Scheme
200 A map of all user group names to user group objects
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

POST

Create a new user group

Parameters

Name Required Type Request Properties or Schema
body true object undefined.
body true object undefined.

Responses

Status Description Response Content or Scheme
200 A map of all user group names to user group objects
400 Request data is invalid
{
"code": {
"type": "string",
"enum": [
"INVALID"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User object invalid",
"Group object invalid",
"User must have at least one role",
"Invalid. userName doesn't match the issuing user"
],
"description": "Message of the error"
}
}
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
409 Requested entity already exists
{
"code": {
"type": "string",
"enum": [
"CONFLICT"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User already exists",
"Group already exists"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

Path: /api/user-management/groups/{groupName}

Methods

GET

Retrieve a group by group name. Must be admin to access

Parameters

NameLocationTypeRequiredDescription
groupNamepathstringtrueName of the group to retrieve

Responses

Status Description Response Content or Scheme
200 User group object corresponding to groupName
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
410 Requested entity does not exists or was removed
{
"code": {
"type": "string",
"enum": [
"GONE"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User does not exist",
"User group does not exist"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

PUT

Update a group by group name. Must be admin to access

Parameters

NameLocationTypeRequiredDescription
groupNamepathstringtrueName of the group to update

Parameters

Name Required Type Request Properties or Schema
body true object undefined.
body true object undefined.

Responses

Status Description Response Content or Scheme
200 A map of all user group names to user group objects
400 Request data is invalid
{
"code": {
"type": "string",
"enum": [
"INVALID"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User object invalid",
"Group object invalid",
"User must have at least one role",
"Invalid. userName doesn't match the issuing user"
],
"description": "Message of the error"
}
}
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
410 Requested entity does not exists or was removed
{
"code": {
"type": "string",
"enum": [
"GONE"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User does not exist",
"User group does not exist"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

DELETE

Delete a group by group name. Must be admin to access

Parameters

NameLocationTypeRequiredDescription
groupNamepathstringtrueName of the group to delete

Responses

Status Description Response Content or Scheme
200 A map of all user group names to user group objects
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
410 Requested entity does not exists or was removed
{
"code": {
"type": "string",
"enum": [
"GONE"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"User does not exist",
"User group does not exist"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}

Path: /api/user-management/groups/user/{userName}

Methods

GET

Retrieve groups of a user you are logged in as. User must also be an admin

Parameters

NameLocationTypeRequiredDescription
userNamepathstringtrueUsername of the user to retrieve groups for

Responses

Status Description Response Content or Scheme
200 An array of groups of the specified user
{
"name": {
"type": "string",
"description": "Name of the group"
},
"addedBy": {
"type": "object",
"properties": {
"username": {
"type": "string",
"description": "Username of the one who added the user to the group"
}
}
}
}

Example

{
"groups": [
{
"name": "testGroup",
"addedBy": {
"username": "cedalo"
}
}
]
}
Status Description Response Content or Scheme
401 Access to resource is denied. User not authenticated (logged in) or session expired
{
"code": {
"type": "string",
"enum": [
"UNAUTHORIZED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Unauthorized"
],
"description": "Message of the error"
}
}
403 User does not have enough permissions to access the resource
{
"code": {
"type": "string",
"enum": [
"NOT_ALLOWED"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Not allowed"
],
"description": "Message of the error"
}
}
404 Plugin is not enabled or not found
{
"code": {
"type": "string",
"enum": [
"NOT_FOUND"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"Plugin not found"
],
"description": "Message of the error"
}
}
500 An internal server error has occured
{
"code": {
"type": "string",
"enum": [
"SOMETHING_WRONG",
"INTERNAL_ERROR"
],
"description": "Name of the error"
},
"message": {
"type": "string",
"enum": [
"An internal server error occurred"
],
"description": "Message of the error"
}
}