Updated on 2026-09-01 GMT+08:00

Obtaining the User List

Function

This API is used to obtain the user list in the system. This API is used when you need to view all users in the system or filter users based on specific conditions. The administrator or system can use this API to query the user list. Before using this API, ensure that the user exists and the query permission is granted. After the query, the API returns the list of users that meet the query conditions. If no user exists in the system or the query user does not have the required permission, the API returns an error message.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /v1/{project_id}/workspaces/users/list

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: User project ID. For details, see Obtaining a Project ID and Name.

Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed.

Range: N/A

Default Value: N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition: User token. It can be obtained by calling the IAM API. The token is the value of X-Subject-Token in the response header.

Constraints: N/A

Range: N/A

Default Value: N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

users

Array of UserName objects

Definition: Authorization object list.

Table 4 UserName

Parameter

Type

Description

userName

String

Definition: Authorization object name.

Range: N/A

Example Requests

None

Example Responses

Status code: 200

Query the user role information.

{
  "users" : [ {
    "userName" : "app"
  }, {
    "userName" : "zx-test"
  } ]
}

Status Codes

Status Code

Description

200

Query the user role information.

Error Codes

See Error Codes.