View current identity roles¶
View the roles held by the calling identity in the target workspace to confirm the scope of permissions it can use.
GET $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/iam/me/roles
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
Request parameters¶
curl -X GET "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/iam/me/roles" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
Successful response¶
On success, returns the calling identity’s directly assigned roles, default role, explicitly selected candidate role, and effective role. The service does not automatically choose another role if the default role is missing or the candidate is invalid.
{
"code": "OK",
"msg": "OK",
"data": {
"roles": [],
"default_role_id": "role-001",
"default_role_version": 2,
"explicit_role_id": "",
"effective_role_id": "role-001",
"role_context_status": "ready",
"schema_version": "schema-v1",
"capability_version": "capability-v1",
"request_id": "req-001",
"trace_id": "trace-001"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
object array |
Roles directly assigned to the current identity and their availability. |
|
string |
Current default role ID. |
|
integer |
Default role version. |
|
string |
Explicit role ID specified and validated in the request; empty when none is specified. |
|
string |
Role ID ultimately used for this request. |
|
string |
Role context status: |
|
string |
Permission schema version. |
|
string |
Capability projection version. |
|
string |
Request correlation ID. |
|
string |
Trace ID. |
Error response¶
{
"code": "ErrIAMCoreUnavailable",
"msg": "Service temporarily unavailable",
"data": null
}
Field |
Type |
Description |
|---|---|---|
|
string |
Error code. |
|
string |
Error message. |
|
null |
— |