<span id="查询角色删除前的所有权列表"></span>

# List role ownerships before deletion

```{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}/delete-ownerships
```

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

## Before you call this API

Prepare a canonical role ID and workspace credentials. Regular deletion checks require role.delete; transfer_requested=true additionally requires role.manage_policy. Read total deletion impact and blocking reasons from existing delete-impact; this API reads one object page only.

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

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

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

When a next cursor exists:



| Field | Type | Description |
| --- | --- | --- |
| limit | integer | Defaults to 10, range 1–100. Explicit empty input is invalid. |
| cursor | string | Previous next_cursor; do not reuse across workspaces/source roles. |
| transfer_requested | boolean | true/false only; defaults to false. Empty is invalid. |

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

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

## Result

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

```json
{
  "code": "OK",
  "msg": "OK",
  "data": {
    "items": [
      {
        "resource_type": "connector",
        "resource_id": "connector-example",
        "display_name": "Orders",
        "ownership_version": 3
      }
    ],
    "ownership_version": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "next_cursor": "eyJXb3Jrc3BhY2VJRCI6IndvcmtzcGFjZS1leGFtcGxlIiwiUm9sZUlEIjoiOCIsIlZlcnNpb24iOiJhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhIiwiUmVzb3VyY2VUeXBlIjoiY29ubmVjdG9yIiwiUmVzb3VyY2VJRCI6ImNvbm5lY3Rvci1leGFtcGxlIn0"
  }
}
```

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

items[].ownership_version is per-object integer CAS. Outer ownership_version is a deletion-set version string. They are not interchangeable. Continue only with nonempty next_cursor. Later pages retain the first set version but read current data, not a locked immutable snapshot. Refresh after changes; final deletion revalidates the complete plan.

The standalone list has no owned_count or full total. Use canonical resource IDs when display names are absent; name enrichment may be empty for some types. Workflow names come from the same workspace system database; failures do not return partial pages. Reading transfers/deletes no objects or roles.

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