Skip to main content

Overview

Enable your agents to manage contacts and directory information through Google Contacts. Access personal contacts, search directory people, create and update contact information, and manage contact groups with AI-powered automation.

Prerequisites

Before using the Google Contacts integration, ensure you have:
  • A CrewAI AMP account with an active subscription
  • A Google account with Google Contacts access
  • Connected your Google account through the Integrations page

Setting Up Google Contacts Integration

1. Connect Your Google Account

  1. Navigate to CrewAI AMP Integrations
  2. Find Google Contacts in the Authentication Integrations section
  3. Click Connect and complete the OAuth flow
  4. Grant the necessary permissions for contacts and directory access
  5. Copy your Enterprise Token from Integration Settings

2. Install Required Package

3. Environment Variable Setup

To use integrations with Agent(apps=[]), you must set the CREWAI_PLATFORM_INTEGRATION_TOKEN environment variable with your Enterprise Token.
Or add it to your .env file:

Available Actions

Description: Retrieve user’s contacts from Google Contacts.Parameters:
  • pageSize (integer, optional): Number of contacts to return (max 1000). Minimum: 1, Maximum: 1000
  • pageToken (string, optional): The token of the page to retrieve.
  • personFields (string, optional): Fields to include (e.g., ‘names,emailAddresses,phoneNumbers’). Default: names,emailAddresses,phoneNumbers
  • requestSyncToken (boolean, optional): Whether the response should include a sync token. Default: false
  • sortOrder (string, optional): The order in which the connections should be sorted. Options: LAST_MODIFIED_ASCENDING, LAST_MODIFIED_DESCENDING, FIRST_NAME_ASCENDING, LAST_NAME_ASCENDING
Description: Search for contacts using a query string.Parameters:
  • query (string, required): Search query string
  • readMask (string, required): Fields to read (e.g., ‘names,emailAddresses,phoneNumbers’)
  • pageSize (integer, optional): Number of results to return. Minimum: 1, Maximum: 30
  • pageToken (string, optional): Token specifying which result page to return.
  • sources (array, optional): The sources to search in. Options: READ_SOURCE_TYPE_CONTACT, READ_SOURCE_TYPE_PROFILE. Default: READ_SOURCE_TYPE_CONTACT
Description: List people in the authenticated user’s directory.Parameters:
  • sources (array, required): Directory sources to search within. Options: DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE, DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT. Default: DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE
  • pageSize (integer, optional): Number of people to return. Minimum: 1, Maximum: 1000
  • pageToken (string, optional): Token specifying which result page to return.
  • readMask (string, optional): Fields to read (e.g., ‘names,emailAddresses’)
  • requestSyncToken (boolean, optional): Whether the response should include a sync token. Default: false
  • mergeSources (array, optional): Additional data to merge into the directory people responses. Options: CONTACT
Description: Search for people in the directory.Parameters:
  • query (string, required): Search query
  • sources (string, required): Directory sources (use ‘DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE’)
  • pageSize (integer, optional): Number of results to return
  • readMask (string, optional): Fields to read
Description: List other contacts (not in user’s personal contacts).Parameters:
  • pageSize (integer, optional): Number of contacts to return. Minimum: 1, Maximum: 1000
  • pageToken (string, optional): Token specifying which result page to return.
  • readMask (string, optional): Fields to read
  • requestSyncToken (boolean, optional): Whether the response should include a sync token. Default: false
Description: Search other contacts.Parameters:
  • query (string, required): Search query
  • readMask (string, required): Fields to read (e.g., ‘names,emailAddresses’)
  • pageSize (integer, optional): Number of results
Description: Get a single person’s contact information by resource name.Parameters:
  • resourceName (string, required): The resource name of the person to get (e.g., ‘people/c123456789’)
  • personFields (string, optional): Fields to include (e.g., ‘names,emailAddresses,phoneNumbers’). Default: names,emailAddresses,phoneNumbers
Description: Create a new contact in the user’s address book.Parameters:
  • names (array, optional): Person’s names
  • emailAddresses (array, optional): Email addresses
  • phoneNumbers (array, optional): Phone numbers
  • addresses (array, optional): Postal addresses
  • organizations (array, optional): Organizations/companies
Description: Update an existing contact’s information.Parameters:
  • resourceName (string, required): The resource name of the person to update (e.g., ‘people/c123456789’)
  • updatePersonFields (string, required): Fields to update (e.g., ‘names,emailAddresses,phoneNumbers’)
  • names (array, optional): Person’s names
  • emailAddresses (array, optional): Email addresses
  • phoneNumbers (array, optional): Phone numbers
Description: Delete a contact from the user’s address book.Parameters:
  • resourceName (string, required): The resource name of the person to delete (e.g., ‘people/c123456789’)
Description: Get information about multiple people in a single request.Parameters:
  • resourceNames (array, required): Resource names of people to get. Maximum: 200 items
  • personFields (string, optional): Fields to include (e.g., ‘names,emailAddresses,phoneNumbers’). Default: names,emailAddresses,phoneNumbers
Description: List the user’s contact groups (labels).Parameters:
  • pageSize (integer, optional): Number of contact groups to return. Minimum: 1, Maximum: 1000
  • pageToken (string, optional): Token specifying which result page to return.
  • groupFields (string, optional): Fields to include (e.g., ‘name,memberCount,clientData’). Default: name,memberCount
Description: Get a specific contact group by resource name.Parameters:
  • resourceName (string, required): The resource name of the contact group (e.g., ‘contactGroups/myContactGroup’)
  • maxMembers (integer, optional): Maximum number of members to include. Minimum: 0, Maximum: 20000
  • groupFields (string, optional): Fields to include (e.g., ‘name,memberCount,clientData’). Default: name,memberCount
Description: Create a new contact group (label).Parameters:
  • name (string, required): The name of the contact group
  • clientData (array, optional): Client-specific data
Description: Update a contact group’s information.Parameters:
  • resourceName (string, required): The resource name of the contact group (e.g., ‘contactGroups/myContactGroup’)
  • name (string, required): The name of the contact group
  • clientData (array, optional): Client-specific data
Description: Delete a contact group.Parameters:
  • resourceName (string, required): The resource name of the contact group to delete (e.g., ‘contactGroups/myContactGroup’)
  • deleteContacts (boolean, optional): Whether to delete contacts in the group as well. Default: false

Usage Examples

Basic Google Contacts Agent Setup

Directory Search and Management

Contact Creation and Updates

Contact Group Management

Comprehensive Contact Management

Troubleshooting

Common Issues

Permission Errors
  • Ensure your Google account has appropriate permissions for contacts access
  • Verify that the OAuth connection includes required scopes for Google Contacts API
  • Check that directory access permissions are granted for organization contacts
Resource Name Format Issues
  • Ensure resource names follow the correct format (e.g., ‘people/c123456789’ for contacts)
  • Verify that contact group resource names use the format ‘contactGroups/groupId’
  • Check that resource names exist and are accessible
Search and Query Issues
  • Ensure search queries are properly formatted and not empty
  • Use appropriate readMask fields for the data you need
  • Verify that search sources are correctly specified (contacts vs profiles)
Contact Creation and Updates
  • Ensure required fields are provided when creating contacts
  • Verify that email addresses and phone numbers are properly formatted
  • Check that updatePersonFields parameter includes all fields being updated
Directory Access Issues
  • Ensure you have appropriate permissions to access organization directory
  • Verify that directory sources are correctly specified
  • Check that your organization allows API access to directory information
Pagination and Limits
  • Be mindful of page size limits (varies by endpoint)
  • Use pageToken for pagination through large result sets
  • Respect API rate limits and implement appropriate delays
Contact Groups and Organization
  • Ensure contact group names are unique when creating new groups
  • Verify that contacts exist before adding them to groups
  • Check that you have permissions to modify contact groups

Getting Help

Need Help?

Contact our support team for assistance with Google Contacts integration setup or troubleshooting.