Box Developer Documentation

Join BoxWorks 2024 to discover what's possible with content and AI!

Register now!

List groups for enterprise

get
https://api.box.com/2.0
/groups

Retrieves all of the groups for a given enterprise. The user must have admin permissions to inspect enterprise's groups.

Request

bearer [ACCESS_TOKEN]
application/json

Query Parameters

string arrayin queryoptional
id,type,name

A comma-separated list of attributes to include in the response. This can be used to request fields that are not normally returned in a standard response.

Be aware that specifying this parameter will have the effect that none of the standard fields are returned in the response unless explicitly specified, instead only fields for the mini representation are returned, additional to the fields requested.

stringin queryoptional
Engineering

Limits the results to only groups whose name starts with the search term.

integer (int64)in queryoptional
10001000

The maximum number of items to return per page.

integer (int64)in queryoptional
10000

The offset of the item at which to begin the response.

Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.

Response

application/jsonGroups

Returns a collection of group objects. If there are no groups, an empty collection will be returned.

application/jsonClient error

An unexpected client error.

get
List groups for enterprise
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X GET "https://api.box.com/2.0/groups" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
TypeScript Gen
await client.groups.getGroups();
Python Gen
client.groups.get_groups()
.NET Gen
await client.Groups.GetGroupsAsync();
Swift Gen (Beta)
try await client.groups.getGroups()
Java
Iterable<BoxGroup.Info> groups = BoxGroup.getAllGroups(api);
for (BoxGroup.Info groupInfo : groups) {
    // Do something with the group.
}
Python
groups = client.get_groups()
for group in groups:
    print(f'Group "{group.name}" has ID "{group.id}"')
.NET
BoxCollection<BoxGroup> groups = await client.GroupsManager.GetAllGroupsAsync();
Node
client.groups.getAll()
	.then(groups => {
		/* groups -> {
			total_count: 1,
			entries: [ { type: 'group', id: '1786931', name: 'friends' } ],
			limit: 100,
			offset: 0 }
		*/
	});
iOS
let iterator = client.groups.listForEnterprise()
iterator.next { results in
    switch results {
    case let .success(page):
        for group in page.entries {
            print("Group with name \(group.name) retrieved")
        }

    case let .failure(error):
        print(error)
    }
}

Response Example

{
  "entries": [
    {
      "id": "11446498",
      "type": "group",
      "name": "Support",
      "group_type": "managed_group",
      "created_at": "2012-12-12T10:53:43-08:00",
      "modified_at": "2012-12-12T10:53:43-08:00",
      "provenance": "Active Directory",
      "external_sync_identifier": "AD:123456",
      "description": "Support Group - as imported from Active Directory",
      "invitability_level": "admins_only",
      "member_viewability_level": "admins_only",
      "permissions": {
        "can_invite_as_collaborator": true
      }
    }
  ],
  "limit": 1000,
  "offset": 2000,
  "order": [
    {
      "by": "type",
      "direction": "ASC"
    }
  ],
  "total_count": 5000
}