Use the following APIs to create, fetch, update, and delete user groups.

Create a Group

Required Permissions

You must have the Create Group permission to perform this operation.

API
/api/groups
Method
POST
Required Parameters
Name Description
name

string

Group name.
description

string

Description of the group.
roles

string

The roles assigned to the group.
Input Example
{
  "name": "",
  "description": "",
  "roles": [//Array of role ids]
}
Response
{
  "id": "string"
}

Get a Group by ID

Required Permissions

You must have the View Group permission to perform this operation.

API
/api/groups/{id}
Method
GET
Required Parameters
Name Description
id

string

The group's identifier.
Response
{
  "id": "",
  "name": "",
  "description": "",
  "isDefault": false,
  "roles": [
    {
      "name": ""
    },
    {
      "name": ""
    }
  ],
  "createdTime":"",
  "lastUpdatedTime":"",
  "updateVersion":1,
  "createdBy":"",
  "lastUpdatedBy":""
}

Get a List of Groups

Required Permissions

You must have the View Group permission to perform this operation.

API
/api/groups
Method
GET
Required Parameters
None
Response
{
  "groups": [
    {
      "id": "",
      "name": "",
      "description":"",
      "isDefault": false,
      "createdTime": "",
      "lastUpdatedTime": "",
      "createdBy":"",
      "lastUpdatedBy":"",
      "updateVersion":1
    }
  ],
  "pageInfo": {
    "page": 1,
    "pageSize": 10,
    "totalElements": "4",
    "totalPages": "1"
  }
}

Update a Group

Required Permissions

You must have the Edit Group permission to perform this operation.

API
/api/groups/{id}
Method
PUT
Required Parameters
Name Description
name

string

Name of the role.
description

string

Description of the role.
roles

string

The roles assigned to the group.
updateVersion

integer

The update version of the role.
Input Example
{
  "name": "",
  "description":"",
  "roles":[//Array of role ids],
  "updateVersion":1
}
Response
{
  "id": "string"
}

Delete a Group

Required Permissions

You must have the Delete Group permission to perform this operation.

API
/api/groups/{id}
Method
DELETE
Required Parameters
Name Description
id

string

The group's identifier.
Response
{}

List Users for Group

Required Permissions

You must have the View Group permission to perform this operation.

API
/api/console-groups/{id}/users?page.number=1&page.size=10
Method
GET
Required Parameters
None
Response
{
    "users": [
        {
            "id": "",
            "userName": "",
            "displayName": "",
            "status": "",
            "orgId": "",
            "createdTime": "",
            "lastUpdatedTime": "",
            "updateVersion": 5,
            "createdBy": "s",
            "lastUpdatedBy": ""
        }
    ],
    "pageInfo": {
        "page": 1,
        "pageSize": 10,
        "totalElements": "1",
        "totalPages": "1"
    }
}