# List role members

```{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/roles/{role_id}/members
```

## Before you call this API

Read role lists first for a canonical positive integer role ID. Prepare Workspace credentials and a current role with Workspace role.read. Returns directly bound users; display names/emails are not user_id values.

## 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/roles/$ROLE_ID/members" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --get \
  --data-urlencode "limit=1"
```

```bash
curl -X GET "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/iam/roles/$ROLE_ID/members" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  --get \
  --data-urlencode "limit=1" \
  --data-urlencode "cursor=$NEXT_CURSOR"
```

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

When a nonempty next_cursor is returned, save its unchanged value as NEXT_CURSOR and read again:



| Field | Type | Description |
| --- | --- | --- |
| limit | integer | Defaults to 50; accepts 1–200. Empty uses the default. |
| cursor | string | Previous next_cursor; omit initially. |

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

## Result

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

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "role_id": "8",
    "members": [
      {
        "user_id": "canonical-user-example",
        "display_name": "Example user",
        "email": "",
        "default_role": false,
        "default_role_version": 2,
        "binding_created_at": 1794390000
      }
    ],
    "next_cursor": "canonical-user-example",
    "request_id": "request-example",
    "trace_id": "trace-example"
  }
}
```

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

Sorts by canonical user_id ascending; stop when next_cursor is empty. Directory profiles are supplemented in batches for the current page. Confirmed missing profiles retain users with empty display values. Directory read failures return dependency errors, not empty lists. binding_created_at is Unix seconds; default_role_version is that user's default role version.

An empty list does not independently establish role existence; the inspected service/DAO does not first check the target role exists. Lists do not aggregate inherited members or unbind users. Deletion also requires reading current deletion impact; an empty member page does not establish deletability.

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