Sidebar

api:usergroup:create

Table of Contents

create()

This function allows you to create a user group as defined by the user group data array.

Parameters

ParameterTypeOptionalDescriptionDetails
usergroup dataarray or object Array of User group objects or a single objectusrgrpid shouldn't be specified

Returns

ParameterDescription
resultOperation successful. Result will contain array of created User group IDs. usrgrpid are assigned to each User group object
errorIn case of any errors

Example

{
"jsonrpc":"2.0",
"method":"usergroup.create",
"params":[
   {"name":"Debug Group"}
],
"auth":"038e1d7b1735c6a5436ee9eae095879e",
"id":3
}

User group created successfully:

{
"jsonrpc":"2.0",
"result":{
   "usrgrpids": ["107819"]
},
"id":3
}

User group already exists:

{
"jsonrpc":"2.0",
"error":{
      "code":-32602,
      "message":"Invalid params.",
      "data":"[ CUserGroup::create ] User group [ Debug Group ] already exists"
},
"id":3
}