Search for Team Drives

Domain administrators can search for all Team Drives in the organization by setting the useDomainAdminAccess parameter with the teamdrives.list method.

Use the q parameter to do a search query combining one or more search clauses. Each search clause is made up of three parts.

Attribute of the Team Drive that is searched, e.g., the attribute name of the Team Drive.
Test that is performed on the data to provide a match, e.g., contains.
The content of the attribute that is tested, e.g. the name of the Team Drive My cool project.

Combine clauses with the conjunctions and or or, and negate the query with not.

Valid fields for teamdrives.list

Field Value Type Operators Description
name5 string contains, =, != Name of the Team Drive.
createdTime5 date <=, <, =, !=, >, >= Date when the Team Drive was created.
memberCount5 number <=, <, =, !=, >, >= Number of users and groups that are members of the Team Drive.
organizerCount5 number <=, <, =, !=, >, >= Number of users and groups that are organizers of the Team Drive.

Value types

Value Type Notes
String Surround with single quotes '. Escape single quotes in queries with \', e.g., 'Valentine\'s Day'.
Boolean true or false.
Date RFC 3339 format, default timezone is UTC, e.g., 2012-06-04T12:00:00-08:00.
Number A numerical value.


Operator Notes
contains The content of one string is present in the other.
= The content of a string or boolean is equal to the other.
!= The content of a string or boolean is not equal to the other.
< A value is less than another
<= A value is less than or equal to another.
> A value is later than another.
>= A value is later than or equal to another.
and Return items that match both clauses.
or Return items that match either clause.
not Negates a search clause.

For compound clauses, you can use parentheses to group clauses together. For example:

createdTime > '2019-01-01T12:00:00' and (organizerCount > 5 or memberCount > 20)

This search returns all Team Drives created after January 1st, 2019 that have more than 5 organizers or more than 20 members. Because and and or operators are evaluated from left to right, without parentheses the above example would return only Team Drives with more than 5 organizers that were created after January 1st, 2019, but would return all Team Drives with more than 20 members, even those created before January 1st, 2019.


All examples on this page show the unencoded q parameter, where organizerCount = 0 is encoded as organizerCount+%3d+0. Client libraries handle this encoding automatically.

Examples for teamdrives.list

Search for Team Drives with no assigned organizer

organizerCount = 0

Search for Team Drives created after June 1, 2017

createdTime > '2017-06-01T12:00:00'

Search for Team Drives with the word 'confidential' in the title and 20 or more members

name contains 'confidential' and memberCount >= 20

Using client libraries

The following examples show how to perform a teamdrives.list request:


TeamDrive teamDriveMetadata = new TeamDrive();
teamDriveMetadata.setName("Project Resources");
String requestId = UUID.randomUUID().toString();
TeamDrive teamDrive = driveService.teamdrives().create(requestId,
System.out.println("Team Drive ID: " + teamDrive.getId());


team_drive_metadata = {'name': 'Project Resources'}
request_id = str(uuid.uuid4())
team_drive = drive_service.teamdrives().create(body=team_drive_metadata,
print 'Team Drive ID: %s' % team_drive.get('id')


$teamDriveMetadata = new Google_Service_Drive_TeamDrive(array(
    'name' => 'Project Resources'));
$requestId = Uuid::uuid4()->toString();
$teamDrive = $driveService->teamdrives->create($requestId, $teamDriveMetadata, array(
    'fields' => 'id'));
printf("Team Drive ID: %s\n", $teamDrive->id);


var teamDriveMetadata = new TeamDrive()
    Name = "Project Resources"
var requestId = System.Guid.NewGuid().ToString();
var request = driveService.Teamdrives.Create(teamDriveMetadata, requestId);
request.Fields = "id";
var teamDrive = request.Execute();
Console.WriteLine("Team Drive ID: " + teamDrive.Id);


team_drive_metadata = {
    name: 'Project Resources'
request_id = SecureRandom.uuid
team_drive = drive_service.create_teamdrive(request_id,
                                            fields: 'id')
puts "Team Drive Id: #{}"


var teamDriveMetadata = {
  'name': 'Project resources'
var requestId = uuid.v4();
  resource: teamDriveMetadata,
  requestId: requestId,
  fields: 'id'
}, function (err, teamDrive) {
  if (err) {
    // Handle error
  } else {
    console.log('Team Drive Id: ',;

Send feedback about...

Need help? Visit our support page.