Google Docs
Type ID: googleDocs · Kind: Action · Ports: 1 in, 1 out
Create and update documents using the Google Docs API.
Credentials
Google Docs
{
"credentials": {
"name": "google_docs",
"id": "<credential-id>"
}
}
Resources & operations
- Document (
document)- Create (
create) - Create a document - Get (
get) - Fetch a document - Replace Text (
replaceText) - Replace all matching text in a document - Append Text (
appendText) - Append text to the end of a document
- Create (
For agent integrations (name: 'googleDocs' in permissions.integrations), grant '*', a resource key, or an operation key — see Tools and Permissions:
Resource key (<resource>) | Operation keys (<resource>.<operation>) |
|---|---|
document | document.create, document.get, document.replaceText, document.appendText |
Properties
Common
| Property | Key | Type | Required | Default | Possible values | Applies when |
|---|---|---|---|---|---|---|
| Resource | resource | options | No | document | Document (document) | - |
| Operation | operation | options | No | create | Create (create), Get (get), Replace Text (replaceText), Append Text (appendText) | resource = document |
Document → Create
| Property | Key | Type | Required | Default | Possible values | Applies when |
|---|---|---|---|---|---|---|
| Title | title | string | Yes | '' | Title for the new Google document | resource = document, operation = create |
Document → Get
| Property | Key | Type | Required | Default | Possible values | Applies when |
|---|---|---|---|---|---|---|
| Document ID | documentId | string | Yes | '' | Google Docs document ID | resource = document, operation = get |
| Include Tabs Content | includeTabsContent | boolean | No | true | true / false | resource = document, operation = get |
| Fields | fields | string | No | '' | Optional response field mask (e.g. title,revisionId,body.content) | resource = document, operation = get |
Document → Replace Text
| Property | Key | Type | Required | Default | Possible values | Applies when |
|---|---|---|---|---|---|---|
| Document ID | documentId | string | Yes | '' | Google Docs document ID | resource = document, operation = replaceText |
| Search Text | searchText | string | Yes | '' | Exact placeholder or text to replace | resource = document, operation = replaceText |
| Replacement Text | replacementText | string | No | '' | Text to replace every matching occurrence with | resource = document, operation = replaceText |
| Additional Fields | additionalFields | object | No | {} | Collection (see below) | resource = document, operation = replaceText |
additionalFields collection options (Replace Text):
| Property | Key | Type | Required | Default | Possible values |
|---|---|---|---|---|---|
| Match Case | matchCase | boolean | No | true | true / false |
| Required Revision ID | requiredRevisionId | string | No | '' | Fail if the document revision does not match this revision id |
| Target Revision ID | targetRevisionId | string | No | '' | Apply the change against this target revision id when possible |
Document → Append Text
| Property | Key | Type | Required | Default | Possible values | Applies when |
|---|---|---|---|---|---|---|
| Document ID | documentId | string | Yes | '' | Google Docs document ID | resource = document, operation = appendText |
| Text | text | string | Yes | '' | Text to append at the end of the document | resource = document, operation = appendText |
| Additional Fields | additionalFields | object | No | {} | Collection (see below) | resource = document, operation = appendText |
additionalFields collection options (Append Text):
| Property | Key | Type | Required | Default | Possible values |
|---|---|---|---|---|---|
| Required Revision ID | requiredRevisionId | string | No | '' | Fail if the document revision does not match this revision id |
| Target Revision ID | targetRevisionId | string | No | '' | Apply the change against this target revision id when possible |
Notes
- Title is required for Create; Document ID is required for Get, Replace Text, and Append Text; Search Text is required for Replace Text; Text is required for Append Text.
- Create/Get output:
{ success, documentId, title, revisionId, document }. - Replace Text output:
{ success, documentId, occurrencesChanged, replies, response }. - Append Text output:
{ success, documentId, replies, response }.