<span id="查询当前调用身份的能力"></span>

# Get capabilities of the current caller

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

```text
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/iam/me/capabilities
```

<span id="调用前准备"></span>

## 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.

<span id="请求"></span>

## Request

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
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"
```

```bash
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"
```

:::::
:::::{tab-item} Parameters

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. |

:::::
::::::
:::::::

<span id="返回结果"></span>

## Results

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{
  "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": []
  }
}
```

:::::
:::::{tab-item} Fields

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.

:::::
::::::
:::::::
