---
id: "zh/api-post-nd-api-share-set-participant-role"
title: "设置分享参与人的权限角色"
language: "zh"
description: "POST /nd/api/file/set_participant_role：设置分享参与人的权限角色 接口说明，包含路径、方法、参数和返回信息。"
canonical_url: "https://www.babel.cc/public/babelwiki/zh/api-post-nd-api-share-set-participant-role.html"
markdown_url: "https://www.babel.cc/public/babelwiki/ai/zh/api-post-nd-api-share-set-participant-role.md"
alternates: {"en": "https://www.babel.cc/public/babelwiki/ai/en/api-post-nd-api-share-set-participant-role.md", "zh": "https://www.babel.cc/public/babelwiki/ai/zh/api-post-nd-api-share-set-participant-role.md"}
reading_note: "文档记录不等于当前部署能力；以实际版本、授权模块与配置为准。保留原文的可选、限制及待确认说明，勿补猜接口。 / Documentation is not a guarantee for every deployment. Preserve optional-module requirements, limitations and unresolved API contracts."
---

# 设置分享参与人的权限角色

| 属性 | 值 |
| --- | --- |
| HTTP 方法 | `POST` |
| 接口路径 | `/nd/api/file/set_participant_role` |
| 所属分类 | 分享 API |

## 接口说明




#### POST 请求体参数

| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `file_id` | `string` | 是 | 文件 ID |
| `babelshare_id` | `string` | 是 | 取自 [获取所有分享参与人](https://www.babel.cc/public/babelwiki/zh/api-get-nd-api-share-share-participants.html) 返回的 `users[].babelshareId`，保留字符串类型；不要使用 `participantId`、工号或邮箱替代。 |
| `role_id` | `int` | 是 | 取自 [获取分享权限类型](https://www.babel.cc/public/babelwiki/zh/api-get-nd-api-share-share-roles.html) 返回的 `roles[].id`，保留 JSON 整数类型；例如所选样例角色的 `id` 为 `10`，则传 `10`。不要传 `permission`、角色名称或数组下标。 |

先用 `file_id` 查询分享参与人，取得目标记录的 `babelshareId`；再从分享角色列表选取要授予的 `id`，分别传入 `babelshare_id` 和 `role_id`。`users[].roleId` 表示该参与人当前的角色。

请求示例（参与人标识为示例值，文件 ID 需替换）：

```json
{
  "file_id": "<FILE_ID>",
  "babelshare_id": "1001",
  "role_id": 10
}
```

#### 返回字段说明

```json
{"code":0,"success":true}
```

## 调用说明

- 调用前需完成 [获取 token](https://www.babel.cc/public/babelwiki/zh/api-post-api-token-do.html) 或相应免登录认证，并在请求 Header 中携带 `Authorization: Bearer <access_token>`。
- 参数和返回字段如因部署版本存在差异，应以实际私有云 API 文档和联调结果为准。
- 所属分类：分享 API。
