Get user role bindings

View the roles and default role of a specified user in the current workspace. Use this information when adjusting role assignments.

GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/users/{user_id}/role-bindings

Preparation before calling

First select the user.

Prepare a personal access token and target workspace ID with access to the target workspace.

Request parameters

curl -X GET "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/iam/users/$USER_ID/role-bindings" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Type

Required

Description

workspace_id

string

Yes

Target workspace ID.

user_id

string

Yes

ID of the user whose role bindings you want to view.

Successful response

On success, returns the user’s direct role bindings, default role, and concurrency-control versions. When the user has no direct role bindings, the service can omit the role and default-role fields. Read the current versions again before updating bindings.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "user_id": "user-001",
    "binding_version": "binding-v3",
    "request_id": "req-001",
    "trace_id": "trace-001"
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.user_id

string

Target user ID.

data.roles

object (array)

Roles directly bound to the user, including their lifecycle, deployment, and optional states; returned when direct bindings exist.

data.default_role_id

string

Current default role ID; returned when a default role exists.

data.default_role_version

integer

Current default role version; returned when a default role exists.

data.binding_version

string

Current role-binding version marker.

data.request_id

string

Request correlation ID.

data.trace_id

string

Trace ID.

Error response

{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

Field

Type

Description

code

string

Error code.

msg

string

Error message.

data

null

Next steps

Confirm current role bindings

Before updating a user’s role bindings, confirm the user’s current roles and default role, and use the binding state read on this page to prepare the change.

Last updated on