Get capabilities of the current caller¶
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/iam/me/capabilities
Before you call this API¶
Prepare workspace credentials and current role context. Existing SDK/CLI workspace role mappings can be reused. This API returns the current caller’s capabilities, not an arbitrary target role’s.
Request¶
curl -X GET "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/iam/me/capabilities" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
--get \
--data-urlencode "capability_id=action.role.create" \
--data-urlencode "capability_id=navigation.roles"
curl -X GET "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/iam/me/capabilities" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Omit filters to read the complete existing list:
Field |
Type |
Description |
|---|---|---|
capability_id |
Repeated string query items |
Omission selects all. For selected IDs, send each separately rather than comma-joining them. |
Results¶
{
"code": "OK",
"msg": "OK",
"data": {
"effective_role_id": "7",
"capability_version": "definition-example",
"request_id": "request-example",
"trace_id": "trace-example",
"items": [
{
"capability_id": "action.role.create",
"action_id": "role.create",
"resource_type": "workspace",
"reason_code": "",
"allowed": true,
"all_resources": true,
"resource_ids": []
},
{
"capability_id": "navigation.roles",
"action_id": "role.read",
"resource_type": "workspace",
"reason_code": "",
"allowed": true,
"all_resources": true,
"resource_ids": []
}
],
"unsupported_capability_ids": []
}
}
Supported and unsupported entries are separately deduplicated and sorted by ID. Unknown IDs, including empty strings, enter unsupported_capability_ids unchanged without failing the whole request. They are not automatically trimmed or split. Entirely unsupported input still returns 200 with empty items, but current identity/role and membership validity checks still run. Malformed query encoding returns 400 INVALID_ARGUMENT.
allowed=false is an explicit denial, not an unsupported capability or failed query. Object operations also require checking all_resources/resource_ids for scope. Unrequested items do not establish a lack of permission. Older results or results from before a role switch are not current authorization. This does not replace live write authorization. The independent API retains action/resource/version metadata, unlike the compact user/info bootstrap shape.