All Products
Search
Document Center

Drive and Photo Service:Manage groups

Last Updated:Jun 18, 2026

You can manage groups by using the default Drive and Photo Service client or by calling the API operations described in this topic.

Basic concepts

  • A group represents an enterprise department and can contain users or other groups.

  • Group members can be users or other groups.

The following figure shows a sample enterprise structure.

image

Note
  • A user can belong to multiple groups. We recommend that you add a user to no more than 10 groups to avoid query performance degradation.

  • You can specify a parent group only when you create a group. A group cannot be moved after creation. If you do not specify a parent group, the group becomes a root group.

  • Groups support a maximum nesting depth of 10 levels.

Sample API calls

1. Create a group

To create a root group, set is_root to true. To create a non-root group, set is_root to false and specify parent_group_id.

Sample request

// Create a root group.
{
  "group_name": "Enterprise A", 
  "is_root": true
}

// Create an R&D department in Enterprise A.
{
  "group_name": "R&D department", 
  "is_root": false,
  "parent_group_id": "testParentGroupId"
}

Sample success response

{
  "domain_id": "testDomainId",
  "group_id": "testGroupId",
  "group_name": "testGroupName",
  "description": "",
  "created_at": 1677335855709,
  "updated_at": 1677335855709,
  "creator": "",
  "permission": null
}

2. List group members

To list all root groups, leave group_id unspecified.

Sample request

{
  "group_id": "testGroupId", 
  "limit": 100
}

Sample success response

{
  "group_items": [
    {
      "domain_id": "testDomainId",
      "group_id": "testGroupId",
      "group_name": "R&D department",
      "description": "",
      "created_at": 1677336367210,
      "updated_at": 1677336367210,
      "creator": "",
      "permission": null
    }
  ],
  "user_items": [],
  "next_marker": ""

3. Add a user to a group

This operation adds only users to groups. To add a group to a parent group, specify parent_group_id when you create the child group.

Sample request

{
  "group_id": "testGroupId",
  "member_id": "testMemberId",
  "member_type": "user"
}

Sample response

204 NoContent

4. Remove a user from a group

This operation removes only users from groups. To delete a group, remove all its members first and then delete the group.

Sample request

{
  "group_id": "testGroupId",
  "member_id": "testMemberId",
  "member_type": "user"
}

Sample response

204 NoContent

5. Delete a group

You can delete only groups that have no members.

Sample request

{
  "group_id": "testGroupId"
}

Sample response

204 NoContent