User 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
  • Python-SDK
  • arrow
  • User management API
Table of contents on this page
  • Create User
  • Query user
  • Update user
  • Delete user
  • List users
  • Configure console login for the user
  • Query console login configuration
  • Disable console login configuration
  • Create user's AccessKey
  • Disable user's AccessKey
  • Enable user's AccessKey
  • Delete user's AccessKey
  • List user's AccessKeys

User management API

Updated at:2025-10-27

Create User

Support creating IAM users. Please refer to the following codes:

Python
1def create_user():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# User creation request as dict
5# Set username (1-64 characters, letters, numbers, or "_")
6# Set user description
7    create_user_request = {"name": "test_user", "description": "create user: test_user"}
8    response = iam_client.create_user(create_user_request)
9    print(response)

Query user

Query an IAM user with reference to the following codes:

Python
1def get_user():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# Set username
5    user_name = b'test_user'
6    response = iam_client.get_user(user_name)
7    print(response)

Update user

Support updating an IAM user with reference to the following codes:

Python
1def update_user():
2    iam_client = IamClient(iam_sample_conf.config)
3# Current username
4    user_name = b"test_user"
5    
6# User update request as dict
7# Set updated username
8# Set updated user description
9    update_user_request = {"name": "test_user_new", "description": "test-new"}
10    response = iam_client.update_user(user_name, update_user_request)
11    print(response)

Delete user

Support deleting an IAM user with reference to the following codes:

Python
1def delete_user():
2    iam_client = IamClient(iam_sample_conf.config)
3# Current username
4    user_name = b"test_user"
5    response = iam_client.delete_user(user_name)
6    print(response)

List users

List users with reference to the following codes:

Python
1def list_user():
2    iam_client = IamClient(iam_sample_conf.config)
3    response = iam_client.list_user()
4    print(response)

Configure console login for the user

Configure console login for the user with reference to the following codes:

Python
1def update_user_login_profile():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# Configure the user's console login request as dict
5# Set user password, not displayed in responses
6# Whether secondary verification device binding is required enabledLoginMfa
7# Secondary verification type loginMfaType, options: PHONE-Mobile phone number, TOTP virtual MFA device
8# Bound third-party login type thirdPartyType, options: UUAP-intranet account, PASSPORT-Baidu account
9# Bound third-party login account thirdPartyAccount, which can be a phone number, email, or account name when the binding type is PASSPORT
10    update_user_login_profile_request = {"password":"Pa$$word4Demo", "enabledLoginMfa": True, "loginMfaType": "PHONE",
11                                         "thirdPartyType": "PASSPORT", "thirdPartyAccount": "testPassportAccount"}
12    
13# Current username
14    user_name = b"test_user"
15    response = iam_client.update_user_login_profile(user_name, update_user_login_profile_request)
16    print(response)
17}

Note: 1. Unbinding is performed when thirdPartyType and thirdPartyAccount are both empty strings; 2. If enabledLoginMfa":true is set, loginMfaType must be specified

Query console login configuration

Query console login configuration for the user with reference to the following codes:

Python
1def get_user_login_profile():
2    iam_client = IamClient(iam_sample_conf.config)
3# Current username
4    user_name = b"test_user"
5    response = iam_client.get_user_login_profile(user_name)
6    print(response)

Disable console login configuration

Disable user's console login configuration, i.e., disable user's console login, with reference to the following codes:

Python
1def delete_user_login_profile():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# Set current username
5    user_name = b"test_user"
6    response = iam_client.delete_user_login_profile(user_name)
7    print(response)

Create user's AccessKey

Create a set of AccessKeys for the user with reference to the following codes:

Python
1def create_user_accesskey():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# Set current username
5    user_name = b"test_user"
6    response = iam_client.create_user_accesskey(user_name)
7    print(response)

Disable user's AccessKey

Disable a specified set of AccessKeys for the user with reference to the following codes:

Python
1def disable_user_accesskey():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# Set current username
5    user_name = b"test_user"
6    
7# Set the AK to be disabled
8    accesskey_id = b"test_access_key_id"
9    response = iam_client.disable_user_accesskey(user_name, accesskey_id)
10    print(response)

Enable user's AccessKey

Recover a specified set of AccessKeys for the user to "Enabled" status with reference to the following codes:

Python
1def enable_user_accesskey():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# Set current username
5    user_name = b"test_user"
6    
7# Set the AK to be enabled
8    accesskey_id = b"test_access_key_id"
9    response = iam_client.enable_user_accesskey(user_name, accesskey_id)
10    print(response)

Delete user's AccessKey

Delete a specified set of AccessKeys for the user with reference to the following codes:

Python
1def delete_user_accesskey():
2    iam_client = IamClient(iam_sample_conf.config)
3# Set current username
4    user_name = b"test_user"
5    
6# Set the AK to be deleted
7    accesskey_id = b"test_access_key_id"
8    response = iam_client.delete_user_accesskey(user_name, accesskey_id)
9    print(response)

List user's AccessKeys

List all AccessKeys for the user with reference to the following codes:

Python
1def list_user_accesskey():
2    iam_client = IamClient(iam_sample_conf.config)
3    
4# Set current username
5    user_name = b"test_user"
6    response = iam_client.list_user_accesskey(user_name)
7    print(response)

Previous
Role Management Interfaces
Next
Version Change Records