> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tracecat.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Drive

> Reference for the Tracecat Google Drive integration: registered actions, required secrets, expected inputs, and example workflow usage.

## Add Drive permission

Action ID: `tools.google_drive.add_permission`

Grant access to a file or folder.

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="email" type="string" required>
  Email address to grant access to
</ParamField>

<ParamField path="file_id" type="string" required>
  The file or folder ID
</ParamField>

<ParamField path="fields" type="string">
  Fields to return ('\*' for all)

  Default: `"*"`.
</ParamField>

<ParamField path="role" type="string">
  Role: reader, writer, commenter, owner

  Default: `"reader"`.
</ParamField>

<ParamField path="send_notification" type="boolean">
  Send email notification

  Default: `false`.
</ParamField>

## Create Drive folder

Action ID: `tools.google_drive.create_folder`

Create a new folder in Google Drive.

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="folder_name" type="string" required>
  Name for the new folder
</ParamField>

<ParamField path="fields" type="string">
  Fields to return ('\*' for all)

  Default: `"*"`.
</ParamField>

<ParamField path="parent_folder_id" type="string">
  Parent folder ID (empty = root)

  Default: `""`.
</ParamField>

## Delete Drive file

Action ID: `tools.google_drive.delete_file`

Move a file or folder to trash.

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="file_id" type="string" required>
  The file or folder ID to delete
</ParamField>

<ParamField path="fields" type="string">
  Fields to return ('\*' for all)

  Default: `"*"`.
</ParamField>

## Get Drive file

Action ID: `tools.google_drive.get_file`

Get detailed metadata for a specific file.

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="file_id" type="string" required>
  The file ID
</ParamField>

<ParamField path="fields" type="string">
  Fields to return ('\*' for all)

  Default: `"*"`.
</ParamField>

## Get Drive file permissions

Action ID: `tools.google_drive.get_file_permissions`

List all permissions for a file or folder.

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="file_id" type="string" required>
  The file ID
</ParamField>

<ParamField path="fields" type="string">
  Fields to return ('\*' for all)

  Default: `"*"`.
</ParamField>

## List Drive files

Action ID: `tools.google_drive.list_files`

List and search files in Google Drive.

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="fields" type="string">
  Fields to return (e.g., 'files(id,name,mimeType)' or '\*' for all)

  Default: `"*"`.
</ParamField>

<ParamField path="max_results" type="integer">
  Maximum number of results

  Default: `10`.
</ParamField>

<ParamField path="order_by" type="string">
  Sort order

  Default: `"modifiedTime desc"`.
</ParamField>

<ParamField path="query" type="string">
  Search query (e.g., 'name contains "report"')

  Default: `""`.
</ParamField>

## Permanently delete Drive file

Action ID: `tools.google_drive.permanently_delete_file`

Permanently delete a file or folder (bypass trash).

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="file_id" type="string" required>
  The file or folder ID to permanently delete
</ParamField>

## Revoke Drive permission

Action ID: `tools.google_drive.revoke_permission`

Remove a permission (revoke access).

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="file_id" type="string" required>
  The file or folder ID
</ParamField>

<ParamField path="permission_id" type="string" required>
  The permission ID to revoke
</ParamField>

## Update Drive permission

Action ID: `tools.google_drive.update_permission`

Update an existing permission (change role).

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="file_id" type="string" required>
  The file or folder ID
</ParamField>

<ParamField path="permission_id" type="string" required>
  The permission ID to update
</ParamField>

<ParamField path="role" type="string" required>
  New role: reader, writer, commenter
</ParamField>

<ParamField path="fields" type="string">
  Fields to return ('\*' for all)

  Default: `"*"`.
</ParamField>

## Upload Drive file

Action ID: `tools.google_drive.upload_file`

Upload a file to Google Drive.

### Secrets

Required secrets:

* `google_drive_oauth`: OAuth token `GOOGLE_DRIVE_USER_TOKEN`.

### Input fields

<ParamField path="file_content" type="string" required>
  Base64-encoded file content
</ParamField>

<ParamField path="file_name" type="string" required>
  Name for the uploaded file
</ParamField>

<ParamField path="fields" type="string">
  Fields to return ('\*' for all)

  Default: `"*"`.
</ParamField>

<ParamField path="mime_type" type="string">
  MIME type of file

  Default: `"application/octet-stream"`.
</ParamField>

<ParamField path="parent_folder_id" type="string">
  Parent folder ID (empty = root)

  Default: `""`.
</ParamField>
