> ## 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 API

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

## Call API

Action ID: `tools.google_api.call_api`

Call a Google API method.

Reference: [https://googleapis.github.io/google-api-python-client/docs/dyn/](https://googleapis.github.io/google-api-python-client/docs/dyn/)

### Secrets

Optional secrets:

* `google_oauth`: OAuth token `GOOGLE_SERVICE_TOKEN`.
* `google_api`: required values `GOOGLE_API_CREDENTIALS`; optional values `GOOGLE_API_SUBJECT`.

### Input fields

<ParamField path="method_name" type="string" required>
  Google API method name, e.g. `list` or `get`.
</ParamField>

<ParamField path="resource" type="string" required>
  Resource path, e.g. `files` or `spreadsheets.values`.
</ParamField>

<ParamField path="service_name" type="string" required>
  Google API service name, e.g. `drive` or `sheets`.
</ParamField>

<ParamField path="version" type="string" required>
  Google API version, e.g. `v3` or `v4`.
</ParamField>

<ParamField path="access_token" type="string | null">
  OAuth access token from a Tracecat OAuth integration, e.g. `$&#123;&#123; SECRETS.google_drive_oauth.GOOGLE_DRIVE_USER_TOKEN || SECRETS.google_drive_oauth.GOOGLE_DRIVE_SERVICE_TOKEN &#125;&#125;`. When set it is used as-is and `scopes`/`subject` are ignored.

  Default: `null`.
</ParamField>

<ParamField path="media" type="GoogleMediaUpload | null">
  File content for upload methods (e.g. Drive `files.create`). Sent as `media_body`.

  Default: `null`.
</ParamField>

<ParamField path="params" type="GoogleAPIParams | null">
  Parameters for the Google API method.

  Default: `null`.
</ParamField>

<ParamField path="scopes" type="array[string] | null">
  Scopes used when minting a token from `GOOGLE_API_CREDENTIALS`. Defaults to \["[https://www.googleapis.com/auth/cloud-platform](https://www.googleapis.com/auth/cloud-platform)"].

  Default: `null`.
</ParamField>

<ParamField path="static_discovery" type="boolean | null">
  Whether to use the discovery document bundled with the client library. Defaults to the library behaviour (bundled). Set to false to fetch the discovery document at runtime, which is required for API versions that are not bundled (e.g. `securitycenter` `v2`).

  Default: `null`.
</ParamField>

<ParamField path="subject" type="string | null">
  Optional domain-wide delegation subject (user email) applied when minting from `GOOGLE_API_CREDENTIALS`. Defaults to the `GOOGLE_API_SUBJECT` secret key, then the `subject` key inside the JSON.

  Default: `null`.
</ParamField>

## Call paginated API

Action ID: `tools.google_api.call_paginated_api`

Call a paginated Google API method and return every page fetched.

Reference: [https://googleapis.github.io/google-api-python-client/docs/dyn/](https://googleapis.github.io/google-api-python-client/docs/dyn/)

### Secrets

Optional secrets:

* `google_oauth`: OAuth token `GOOGLE_SERVICE_TOKEN`.
* `google_api`: required values `GOOGLE_API_CREDENTIALS`; optional values `GOOGLE_API_SUBJECT`.

### Input fields

<ParamField path="method_name" type="string" required>
  Google API method name, e.g. `list` or `get`.
</ParamField>

<ParamField path="resource" type="string" required>
  Resource path, e.g. `files` or `spreadsheets.values`.
</ParamField>

<ParamField path="service_name" type="string" required>
  Google API service name, e.g. `drive` or `sheets`.
</ParamField>

<ParamField path="version" type="string" required>
  Google API version, e.g. `v3` or `v4`.
</ParamField>

<ParamField path="access_token" type="string | null">
  OAuth access token from a Tracecat OAuth integration, e.g. `$&#123;&#123; SECRETS.google_drive_oauth.GOOGLE_DRIVE_USER_TOKEN || SECRETS.google_drive_oauth.GOOGLE_DRIVE_SERVICE_TOKEN &#125;&#125;`. When set it is used as-is and `scopes`/`subject` are ignored.

  Default: `null`.
</ParamField>

<ParamField path="max_pages" type="integer | null">
  Maximum number of pages to fetch. If null, fetches every page.

  Default: `null`.
</ParamField>

<ParamField path="next_page_token_path" type="string">
  Dot-separated response path for the next page token. Defaults to "nextPageToken".

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

<ParamField path="page_token_param" type="string">
  Request parameter name for the next page token. Defaults to "pageToken".

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

<ParamField path="params" type="GoogleAPIParams | null">
  Parameters for the Google API method.

  Default: `null`.
</ParamField>

<ParamField path="scopes" type="array[string] | null">
  Scopes used when minting a token from `GOOGLE_API_CREDENTIALS`. Defaults to \["[https://www.googleapis.com/auth/cloud-platform](https://www.googleapis.com/auth/cloud-platform)"].

  Default: `null`.
</ParamField>

<ParamField path="static_discovery" type="boolean | null">
  Whether to use the discovery document bundled with the client library. Defaults to the library behaviour (bundled). Set to false to fetch the discovery document at runtime, which is required for API versions that are not bundled (e.g. `securitycenter` `v2`).

  Default: `null`.
</ParamField>

<ParamField path="subject" type="string | null">
  Optional domain-wide delegation subject (user email) applied when minting from `GOOGLE_API_CREDENTIALS`. Defaults to the `GOOGLE_API_SUBJECT` secret key, then the `subject` key inside the JSON.

  Default: `null`.
</ParamField>
