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

# Google Docs Integration for AI Agents & Workflows

> Create, read, and edit Google Docs documents via the Google Docs API

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img src="https://mintcdn.com/modulexaillc/zKB2qsP6Q61VNLfB/logos/google-docs.svg?fit=max&auto=format&n=zKB2qsP6Q61VNLfB&q=85&s=361641581aabb373ad95d192852c7eb7" alt="Google Docs logo" width="72" height="72" data-path="logos/google-docs.svg" />

## Overview

Add **Google Docs** to any ModuleX agent or workflow. Create, read, and edit Google Docs documents via the Google Docs API (`docs.googleapis.com/v1`).

<Info>
  **Categories**: Productivity & Collaboration · Google Workspace · Documents · **Auth**: OAuth2 · **Actions**: 10
</Info>

## Authentication

### OAuth2 Authentication

Connect using Google OAuth (recommended)

#### Required Credentials

| Field         | Description                    | Required | Format                                                                     |
| ------------- | ------------------------------ | -------- | -------------------------------------------------------------------------- |
| Client ID     | Google OAuth App Client ID     | Yes      | `xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com` |
| Client Secret | Google OAuth App Client Secret | Yes      | `GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxx`                                        |

#### OAuth Configuration

* **Authorization URL**: `https://accounts.google.com/o/oauth2/v2/auth`
* **Token URL**: `https://oauth2.googleapis.com/token`
* **Scopes**: `https://www.googleapis.com/auth/documents`

## Available Actions

<AccordionGroup>
  <Accordion title="append_image — Append an image to the end of a Google Docs document">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document to append the image to
    </ResponseField>

    <ResponseField name="image_uri" type="string" required>
      The URL of the image to insert into the document
    </ResponseField>

    <ResponseField name="append_at_beginning" type="boolean">
      Whether to append at the beginning (true) or end (false) of the document (Default: `false`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "AppendImageOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="append_text — Append text to an existing Google Docs document">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document to append text to
    </ResponseField>

    <ResponseField name="text" type="string" required>
      The text to append to the document
    </ResponseField>

    <ResponseField name="append_at_beginning" type="boolean">
      Whether to append at the beginning (true) or end (false) of the document (Default: `false`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "AppendTextOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="create_document — Create a new Google Docs document with optional text content">
    ### Parameters

    <ResponseField name="title" type="string" required>
      Title of the new document
    </ResponseField>

    <ResponseField name="text" type="string">
      Text content to insert into the document
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "CreateDocumentOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_document — Get the contents of a Google Docs document">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document to retrieve
    </ResponseField>

    <ResponseField name="include_tabs_content" type="boolean">
      Whether to populate the tabs field instead of the body field (Default: `false`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetDocumentOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_tab_content — Get the content of specific tabs in a Google Docs document">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document
    </ResponseField>

    <ResponseField name="tab_ids" type="array" required>
      List of tab IDs to retrieve content for (element type: string)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TabContent": {
          "additionalProperties": false,
          "description": "Tab content returned by get_tab_content.",
          "properties": {
            "tab_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tab Id"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Title"
            },
            "body": {
              "anyOf": [
                {
                  "additionalProperties": true,
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Body"
            }
          },
          "title": "TabContent",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "tabs": {
          "items": {
            "$ref": "#/$defs/TabContent"
          },
          "title": "Tabs",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetTabContentOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="insert_page_break — Insert a page break into a Google Docs document at a specified index">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document
    </ResponseField>

    <ResponseField name="index" type="integer">
      The index position to insert the page break at (Default: `1`)
    </ResponseField>

    <ResponseField name="tab_id" type="string">
      The tab ID to insert the page break into
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "InsertPageBreakOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="insert_table — Insert a table into a Google Docs document at a specified index">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document
    </ResponseField>

    <ResponseField name="rows" type="integer" required>
      The number of rows in the table
    </ResponseField>

    <ResponseField name="columns" type="integer" required>
      The number of columns in the table
    </ResponseField>

    <ResponseField name="index" type="integer">
      The index position to insert the table at (Default: `1`)
    </ResponseField>

    <ResponseField name="tab_id" type="string">
      The tab ID to insert the table into
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "InsertTableOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="insert_text — Insert text into a Google Docs document at a specified index">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document
    </ResponseField>

    <ResponseField name="text" type="string" required>
      The text to insert
    </ResponseField>

    <ResponseField name="index" type="integer">
      The index position to insert the text at (Default: `1`)
    </ResponseField>

    <ResponseField name="tab_id" type="string">
      The tab ID to insert the text into
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "InsertTextOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="replace_image — Replace an existing image in a Google Docs document with a new one">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document
    </ResponseField>

    <ResponseField name="image_id" type="string" required>
      The ID of the image to be replaced (from the document's inlineObjects)
    </ResponseField>

    <ResponseField name="image_uri" type="string" required>
      The URL of the new image to replace with
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "ReplaceImageOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="replace_text — Replace all instances of matched text in a Google Docs document">
    ### Parameters

    <ResponseField name="doc_id" type="string" required>
      The ID of the document
    </ResponseField>

    <ResponseField name="text_to_replace" type="string" required>
      The text to find and replace
    </ResponseField>

    <ResponseField name="new_text" type="string" required>
      The replacement text
    </ResponseField>

    <ResponseField name="match_case" type="boolean">
      Whether the search is case-sensitive (Default: `false`)
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Error"
        },
        "document_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Document Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        }
      },
      "required": [
        "success"
      ],
      "title": "ReplaceTextOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* Google Docs API: 300 read requests per minute per user, 60 write requests per minute per user.
* Error model: non-2xx responses and timeouts are caught and returned as `success=False` + `error` rather than raising.

## Related integrations

<CardGroup cols={3}>
  <Card title="ConvertAPI" href="/integrations/tools/convertapi" />

  <Card title="Cal.com" href="/integrations/tools/cal-com" />

  <Card title="Canva" href="/integrations/tools/canva" />
</CardGroup>

## Links

* [Google Docs](https://docs.google.com)
