--- id: "en/api-post-nd-api-share-set-participant-role" title: "Set permission roles for sharing participants" language: "en" description: "POST /nd/api/file/set_participant_role: Set the permission role of the sharing participant. Interface description, including path, method, parameters and return information." canonical_url: "https://www.babel.cc/public/babelwiki/en/api-post-nd-api-share-set-participant-role.html" markdown_url: "https://www.babel.cc/public/babelwiki/ai/en/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." --- # Set the permission roles of sharing participants | Properties | Values | | --- | --- | | HTTP method | `POST` | | Interface path | `/nd/api/file/set_participant_role` | | Category | Share API | ## Interface description Interface path: `/nd/api/file/set_participant_role` HTTP method: `POST` **HTTP method:** `POST` #### POST request body parameters | Parameter | Type | Required | Description | | --- | --- | --- | --- | | `file_id` | `string` | Yes | File ID | | `babelshare_id` | `string` | Yes | Use `users[].babelshareId` from [Get all sharing participants](https://www.babel.cc/public/babelwiki/en/api-get-nd-api-share-share-participants.html), preserving its string type. Do not substitute `participantId`, an employee ID or an email address. | | `role_id` | `int` | Yes | Take `roles[].id` from [Get sharing permission types](https://www.babel.cc/public/babelwiki/en/api-get-nd-api-share-share-roles.html), preserving its JSON integer type. For the selected sample role with `id: 10`, pass `10`. Do not pass `permission`, a role name or an array index. | First query sharing participants using `file_id` and select the target record's `babelshareId`. Then select the role to assign from the sharing-role list's `id` values. Pass them as `babelshare_id` and `role_id`, respectively. The participant's `users[].roleId` describes their current role. Example request (the participant identifier is illustrative; replace the file ID): ```json { "file_id": "", "babelshare_id": "1001", "role_id": 10 } ``` #### Return field description ```json {"code":0,"success":true} ``` ## Call instructions - Before calling, you need to complete [Get token](https://www.babel.cc/public/babelwiki/en/api-post-api-token-do.html) or the corresponding login-free authentication, and carry `Authorization: Bearer ` in the request header. - If there are differences in parameters and return fields due to deployment versions, the actual private cloud API documents and joint debugging results should prevail. - Category: Sharing API.