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

# Google Docs integration

[Back to list of integrations](https://koreai.mintlify.site/agent-platform/integrations/enterprise-systems.md)

Use the Google Docs integration to let agents create, read, find, append to, and fill template documents through Action Tools.

| Authentication | Actions | Workflow triggers |
| - | - | - |
| OAuth 2.0 | [6](#supported-actions) | [1](#workflow-triggers) |

## Supported actions

Actions are Google Docs operations that an agent runs as Action Tools during a conversation. You can also run them from an [Integration node](https://koreai.mintlify.site/agent-platform/workflows.md#integration-node) in a workflow.

| Action | Use it to |
| - | - |
| [Create Document](#create-document) | Create a document. |
| [Read Document](#read-document) | Read a document's content. |
| [Find Document](#find-document) | Find a document by name, and optionally create it. |
| [Append text to google docs](#append-text-to-google-docs) | Append text to the end of a document. |
| [Edit template file](#edit-template-file) | Fill a template document's placeholders with values. |
| [Custom API Call](#custom-api-call) | Call any API endpoint the other actions don't cover. |

## Workflow triggers

Triggers are Google Docs events that start a workflow automatically. Select them as [app triggers](https://koreai.mintlify.site/agent-platform/workflows.md#app-triggers) when you configure a workflow.

| Trigger | Fires when |
| - | - |

## Prerequisites

* A Google Cloud project with the **Google Docs API** and **Google Drive API** enabled, and an OAuth consent screen.

## Set up the integration

**1. Create a Google OAuth client**

Create an OAuth client ID of type **Web application**, add the Artemis **Callback URL** to **Authorized redirect URIs**, and copy the **Client ID** and **Client Secret**. See [Using OAuth 2.0 to access Google APIs](https://developers.google.com/identity/protocols/oauth2).

**2. Create the auth profile**

In **Integrations**, select **Google Docs** > **Connect**. On **Project Auth Profiles**, select **New Profile** > **Integration Profile** > **Google Docs** > **Continue**. Enter the **Client ID** and **Client Secret**, select **Create Profile**, and then select **Authorize**. Artemis pre-fills the Google endpoints.&#x20;

**Usage Mode**: **Preconfigured** shares one authorization across users; **JIT** and **Preflight** ask each user to authorize, during or before the session. See [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles).

**3. Create the action tool**

In **Tools**, select **New Tool** > **Action** > **Google Docs** > **Continue**. Select the **Action** and **Auth Profile**, set parameter defaults (leave a value empty for the agent to supply at runtime), and select **Create Tool**. Then [assign the tool to an agent](https://koreai.mintlify.site/agent-platform/tools/actions.md#assign-an-action-to-an-agent).

## Action reference

> [accordion] Create Document
>
> | Parameter | Type | Description |
> | - | - | - |
> | `title` | string | Document title. |
> | `body` | string | Document content. |

> [accordion] Read Document
>
> | Parameter | Type | Description |
> | - | - | - |
> | `documentId` | string | ID of the document. |

> [accordion] Find Document
>
> | Parameter | Type | Description |
> | - | - | - |
> | `name` | string | Document name. |
> | `folderId` | enum | Folder to search. |
> | `createIfNotFound` | boolean | Creates the document if it isn't found. Default: `False`. |
> | `newDocumentProps` | object | Properties of the new document. |

> [accordion] Append text to google docs
>
> | Parameter | Type | Description |
> | - | - | - |
> | `text` | string | Text to append. |
> | `documentId` | string | ID of the document. |

> [accordion] Edit template file
>
> Replaces placeholders such as `[[name]]` or `{{name}}` with the values you provide.
>
> | Parameter | Type | Description |
> | - | - | - |
> | `template` | string | ID of the template document. |
> | `values` | object | Placeholder keys and values. Enter key names only, without `[[ ]]` or `{{ }}`. |
> | `images` | object | Image ID (from **Read Document**) mapped to an image URL. |
> | `placeholder_format` | enum | Placeholder format. Default: `Square Brackets [[]]`. |

> [accordion] Custom API Call
>
> | Parameter | Type | Description |
> | - | - | - |
> | `url` | object | Endpoint URL. |
> | `method` | enum | HTTP method. |
> | `headers` | object | Additional request headers. Artemis injects the authorization header. |
> | `queryParams` | object | Query parameters. |
> | `body_type` | enum | Body type. Default: `None`. |
> | `body` | object | Request body. |
> | `response_is_binary` | boolean | Turn on for binary responses. Default: `False`. |
> | `failsafe` | boolean | Returns no error when the call fails. |
> | `timeout` | number | Timeout, in seconds. |
> | `followRedirects` | boolean | Follows HTTP redirects. Default: `False`. |

## Troubleshoot common issues

| Issue | Resolution |
| - | - |
| `redirect_uri_mismatch` | Add the exact **Callback URL** to the OAuth client's **Authorized redirect URIs**. |
| `403 Insufficient Permission` | Confirm the profile's scopes cover the action, and then authorize again. |
| Placeholders aren't replaced | Match **placeholder\_format** to the template, and enter key names in `values` without brackets. |
| Document not found | Share the document with the authorized account, or check the document ID in its URL. |

**Related articles:**

* [Auth profiles](https://koreai.mintlify.site/agent-platform/administration/integrations-settings.md#auth-profiles)
* [Action Tools](https://koreai.mintlify.site/agent-platform/tools/actions.md)
* [Google Docs API](https://developers.google.com/docs/api)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.