Google Groups

Overview

The Google Groups connector enables your AI Colleagues to integrate with your organization's Google Workspace platform, facilitating automated group management, membership administration, and group settings configuration workflows.

Google Groups is Google's collaboration and communication service that allows organizations to create mailing lists, discussion forums, and shared inboxes. The Google Groups connector allows Leena AI to automate group workflows, manage memberships, configure group settings, and interact with groups seamlessly.

API Details

Leena AI integrates with Google Groups via REST APIs.

Documentation link: https://developers.google.com/admin-sdk/directory/v1/guides/manage-groups

Setup

The Google Groups connector uses Service Account authentication with domain-wide delegation for administrative operations.

Prerequisites

Before setting up the Google Groups connector, ensure you have:

  • Administrator access to your Google Cloud Console
  • Google Workspace Super Admin access to your domain
  • Google Groups for Business enabled for your domain
  • Access to Google Cloud Console API & Services
  • Ability to create Service Accounts in Google Cloud
  • Access to your Leena AI workspace with connector management permissions

Get credentials

Here is how to create a Service Account in Google Cloud Console:

  1. Log in to Google Cloud Console (Ensure you're signed in as an admin).
  2. Navigate to API & Services:
    1. Click on API & Services in the sidebar
    2. Select Credentials
  3. Enable Required APIs:
    1. Go to API & Services > Library
    2. Search for "Admin SDK API" and click Enable
    3. Search for "Groups Settings API" and click Enable
  4. Create Service Account:
    1. Navigate to IAM & Admin > Service Accounts
    2. Click + CREATE SERVICE ACCOUNT
    3. Enter a descriptive name for your service account
    4. Click CREATE AND CONTINUE
    5. Skip the optional steps and click DONE
  5. Generate Service Account Key:
    1. Click on the newly created service account
    2. Navigate to the Keys tab
    3. Click ADD KEY > Create new key
    4. Select JSON format and click CREATE
    5. Save the downloaded JSON file securely (This file contains all required credentials)
  6. Note the Client ID:
    1. In the service account details, copy the Unique ID (Client ID) - this will be needed for domain-wide delegation
  7. Configure Domain-Wide Delegation in Google Workspace Admin Console:
    1. Go to Google Workspace Admin Console (admin.google.com)
    2. Navigate to Security > Access and data control > API controls
    3. Click Manage Domain Wide Delegation
    4. Click Add new
    5. Enter the Client ID from step 6
    6. Add the following OAuth Scopes (comma-separated):
      • https://www.googleapis.com/auth/admin.directory.group
      • https://www.googleapis.com/auth/admin.directory.group.member
      • https://www.googleapis.com/auth/admin.directory.group.readonly
      • https://www.googleapis.com/auth/admin.directory.group.member.readonly
      • https://www.googleapis.com/auth/admin.directory.domain.readonly
      • https://www.googleapis.com/auth/admin.directory.user.readonly
      • https://www.googleapis.com/auth/admin.directory.user.security
      • https://www.googleapis.com/auth/apps.groups.settings
    7. Click Authorize

Add connection

Here is how to add a connection on Leena AI:

  1. Log in to your Leena AI workspace
  2. Navigate to Settings > Integrations
  3. Search for "Google Groups" and select it from the list to add its new connector
  4. Select Authentication Type as "Service Account"
  5. Configure the connector with the following fields (values from the downloaded JSON key file):
    1. Project Id: The project_id from your service account JSON file
    2. Private Key Id: The private_key_id from your service account JSON file
    3. Private Key: The private_key from your service account JSON file
    4. Client Email: The client_email from your service account JSON file
    5. Client Id: The client_id from your service account JSON file
    6. Token URL: Token endpoint URL (Pre-filled with 'https://oauth2.googleapis.com/token')
    7. Certificate URL: Auth provider certificate URL (Pre-filled with 'https://www.googleapis.com/oauth2/v1/certs')
    8. Client X509 Certificate URL: The client_x509_cert_url from your service account JSON file
    9. Universe Domain: Google API domain (Pre-filled with 'googleapis.com')
    10. Admin Email: Email address of a Google Workspace Super Admin (Required for domain-wide delegation to impersonate admin actions)
    11. Customer/Domain Search: Toggle to choose between Customer ID or Domain-based filtering
      • If OFF: Enter your Domain (e.g., company.com)
      • If ON: Enter your Customer ID (e.g., C03az79cb or use 'my_customer')
  6. Save Configurations and Test Connection
    1. Click Save to store the connector configuration
    2. Test the connection to verify authentication is working

Actions

The following actions are supported for the Google Groups connector:

List group

Retrieves a list of groups from your Google Workspace domain. This action can be leveraged by Leena AI Orchestrator/Agent to list down all groups or filter groups based on specific criteria. Here are some common use cases:

  • Domain Overview: Get all groups in the organization
  • Group Search: Find groups by name or email prefix
  • User Groups: List all groups a specific user belongs to
  • Audit and Compliance: Review group inventory

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

None - all parameters are optional for listing groups.

Optional

NameDescription
Member SearchToggle to search groups by user membership instead of group properties
QuerySearch filter containing field (Group email/Group name), operator (Equal/Prefix), and field value
User KeyEmail or ID of user to list groups for (when Member Search is enabled)
Max ResultsMaximum number of results to return per page (default: 200, max: 200)
Order ByProperty to sort results by (email)
Sort OrderSort order for results: ascending or descending
Page TokenToken for pagination to retrieve next page of results

Here is a sample JSON input:

{
  "query": [
    {
      "field": "email",
      "operator": "PREFIX",
      "fieldValue": "sales"
    }
  ],
  "maxResults": 50,
  "orderBy": "email",
  "sortOrder": "ascending"
}
// List groups for a specific user

{
  "memberSearch": true,
  "userKey": "[email protected]",
  "maxResults": 100
}

Response

The action returns a list of groups, each containing:

  • Group ID
  • Group Email
  • Group Name
  • Description
  • Direct Members Count
  • Aliases
  • Admin Created flag

Get group

Retrieves detailed information about a specific Google Group. The Agent can leverage this action to fetch group details when a user needs information about a particular group.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address, group alias, or unique group ID

Here is a sample JSON input:

{
  "groupKey": "[email protected]"
}

Response

Upon successful retrieval, the action returns the group details including:

  • Group ID
  • Group Email
  • Group Name
  • Description
  • Direct Members Count
  • Aliases
  • Non-Editable Aliases
  • Admin Created flag

Create group

Creates a new Google Group in your Google Workspace domain. The Agent can leverage the skill (workflow), which has been designed to create a new group, once the user raises a query to do so.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
EmailThe email address for the new group (e.g., [email protected])

Optional

NameDescription
Display NameThe display name of the group
DescriptionA description of the group's purpose

Here is a sample JSON input:

{
  "email": "[email protected]",
  "name": "Sales Team",
  "description": "This is the Sales team group for internal communications."
}

Response

Upon successful creation, the action returns the created group details including:

  • Group ID
  • Group Email
  • Group Name
  • Direct Members Count
  • Admin Created flag

Delete group

Permanently deletes a Google Group from your Google Workspace domain. The Agent can leverage the skill (workflow), which has been designed to remove a group, once the user specifies the group to be deleted. Here are some common use cases:

  • Cleanup: Remove obsolete or unused groups
  • Reorganization: Delete groups as part of org restructuring
  • Compliance: Remove groups that violate policies

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address, group alias, or unique group ID to delete

Here is a sample JSON input:

{
  "groupKey": "[email protected]"
}

Response

Upon successful deletion, the action returns:

  • Confirmation of successful deletion
  • HTTP 200 status code

Get group settings

Retrieves the current settings configuration for a Google Group, including permissions, moderation levels, and access controls.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address

Here is a sample JSON input:

{
  "groupUniqueId": "[email protected]"
}

Response

The action returns comprehensive group settings including:

  • Email and Name
  • Description
  • Who Can Join
  • Who Can View Membership
  • Who Can View Group
  • Who Can Post Message
  • Who Can Invite
  • Allow External Members
  • Message Moderation Level
  • Spam Moderation Level
  • Is Archived
  • Include In Global Address List
  • Members Can Post As The Group
  • And many more configuration options

List group members

Retrieves a list of all members in a Google Group. This action can be leveraged to audit group membership or display member lists. Here are some common use cases:

  • Membership Audit: Review who has access to a group
  • Compliance Check: Verify membership meets policies
  • Reporting: Generate group membership reports

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address or unique group ID

Optional

NameDescription
Include Derived MembershipWhether to include members from nested groups (default: false)
Max ResultsMaximum number of results to return per page (default: 200, max: 200)
Page TokenToken for pagination to retrieve next page of results
RolesFilter members by role: OWNER, MANAGER, or MEMBER

Here is a sample JSON input:

{
  "groupKey": "[email protected]",
  "roles": "OWNER",
  "maxResults": 100,
  "includeDerivedMembership": false
}
// List all members with pagination

{
  "groupKey": "[email protected]",
  "maxResults": 200,
  "pageToken": "next_page_token_value"
}

Response

The action returns a list of members, each containing:

  • Member ID
  • Member Email
  • Role (Owner, Manager, or Member)
  • Type (User or Group)
  • Status
  • Delivery Settings

Get Member details from group

Retrieves detailed information about a specific member's status within a group, including their role and delivery preferences.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address or unique group ID
MemberThe member's email address, alias, or unique user ID

Here is a sample JSON input:

{
  "groupKey": "[email protected]",
  "memberKey": "[email protected]"
}

Response

The action returns detailed member information including:

  • Member ID
  • Member Email
  • Role
  • Type (User or Group)
  • Status
  • Delivery Settings

Group member check

Verifies whether a specific user is a member of a Google Group. The Agent can leverage this action to check membership status for access control or verification purposes.

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address or unique group ID
MemberThe member's email address, alias, or unique user ID to check

Here is a sample JSON input:

{
  "groupKey": "[email protected]",
  "memberKey": "[email protected]"
}

Response

Upon successful check, the action returns:

  • isMember (boolean indicating membership status)

If the user is not a member, the action returns an appropriate error response.

Add to Group member

Adds one or more members to a Google Group. The Agent can leverage this action to add users to groups with specific roles and delivery settings. Here are some common use cases:

  • Onboarding: Add new employees to relevant groups
  • Project Teams: Add team members to project-specific groups
  • Distribution Lists: Add recipients to mailing lists

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address or unique group ID
UsersArray of members to add, each containing email(s), role, and delivery settings

Optional (per user)

NameDescription
RoleThe role for the member in the group. Options: OWNER, MANAGER, MEMBER (default: MEMBER)
Delivery SettingsHow the member receives group emails. Options: ALL_MAIL, DAILY, DIGEST, DISABLED, NONE

Here is a sample JSON input:

{
  "groupKey": "[email protected]",
  "users": [
    {
      "emails": ["[email protected]"],
      "role": "MEMBER",
      "deliverySettings": "ALL_MAIL"
    }
  ]
}
// Add multiple members with different roles

{
  "groupKey": "[email protected]",
  "users": [
    {
      "emails": ["[email protected]", "[email protected]"],
      "role": "MEMBER",
      "deliverySettings": "ALL_MAIL"
    },
    {
      "emails": ["[email protected]"],
      "role": "MANAGER",
      "deliverySettings": "DAILY"
    },
    {
      "emails": ["[email protected]"],
      "role": "OWNER",
      "deliverySettings": "DIGEST"
    }
  ]
}

Response

Upon successful addition, the action returns for each member:

  • Member ID
  • Member Email
  • Role
  • Type (User or Group)
  • Delivery Settings
  • Status

Remove Group member

Removes one or more members from a Google Group. The Agent can leverage this action to remove users from groups. Here are some common use cases:

  • Offboarding: Remove departing employees from groups
  • Role Changes: Remove members who no longer need access
  • Cleanup: Remove inactive members

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
GroupThe group's email address or unique group ID
MembersArray of member email addresses or unique IDs to remove

Here is a sample JSON input:

{
  "groupKey": "[email protected]",
  "memberKeys": ["[email protected]"]
}
// Remove multiple members

{
  "groupKey": "[email protected]",
  "memberKeys": [
    "[email protected]",
    "[email protected]",
    "[email protected]"
  ]
}

Response

Upon successful removal, the action returns:

  • Confirmation of successful removal for each member
  • HTTP 200 status code