---
title: "PUT /v1/iam/roles/{id}/data-scopes"
method: PUT
path: "/v1/iam/roles/{id}/data-scopes"
tags: ["IAMService"]
---

# PUT /v1/iam/roles/{id}/data-scopes

`PUT /v1/iam/roles/{id}/data-scopes`

SetRoleDataScopes 覆盖设置角色自定义数据范围明细。仅 dataScope=4 的角色允许设置。

## Path parameters

- `id` string, required

## Request body

- IamV1SetRoleDataScopesRequest
  - `id` string
  - `scopes` IamV1RoleDataScope[]
    - `id` string
    - `roleId` string
    - `scopeType` string — 自定义范围类型：org=组织/部门，team=团队，self=本人。
    - `scopeValue` string — org/team 时填写对应 ID 字符串；self 必须为空。

## Response `200`

OK

- IamV1SetRoleDataScopesReply
  - `scopes` IamV1RoleDataScope[]
    - `id` string
    - `roleId` string
    - `scopeType` string — 自定义范围类型：org=组织/部门，team=团队，self=本人。
    - `scopeValue` string — org/team 时填写对应 ID 字符串；self 必须为空。

---

[API](https://skmtc.dev/apiqik/apis/apiqik-api.md) · [All operations](https://skmtc.dev/apiqik/apis/apiqik-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/apiqik/apiqik-api/revisions/e06b96127408/schema)
