Get user role bindings

View the roles and default roles of the specified user in the current workspace to provide a basis for adjusting role assignments.

HTTP
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/users/{user_id}/role-bindings

Before you call

Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First select user.

Prepare personal access token and target workspace ID that can access the target workspace.

Request parameters

Shell
curl -X GET "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/users/$USER_ID/role-bindings" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Type

Required

Description

workspace_id

string

Yes

Target workspace ID.

user_id

string

Yes

The IAM user ID of the accepted member, taken from the iam_user_id of the same record in the user list.

user_id in the path fills in the iam_user_id returned by the user list, and the member must have accepted the invitation. id in the list is the product account UID and cannot replace iam_user_id. Pending invitations cannot be used with this interface.

Successful response

JSON
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "user_id": "user-001",
    "binding_version": "binding-v3",
    "request_id": "req-001",
    "trace_id": "trace-001",
    "roles": [],
    "default_role_id": "",
    "default_role_version": 0
  }
}

Field

Type

Description

code

string

success code.

msg

string

Response information.

data

object

The data returned by this operation.

data.user_id

string

Target user ID.

data.roles

array of object

List of roles that the user is directly bound to. Returns an empty array if there is no binding.

data.roles[].role_id

string

Role ID.

data.roles[].role_name

string

Character name.

data.roles[].lifecycle_state

string

life cycle status. The values are active, disabled, deleted

data.roles[].lifecycle_version

integer

Lifecycle version.

data.roles[].system_role

boolean

Whether it is a system role.

data.roles[].selectable

boolean

Is it optional?

data.roles[].disabled_reason

string

Reason not optional. The value is empty string, ROLE_NOT_ACTIVE, ROLE_PROVISIONING_NOT_READY

data.roles[].provisioning_state

string

status information. The values are pending, ready, failed

data.roles[].provisioning_version

integer

Member configuration version.

data.default_role_id

string

Current default role ID. Returns an empty string if there is no default role.

data.default_role_version

integer

Current default character version. Returns 0 when there is no default role.

data.binding_version

string

Current character binding version tag.

data.request_id

string

Request association ID.

data.trace_id

string

Link tracking ID.

Error response

The only common errors are code and msg, and data:null is not returned. data is only possible if there is a core authorization error code, which contains the request ID, tracking ID, and core error code.

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

Field

Type

Description

code

string

error code.

msg

string

error message.

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

INVALID_ARGUMENT, ErrParamInvalid, ErrIAMInheritanceInvalid, ErrIAMRoleLifecycleInvalid, ErrIAMRoleDeleteInvalid

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

Unauthorized

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

ErrForbidden, ErrWorkspaceAccessDenied, IAM_ERROR_CODE_PERMISSION_DENIED

The current identity or active role does not have permission for this operation.

Use an authorized identity or contact an administrator to grant access.

404

USER_NOT_FOUND, ErrNotFound, ErrIAMResourceNotFound, IAM_ERROR_CODE_RESOURCE_NOT_FOUND

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

IAM_ERROR_CODE_IDEMPOTENCY_CONFLICT, IAM_ERROR_CODE_LIFECYCLE_CONFLICT, ErrIAMInheritanceConflict, ErrIAMRoleDeleteConflict, ErrIAMRoleDeleteResultUnknown, ErrIAMWorkspaceMemberLifecycleResultUnknown

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

500

INTERNAL, ErrIAMRoleDeleteFailed, ErrIAMWorkspaceMemberLifecycleFailed, ErrIAMWorkspaceMemberLifecycleIncomplete, ErrIAMRoleWriteFailed

Internal processing failed; write operations may have been partially applied.

Retain request and trace details, and verify the current state before retrying.

503

ErrCoreAuthorizeUnavailable, IAM_ERROR_CODE_CORE_AUTHORIZE_UNAVAILABLE, ErrIAMRoleReadUnavailable, ErrIAMRolePermissionViewUnavailable, ErrIAMRoleInheritanceUnavailable, ErrIAMRoleAdministrationUnavailable

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on