Group management API

IAM IAM

  • API Reference
    • Common request header and common response header
    • Data type
    • Error code
    • Feature Update Records
    • General Description
    • Introduction
    • Service domain
    • STS-Related Interfaces
  • API Reference_IAM
    • Common request header and common response header
    • Data type
    • Error code
    • General Description
    • Group management API
    • Introduction
    • Policy management API
    • Role Management Interfaces
    • Service domain
    • User management API
  • FAQs
    • Common Questions Overview
    • FAQs related to IAM users
    • FAQs related to product permissions
  • Function Release Records
  • Operation guide
    • Account Security Audit
    • Enterprise Account Integration
      • Federated Login Overview
      • IAM Role-based SSO
      • IAM User-based SSO
    • Group Management
    • Message Center
    • Permission Policies
      • ACL
      • Authorization
      • Managing IAM Policies
      • Permission Policy Overview
      • Policy Authentication Evaluation Logic
      • Strategy type
      • Tag-Based Authorization and Authentication
    • Role Management
      • Common scenarios
      • Create role
      • FAQs
      • Managing Roles
      • Overview
      • Related concepts
      • Using Roles
    • Settings
    • User
      • IAM User Operations
      • Two-Factor Authentication
      • User management
    • User Anomaly Behavior Analysis (Public Beta)
      • Risk Behavior Management
  • Operation records
    • Cloud Trail (Public Beta)
  • Product Announcement
    • Baidu Intelligent Cloud Enables Login Protection MFA Multi-Factor Authentication Notification for All Users
  • Product Description
    • Application scenarios
    • Concepts
    • Currently Supported Product Lines
    • Product functions
    • Product overview
    • System Restrictions
    • Enterprise Organization vs Identity and Access Management
  • Product pricing
    • Product pricing
  • Quick Start
    • Create groups and grant permissions
    • Creating IAM User Administrators
  • SDK
    • Go-SDK
      • Error handling
      • Group management API
      • Initialize SDK
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Java-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Python-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
  • Testing Knowledge Base SDK
  • Typical Practices
    • Baidu Intelligent Cloud Partner Guide to Creating IAM Users
    • User Management and Permission Assignment
All documents
menu
No results found, please re-enter

IAM IAM

  • API Reference
    • Common request header and common response header
    • Data type
    • Error code
    • Feature Update Records
    • General Description
    • Introduction
    • Service domain
    • STS-Related Interfaces
  • API Reference_IAM
    • Common request header and common response header
    • Data type
    • Error code
    • General Description
    • Group management API
    • Introduction
    • Policy management API
    • Role Management Interfaces
    • Service domain
    • User management API
  • FAQs
    • Common Questions Overview
    • FAQs related to IAM users
    • FAQs related to product permissions
  • Function Release Records
  • Operation guide
    • Account Security Audit
    • Enterprise Account Integration
      • Federated Login Overview
      • IAM Role-based SSO
      • IAM User-based SSO
    • Group Management
    • Message Center
    • Permission Policies
      • ACL
      • Authorization
      • Managing IAM Policies
      • Permission Policy Overview
      • Policy Authentication Evaluation Logic
      • Strategy type
      • Tag-Based Authorization and Authentication
    • Role Management
      • Common scenarios
      • Create role
      • FAQs
      • Managing Roles
      • Overview
      • Related concepts
      • Using Roles
    • Settings
    • User
      • IAM User Operations
      • Two-Factor Authentication
      • User management
    • User Anomaly Behavior Analysis (Public Beta)
      • Risk Behavior Management
  • Operation records
    • Cloud Trail (Public Beta)
  • Product Announcement
    • Baidu Intelligent Cloud Enables Login Protection MFA Multi-Factor Authentication Notification for All Users
  • Product Description
    • Application scenarios
    • Concepts
    • Currently Supported Product Lines
    • Product functions
    • Product overview
    • System Restrictions
    • Enterprise Organization vs Identity and Access Management
  • Product pricing
    • Product pricing
  • Quick Start
    • Create groups and grant permissions
    • Creating IAM User Administrators
  • SDK
    • Go-SDK
      • Error handling
      • Group management API
      • Initialize SDK
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Java-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
    • Python-SDK
      • Error code
      • Group management API
      • Initialization
      • Install the SDK Package
      • Overview
      • Policy management API
      • Role Management Interfaces
      • User management API
      • Version Change Records
  • Testing Knowledge Base SDK
  • Typical Practices
    • Baidu Intelligent Cloud Partner Guide to Creating IAM Users
    • User Management and Permission Assignment
  • Document center
  • arrow
  • IAMIAM
  • arrow
  • SDK
  • arrow
  • Java-SDK
  • arrow
  • Group management API
Table of contents on this page
  • Create group
  • Query group
  • Update group
  • Delete group
  • List groups
  • Add user to group
  • Remove user from group
  • List the group to which a user belongs
  • List users within a group

Group management API

Updated at:2025-10-27

Create group

Create a group with reference to the following codes:

Java
1public void createGroup(IamClient client) {
2    CreateGroupRequest createGroupRequest = new CreateGroupRequest();
3 // Group name
4    createGroupRequest.setName("test_group_name");
5 // Group description
6    createGroupRequest.setDescription("test_group_description");
7    
8    client.createGroup(createGroupRequest);
9}

Query group

Query a group with reference to the following codes:

Java
1public void getGroup(IamClient client) {
2 // Group name
3    String groupName = "test_group_name";
4    
5    client.getGroup(groupName);
6}

Update group

Update a group with reference to the following codes:

Java
1public void updateGroup(IamClient client) {
2 // Group name
3    String groupName = "test_group_name";
4 // Set updated group information
5    UpdateGroupRequest updateGroupRequest = new UpdateGroupRequest();
6 // Set updated group name
7    updateGroupRequest.setName("new_group_name");
8 // Set updated group description
9    updateGroupRequest.setDescription("new_group_description");
10    
11    client.updateGroup(groupName, updateGroupRequest);
12}

Delete group

Delete a group with reference to the following codes:

Java
1public void deleteGroup(IamClient client) {
2 // Group name
3    String groupName = "test_group_name";
4    
5    client.deleteGroup(groupName);
6}

List groups

List groups with reference to the following codes:

Java
1public void listGroup(IamClient client) {
2    client.listGroup();
3}

Add user to group

Add a user to a group with reference to the following codes:

Java
1public void addUserToGroup(IamClient client) {
2 // Group name
3    String groupName = "test_group_name";
4 // Username
5    String userName = "test_user_name";
6    
7    client.addUserToGroup(userName, groupName);
8}

Remove user from group

Remove a user from a group with reference to the following codes:

Java
1public void removeUserFromGroup(IamClient client) {
2 // Group name
3    String groupName = "test_group_name";
4 // Username
5    String userName = "test_user_name";
6    
7    client.removeUserFromGroup(userName, groupName)
8}

List the group to which a user belongs

List groups to which the users belong with reference to the following codes:

Java
1public void listGroupsForUser(IamClient client) {
2 // Username
3    String userName = "test_user_name";
4    
5    client.listGroupsForUser(userName);
6}

List users within a group

List users within a group with reference to the following codes:

Java
1public void listUsersInGroup(IamClient client) {
2 // Group name
3    String groupName = "test_group_name";
4    
5    client.listUsersInGroup(groupName);
6}

Previous
Error code
Next
Initialization