Groups Service

  • The Google Groups service allows scripts to access information about Google Groups, such as email addresses or member lists.

  • The GroupsApp class provides access to Google Groups information and methods like getGroups() to retrieve the groups a user is a direct member of.

  • The Group class represents a group object, allowing queries about members and their roles.

  • The Role class defines the possible roles a user can have within a group, such as owner, manager, or member.

This service allows scripts to access Google Groups. It can be used to query information such as a group's email address, or the list of groups in which the user is a direct member. Here's an example that shows how many groups the current user is a member of:

var groups = GroupsApp.getGroups();
Logger.log('You are a member of %s Google Groups.', groups.length);

Classes

NameBrief description
GroupA group object whose members and those members' roles within the group can be queried.
GroupsAppThis class provides access to Google Groups information.
RolePossible roles of a user within a group, such as owner or ordinary member.

Group

GroupsApp

Properties

PropertyTypeDescription
RoleRole

Methods

MethodReturn typeBrief description
getGroupByEmail(email)GroupRetrieves the group having the specified email address.
getGroups()Group[]Retrieves all the groups of which you are a direct member (or a pending member).

Role

Properties

PropertyTypeDescription
OWNEREnumThe owner of a group.
MANAGEREnumThe manager of a group.
MEMBEREnumA user who is a member of this group but is neither an owner nor a manager.
INVITEDEnumA user who has been invited to join a group by an owner or manager of the group but who has not yet accepted the invitation.
PENDINGEnumA user who has requested to join a group but who has not yet been approved by an owner or manager.
BANNEDEnumA user who has been banned from a group and cannot attempt to join it.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.