Method: groups.list

Retrieves all groups of a domain or of a user given a userKey (paginated).

HTTP request

GET https://admin.googleapis.com/admin/directory/v1/groups

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
customer

string

The unique ID for the customer's Google Workspace account. In case of a multi-domain account, to fetch all groups for a customer, use this field instead of domain. You can also use the my_customer alias to represent your account's customerId. The customerId is also returned as part of the Users resource. You must provide either the customer or the domain parameter.

domain

string

The domain name. Use this field to get groups from only one domain. To return all domains for a customer account, use the customer query parameter instead.

maxResults

integer

Maximum number of results to return. Max allowed value is 200.

orderBy

enum (OrderBy)

Column to use for sorting results

pageToken

string

Token to specify next page in the list

query

string

Query string search. Should be of the form "". Complete documentation is at https: //developers.google.com/admin-sdk/directory/v1/guides/search-groups

sortOrder

enum (SortOrder)

Whether to return results in ascending or descending order. Only of use when orderBy is also used

userKey

string

Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object. Cannot be used with the customer parameter.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "kind": string,
  "etag": string,
  "groups": [
    {
      object (Group)
    }
  ],
  "nextPageToken": string
}
Fields
kind

string

Kind of resource this is.

etag

string

ETag of the resource.

groups[]

object (Group)

A list of group objects.

nextPageToken

string

Token used to access next page of this result.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://apps-apis.google.com/a/feeds/groups/
  • https://www.googleapis.com/auth/admin.directory.group
  • https://www.googleapis.com/auth/admin.directory.group.readonly

For more information, see the Authorization guide.

OrderBy

Enums
EMAIL Email of the group.

SortOrder

Enums
ASCENDING Ascending order.
DESCENDING Descending order.