Skip to content

Modify Members


POST /api/v1/workspace/member/batch_modify

Overview

Modify the complete set of direct roles for members in the current workspace, and optionally adjust the teams and nickname of a single member at the same time.

Before You Call and Usage Steps

onlyModifyRoles=true is suitable for batch role replacement. false is used for a single member; in this case, submit only one accountUUID, and submit the team array and nickname as the complete target values; omitting them clears the original teams or nickname. Roles are replaced as a whole; do not treat the role array as an append list. owner cannot be used as the target account, and owner cannot be granted through this endpoint. Related SSO accounts with SAML mapping enabled may reject manual role changes. The current code has removed the Billing Center privilege escalation approval and does not require including "roles that require no approval"; on success, it usually returns content={} and does not provide a new approval redirect field. When some submitted accounts do not have a direct workspace relationship, individual errors are not guaranteed; the current endpoint also does not fully validate whether all roleUUIDs belong to this workspace, so unknown or cross-workspace UUIDs can be written and replace existing roles. The client must first verify each item against the role list of this workspace; a successful empty object does not prove that the new roles are valid. After execution, the actual roles and access capabilities must also be queried. Processing of membership relationships, roles, tokens, caches, and other items may be saved in steps; after an exception or timeout, first read the member and role status, then decide whether to retry.

Request Headers

Parameter Name Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with the required operation permissions from API Key Management in the target workspace.

Body Request Parameters

Parameter Name Type Required Description
accountUUIDs[*] string Individual string identifier in the array.
Example: acnt_example
How to obtain or enter: Obtain the current workspace member account UUID from content.data[].uuid in the Workspace Member List. This is not an API Key UUID or an email address.
roleUUIDs[*] string Individual string identifier in the array.
Example: readOnly
How to obtain or enter: Obtain an available role for the current workspace from content.data[].uuid in the Role List. The built-in identifiers are wsAdmin for administrator, general for standard member, and readOnly for read-only member; identifiers starting with role_ are custom roles.
memberGroupUUIDs[*] string Individual team UUID starting with group_.
Example: group_example
How to obtain or enter: Obtain it from team management in this workspace or from member_group[].uuid in the Workspace Member List.
accountUUIDs array Y Array of existing member accounts; when onlyModifyRoles=false, the client must submit only one account to prevent uncertainty in updating the first account's teams/nickname. Do not pass null.
Null allowed: True
Example: ["acnt_example"]
How to obtain or enter: Obtain the current workspace member account UUID from content.data[].uuid in the Workspace Member List. This is not an API Key UUID or an email address.
roleUUIDs array Y Complete target set of direct roles; must be non-empty. Replaces the original direct roles; roles inherited from groups/teams take effect separately according to their corresponding relationships. owner must not be included.
Null allowed: False
Example: ["readOnly"]
How to obtain or enter: Obtain an available role for the current workspace from content.data[].uuid in the Role List. The built-in identifiers are wsAdmin for administrator, general for standard member, and readOnly for read-only member; identifiers starting with role_ are custom roles.
onlyModifyRoles boolean Y Required boolean. true preserves teams and nickname; false requires submitting only one accountUUID and providing the target teams and nickname at the same time.
Null allowed: False
Example: true
How to obtain or enter: Use true for batch role changes; use false to change the teams/nickname of one member at the same time.
memberGroupUUIDs array Complete target team list when onlyModifyRoles=false; omitting it or passing [] removes the original teams; do not pass null. When true, teams are not modified.
Null allowed: True
Example: ["group_example"]
How to obtain or enter: Obtain it from team management in the current workspace or from member_group[].uuid in the Workspace Member List; when using false mode, submit the complete target array.
acntWsNickname string Updated when onlyModifyRoles=false; if omitted, defaults to an empty string and can clear the original nickname; ignored when true. Maximum 128 custom length units: ASCII/half-width katakana count as 1, and Chinese characters, etc. usually count as 2.
Null allowed: True
$maxCustomLength: 128
Example: 生产值班工程师
How to obtain or enter: The business party enters the workspace nickname for this member; this is not the site-wide account name.

Additional Parameter Notes

This public endpoint has no internal parameters such as remark. Although accountUUIDs has a historical declaration allowing null, the current implementation requires an array; an empty array in false mode may cause an internal error. The client should pass a non-empty array as shown in the example and obtain available UUIDs from the role list.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/workspace/member/batch_modify' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"accountUUIDs":["acnt_example"],"roleUUIDs":["general"],"onlyModifyRoles":true}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content object In the current normal flow, returns an empty object {}; no declaration is attached, and no per-account update result is provided.
{
  "code": 200,
  "content": {},
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field is missing, or the field value violates the declared validation conditions Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The JSON top level is not an object Partial JSON file format error Submit a single JSON object.
400 ft.SSOUnsupportModifyRole The target SSO account's roles are maintained by an identity source with SAML mapping enabled SAML mapping is enabled; modifying roles for SSO accounts is prohibited Adjust it in the corresponding identity source or mapping rule to avoid local override.
400 ft.RoleUUIDNullError roleUUIDs is empty The role UUID list is empty Provide at least one valid role for this workspace.
400 ft.InvalidActionSaasLimit The target role set contains owner Invalid operation; SaaS cannot modify the owner Use the owner transfer process.
400 ft.ForbiddenModifyOwner The target account is the owner of the current workspace Invalid operation; the owner cannot be modified Do not modify the owner account; use the owner transfer process.
404 ft.WorkspaceNoExistsOwner No valid owner relationship can be found for the current workspace The workspace has no owner First contact the administrator to check the workspace owner status.
400 ft.MemberRoleNotFound No operable direct membership relationship exists in the current workspace The specified member role was not found in the current workspace Check the account and direct member identity in the current member list.
500 ft.InternalServerError Data saving, associated resource, or cache processing failed Internal error First check the current member and permission status, then decide whether to retry; if the failure persists, provide traceId and a sanitized request.
404 ft.NotFoundAccount When onlyModifyRoles=false, the account selected for single-member audit has no active direct membership relationship The specified account was not found In this mode, submit only one valid direct member UUID; the first item after deduplicating multiple accounts is not guaranteed to follow the input order.

Feedback

Is this page helpful?