Help Center/ ModelArts/ API Reference/ Workspace Management/ Querying the User Role Information
Updated on 2025-11-19 GMT+08:00

Querying the User Role Information

Function

This API is used to obtain the role information of a specified user in the system. This API is used when you need to know the permissions and roles of a user in the system. The administrator or system can use this API to query the role information of the user. Before using this API, ensure that the user exists and the role information is defined in the system. After the query, the API returns the role list of the user. If the user does not exist or the role information is not defined in the system, 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.

URI

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

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

roles

Array of strings

Definition: User role.

Example Requests

None

Example Responses

Status code: 200

Query the user role information.

{
  "roles" : [ "gray_workspace" ]
}

Status Codes

Status Code

Description

200

Query the user role information.

Error Codes

See Error Codes.