Updated on 2025-11-17 GMT+08:00

Adding Members to a Permission Set

Function

This API is used to add members to a permission set.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/security/permission-sets/{permission_set_id}/members/batch-create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Project ID and Account ID.

permission_set_id

Yes

String

Permission set ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

workspace

Yes

String

Workspace ID. For details about how to obtain the workspace ID, see Instance ID and Workspace ID.

X-Auth-Token

Yes

String

IAM token, which is obtained by calling the IAM API for obtaining a user token (value of X-Subject-Token in the response header). This parameter is mandatory for token authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

members

No

Array of PermissionSetMemberCreateDTO2 objects

Parameters for creating a permission set member

auto_sync

No

Boolean

Whether to enable automatic synchronization. The default value is false.

Table 4 PermissionSetMemberCreateDTO2

Parameter

Mandatory

Type

Description

member_type

No

String

Member type, which can be USER, USER_GROUP, or WORKSPACE_ROLE

member_id

No

String

Member ID

member_name

No

String

Member name

workspace

No

String

Workspace

Response Parameters

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

/v1/0833a5737480d53b2f25c010dc1a7b88/security/permission-sets/members/batch-create

{
  "members" : [ {
    "member_id" : "b43927a45a514e93ba70524b28923500",
    "member_name" : "common_user",
    "member_type" : "USER",
    "workspace" : null
  } ],
  "auto_sync" : false
}

Example Responses

None

Status Codes

Status Code

Description

204

No Content

400

Bad Request