Help Center/ KooDrive/ API Reference/ API/ Refined Authorization/ Updating Permissions in Batches
Updated on 2025-08-28 GMT+08:00

Updating Permissions in Batches

Function

Update permissions in batches.

URI

PUT /koodrive/ose/v1/permission/batchupdate

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

Authorization

Yes

String

The format is Bearer {app_access_token}. The application-level token needs to be passed for calling by an application server. The token is obtained by calling an API using clientid and clientSecret obtained during application creation.

X-Traceid

No

String

Message log trace ID. The value contains 58 bits.

language

No

String

Language code, which complies with the internationalization specifications. For example, en_us indicates English (United States).

X-User-Id

Yes

String

User ID, which is used for app authentication.

X-Date

Yes

String

Date, which is used for app authentication.

Host

No

String

Address, which is used for app authentication.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

amendModRoles

Yes

Array of AmendModRole objects

Roles to be modified.

type

Yes

Integer

Type. 0: team space; 1: group space.

container

Yes

String

Space ID.

fileId

No

String

File ID (If a file ID is specified, the permissions for the resource are granted.)

Table 3 AmendModRole

Parameter

Mandatory

Type

Description

userId

Yes

Long

User ID.

template

Yes

Long

Permission template ID. For an anonymous template, set this parameter to -1. (This parameter is optional when members are added to or deleted from a user group in batches.)

capabilities

No

Capabilities object

Permission value (transferred when a template is customized).

Table 4 Capabilities

Parameter

Mandatory

Type

Description

addChildNodePermission

Yes

Boolean

Permission to create a file or folder. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

copyPermission

Yes

Boolean

Copy permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

deletePermission

Yes

Boolean

Delete permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

downloadPermission

Yes

Boolean

Download permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

editPermission

Yes

Boolean

Edit permissions. true: granted; false: not granted (editing is not supported.)

listChildNodePermission

Yes

Boolean

Permission to view the list. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

removeChildNodePermission

Yes

Boolean

Move permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

renameFilePermission

Yes

Boolean

Rename permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

shareFilePermission

Yes

Boolean

Share permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

uploadPermission

Yes

Boolean

Upload permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

viewPermission

Yes

Boolean

Preview permission. The value true indicates that the permission is granted, and the value false indicates that the permission is not granted.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

code

Integer

Error code.

msg

String

Error message.

Example Requests

/koodrive/ose/v1/permission/batchupdate

{
  "amendModRoles" : [ {
    "userId" : "*****",
    "template" : "******",
    "capabilities" : {
      "addChildNodePermission" : true,
      "copyPermission" : false,
      "deletePermission" : false,
      "downloadPermission" : true,
      "editPermission" : false,
      "listChildNodePermission" : true,
      "removeChildNodePermission" : false,
      "renameFilePermission" : false,
      "shareFilePermission" : false,
      "uploadPermission" : true,
      "viewPermission" : true
    }
  } ],
  "type" : 0,
  "container" : "*****",
  "fileId" : "*****"
}

Example Responses

Status code: 200

Response for updating permissions in batches.

{
  "code" : 0,
  "msg" : "success"
}

Status Codes

Status Code

Description

200

Response for updating permissions in batches.