View role deletion impact

View bindings, inheritance, ownership, grants, and pending changes that still require handling before a role can be deleted. The result is a current snapshot; deletion performs the checks again.

GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/iam/roles/{role_id}/delete-impact

Preparation before calling

First select the role to evaluate, and assess its impact using the current state shown in the list. Prepare a personal access token with the required permission in the target workspace and the target workspace ID.

Request parameters

curl -G "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/delete-impact" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --data-urlencode "expected_lifecycle_version=3"

Path parameters

Parameter

Type

Required

Description

workspace_id

string

Yes

Target workspace ID.

role_id

string

Yes

Target role ID.

Query parameters

Parameter

Type

Required

Description

expected_lifecycle_version

integer

Yes

Current role lifecycle version. Must be greater than 0.

The deletion impact is a snapshot at read time and cannot replace the final deletion check. Submit the latest lifecycle version when deleting the role.

Successful response

On success, returns counts for role bindings, inheritance, ownership, policy grants, and pending operations that could block deletion.

{"code":"OK","msg":"OK","data":{"role":{"role_id":"role-001","lifecycle_state":"disabled","lifecycle_version":3},"direct_binding_count":0,"default_role_count":0,"parent_inheritance_count":0,"child_inheritance_count":0,"active_ownership_count":0,"active_policy_grant_count":0,"pending_operation_count":0,"blocked":false}}

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.role

object

Summary of the assessed role.

data.direct_binding_count

integer

Users directly bound to the role.

data.default_role_count

integer

Users that have the role as their default role.

data.parent_inheritance_count

integer

Direct parent inheritances of the role.

data.child_inheritance_count

integer

Child roles that directly inherit from the role.

data.active_ownership_count

integer

Active ownerships held by the role.

data.active_policy_grant_count

integer

Active policy grants that still reference the role.

data.pending_operation_count

integer

Operations not completed or pending repair.

data.blocked

boolean

Whether deletion is currently blocked.

Error response

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

Field

Type

Description

code

string

Error code.

msg

string

Error message.

data

null

Next steps

Confirm deletion impact

Before deleting a role, confirm there are no bindings, inheritances, ownerships, grants, or pending changes that still require handling. The result is a snapshot; the API checks again when deletion is performed.

Last updated on