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

# Gmail

> What agents can do in Gmail at each access level, and how to connect, limit, and disconnect Gmail.

Connect Gmail so your agents can work in your Gmail account. You choose an access level for each account, and Squad refuses any agent action outside that level.

## Access levels

Each Gmail account has an access level: **Read-only**, **Read + send**, and **Full access**. Squad refuses any agent action outside that level. You can also narrow or block single agents under **Per-agent access**.

| Level                         | The connect window describes this level as                           | Actions agents can use |
| ----------------------------- | -------------------------------------------------------------------- | ---------------------- |
| **Read-only**                 | "Read your inbox and search emails. Cannot send, modify, or delete." | 28 of 62               |
| **Read + send**               | "Read inbox and send new emails. Cannot delete or modify existing."  | 53 of 62               |
| **Full access** (recommended) | "Read, send, delete, manage labels and drafts."                      | 62 of 62               |

The description of **Read + send** does not cover every action at that level. This level also allows: Add label to email, Batch modify messages, Modify thread labels, Move thread to trash, Move to trash, Patch label, Patch send as, Untrash message, Untrash thread, Update draft, Update IMAP settings, Update label, Update language settings, Update POP settings, Update send as, and Update vacation settings.

**Full access** is the recommended level. The connect window selects it for you, and you can choose another level.

The Gmail sign-in page asks you to approve full access to your account. This is expected. Squad does not narrow the sign-in. It checks every agent action against the level you chose, and it refuses actions outside that level.

## What agents can do at each level

Each level opens with a short summary in plain tasks, then lists every action it adds, grouped by what the action works on. You do not need to name actions. Ask in plain words, and the agent searches for the matching action.

<Tip>**Find an action.** Open a level and use your browser's find (Ctrl+F, or Cmd+F on a Mac) with a word from the task or part of a slug. Or ask your agent in plain words, for example "What can you do in my Gmail account?" The agent can search the Gmail actions for you.</Tip>

Each action shows its name, a one-line description where the Gmail action catalog has one, and its slug. The slug is the ID that agents use when they call the action.

<AccordionGroup>
  <Accordion title="Read-only">
    Agents can use 28 of the 62 Gmail actions at this level:

    * View emails
    * View settings
    * View drafts
    * View encryption settings
    * View filters
    * View labels
    * View and search people
    * View addresses
    * View attachments
    * View contacts
    * View history
    * View identities

    All 28 actions at this level:

    | Works on                | Action                      | What it does                                                                                                                                                                   | Slug                                |
    | ----------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------- |
    | **Addresses**           | List forwarding addresses   | List all forwarding addresses for the specified Gmail account.                                                                                                                 | `GMAIL_LIST_FORWARDING_ADDRESSES`   |
    | **Attachments**         | Get attachment              | Retrieves a specific attachment by ID from a message in a user's Gmail mailbox, requiring valid message and attachment IDs.                                                    | `GMAIL_GET_ATTACHMENT`              |
    | **Contacts**            | Get contacts                | Fetches contacts (connections) for the authenticated Google account, allowing selection of specific data fields and pagination.                                                | `GMAIL_GET_CONTACTS`                |
    | **Drafts**              | Get draft                   | Retrieves a single Gmail draft by its ID.                                                                                                                                      | `GMAIL_GET_DRAFT`                   |
    |                         | List drafts                 | Retrieves a paginated list of email drafts from a user's Gmail account.                                                                                                        | `GMAIL_LIST_DRAFTS`                 |
    | **Emails**              | Fetch emails                | Fetches a list of email messages from a Gmail account, supporting filtering, pagination, and optional full content retrieval.                                                  | `GMAIL_FETCH_EMAILS`                |
    |                         | Fetch message by message ID | Fetches a specific email message by its ID, provided the message\_id exists and is accessible to the authenticated user\_id.                                                   | `GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID` |
    |                         | Fetch message by thread ID  | Retrieves messages from a Gmail thread using its thread\_id, where the thread must be accessible by the specified user\_id.                                                    | `GMAIL_FETCH_MESSAGE_BY_THREAD_ID`  |
    |                         | List messages               | DEPRECATED: Use GMAIL\_FETCH\_EMAILS instead.                                                                                                                                  | `GMAIL_LIST_MESSAGES`               |
    | **Encryption settings** | List cse keypairs           | List client-side encryption key pairs for an authenticated user.                                                                                                               | `GMAIL_LIST_CSE_KEYPAIRS`           |
    |                         | List S/MIME info            | Lists S/MIME configs for the specified send-as alias.                                                                                                                          | `GMAIL_LIST_SMIME_INFO`             |
    | **Filters**             | Get filter                  | Retrieve a specific Gmail filter by its ID.                                                                                                                                    | `GMAIL_GET_FILTER`                  |
    |                         | List filters                | List all Gmail filters (rules) in the mailbox.                                                                                                                                 | `GMAIL_LIST_FILTERS`                |
    | **History**             | List history                | List Gmail mailbox change history since a known startHistoryId.                                                                                                                | `GMAIL_LIST_HISTORY`                |
    | **Identities**          | List cse identities         | List client-side encrypted identities for an authenticated user.                                                                                                               | `GMAIL_LIST_CSE_IDENTITIES`         |
    | **Labels**              | Get label                   | Gets details for a specified Gmail label.                                                                                                                                      | `GMAIL_GET_LABEL`                   |
    |                         | List labels                 | Retrieves all system and user-created labels for a Gmail account in a single unpaginated response.                                                                             | `GMAIL_LIST_LABELS`                 |
    | **People**              | Get people                  | Retrieves either a specific person's details (using resource\_name) or lists 'Other Contacts' (if other\_contacts is true), with person\_fields specifying the data to return. | `GMAIL_GET_PEOPLE`                  |
    |                         | Search people               | Searches contacts by matching the query against names, nicknames, emails, phone numbers, and organizations, optionally including 'Other Contacts'.                             | `GMAIL_SEARCH_PEOPLE`               |
    | **Profiles**            | Get profile                 | Retrieves Gmail profile information (email address, aggregate messagesTotal/threadsTotal, historyId) for a user. messagesTotal counts individual emails.                       | `GMAIL_GET_PROFILE`                 |
    | **Settings**            | Get auto forwarding         | Get the auto-forwarding setting for the specified account.                                                                                                                     | `GMAIL_GET_AUTO_FORWARDING`         |
    |                         | Get language settings       | Retrieve the language settings for a Gmail user.                                                                                                                               | `GMAIL_GET_LANGUAGE_SETTINGS`       |
    |                         | Get vacation settings       | Retrieve vacation responder settings for a Gmail user.                                                                                                                         | `GMAIL_GET_VACATION_SETTINGS`       |
    |                         | Settings get IMAP           | Retrieves the IMAP settings for a Gmail user account, including whether IMAP is enabled, auto-expunge behavior, expunge behavior, and maximum folder size.                     | `GMAIL_SETTINGS_GET_IMAP`           |
    |                         | Settings get POP            | Retrieve POP settings for a Gmail account.                                                                                                                                     | `GMAIL_SETTINGS_GET_POP`            |
    |                         | Settings send as get        | Retrieve a specific send-as alias configuration for a Gmail user.                                                                                                              | `GMAIL_SETTINGS_SEND_AS_GET`        |
    | **Threads**             | List threads                | Retrieves a list of email threads from a Gmail account, identified by user\_id (email address or 'me'), supporting filtering and pagination.                                   | `GMAIL_LIST_THREADS`                |
    | **Other actions**       | List send as                | Lists the send-as aliases for a Gmail account, including the primary address and custom 'from' aliases.                                                                        | `GMAIL_LIST_SEND_AS`                |
  </Accordion>

  <Accordion title="Read + send">
    Agents can use 53 of the 62 Gmail actions at this level: everything in **Read-only**, plus:

    * Create, update, and send emails
    * Create and update labels
    * Update settings
    * Create and update drafts
    * Update threads
    * View account details
    * Create filters

    The 25 actions that this level adds to **Read-only**:

    | Works on            | Action                   | What it does                                                                                         | Slug                             |
    | ------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------- | -------------------------------- |
    | **Account details** | Who am I                 |                                                                                                      | `GMAIL_WHO_AM_I`                 |
    | **Drafts**          | Create email draft       | Creates a Gmail email draft.                                                                         | `GMAIL_CREATE_EMAIL_DRAFT`       |
    |                     | Update draft             | Updates (replaces) an existing Gmail draft's content in-place by draft ID.                           | `GMAIL_UPDATE_DRAFT`             |
    | **Emails**          | Batch modify messages    | Modify labels on multiple Gmail messages in one efficient API call.                                  | `GMAIL_BATCH_MODIFY_MESSAGES`    |
    |                     | Forward message          | Forward an existing Gmail message to specified recipients, preserving original body and attachments. | `GMAIL_FORWARD_MESSAGE`          |
    |                     | Import message           | Import a message into the user's mailbox with standard email delivery scanning and classification.   | `GMAIL_IMPORT_MESSAGE`           |
    |                     | Insert message           | Insert a message into the user's mailbox similar to IMAP APPEND.                                     | `GMAIL_INSERT_MESSAGE`           |
    |                     | Move to trash            | Moves an existing, non-deleted email message to the trash for the specified user.                    | `GMAIL_MOVE_TO_TRASH`            |
    |                     | Send email               | Sends an email via Gmail API using the authenticated user's Google profile display name.             | `GMAIL_SEND_EMAIL`               |
    |                     | Untrash message          | Remove a message from trash in Gmail.                                                                | `GMAIL_UNTRASH_MESSAGE`          |
    | **Filters**         | Create filter            | Create a new Gmail filter with specified criteria and actions.                                       | `GMAIL_CREATE_FILTER`            |
    | **Labels**          | Add label to email       | Adds and/or removes specified Gmail labels for a message.                                            | `GMAIL_ADD_LABEL_TO_EMAIL`       |
    |                     | Create label             | Creates a new label with a unique name in the specified user's Gmail account.                        | `GMAIL_CREATE_LABEL`             |
    |                     | Modify thread labels     | Adds or removes specified existing label IDs from a Gmail thread, affecting all its messages.        | `GMAIL_MODIFY_THREAD_LABELS`     |
    |                     | Patch label              | Patches the specified user-created label.                                                            | `GMAIL_PATCH_LABEL`              |
    |                     | Update label             | Update the properties of an existing Gmail label.                                                    | `GMAIL_UPDATE_LABEL`             |
    | **Settings**        | Update IMAP settings     | Update IMAP settings for a Gmail account.                                                            | `GMAIL_UPDATE_IMAP_SETTINGS`     |
    |                     | Update language settings | Update the language settings for a Gmail user.                                                       | `GMAIL_UPDATE_LANGUAGE_SETTINGS` |
    |                     | Update POP settings      | Update POP settings for a Gmail account.                                                             | `GMAIL_UPDATE_POP_SETTINGS`      |
    |                     | Update vacation settings | Update vacation responder settings for a Gmail user.                                                 | `GMAIL_UPDATE_VACATION_SETTINGS` |
    | **Threads**         | Move thread to trash     | Moves the specified thread to the trash.                                                             | `GMAIL_MOVE_THREAD_TO_TRASH`     |
    |                     | Reply to thread          | Sends a reply within a specific Gmail thread using the original thread's subject.                    | `GMAIL_REPLY_TO_THREAD`          |
    |                     | Untrash thread           | Remove a thread from trash in Gmail.                                                                 | `GMAIL_UNTRASH_THREAD`           |
    | **Other actions**   | Patch send as            | Patch the specified send-as alias for a Gmail user.                                                  | `GMAIL_PATCH_SEND_AS`            |
    |                     | Update send as           | Update a send-as alias for a Gmail user.                                                             | `GMAIL_UPDATE_SEND_AS`           |
  </Accordion>

  <Accordion title="Full access (recommended)">
    Agents can use 62 of the 62 Gmail actions at this level: everything in **Read + send**, plus:

    * Delete and send drafts
    * Delete emails
    * Delete labels
    * Delete filters
    * Delete threads

    The 9 actions that this level adds to **Read + send**:

    | Works on          | Action                | What it does                                                                                   | Slug                          |
    | ----------------- | --------------------- | ---------------------------------------------------------------------------------------------- | ----------------------------- |
    | **Drafts**        | Delete draft          | Permanently deletes a specific Gmail draft using its ID with no recovery possible.             | `GMAIL_DELETE_DRAFT`          |
    |                   | Send draft            | Sends an existing draft email AS-IS to recipients already defined within the draft.            | `GMAIL_SEND_DRAFT`            |
    | **Emails**        | Batch delete messages | Permanently delete multiple Gmail messages in bulk, bypassing Trash with no recovery possible. | `GMAIL_BATCH_DELETE_MESSAGES` |
    |                   | Delete message        | Permanently deletes a specific email message by its ID from a Gmail mailbox.                   | `GMAIL_DELETE_MESSAGE`        |
    | **Filters**       | Delete filter         | Permanently delete a Gmail filter by its ID.                                                   | `GMAIL_DELETE_FILTER`         |
    | **Labels**        | Delete label          | Permanently DELETES a user-created Gmail label from the account (not from a message).          | `GMAIL_DELETE_LABEL`          |
    |                   | Remove label          | DEPRECATED: Use GMAIL\_DELETE\_LABEL instead.                                                  | `GMAIL_REMOVE_LABEL`          |
    | **Threads**       | Delete thread         | Immediately and permanently delete a specified thread and all its messages.                    | `GMAIL_DELETE_THREAD`         |
    | **Other actions** | Stop watch            | Stop receiving push notifications for a Gmail mailbox.                                         | `GMAIL_STOP_WATCH`            |
  </Accordion>
</AccordionGroup>

<Tip>At **Read + send**, agents can send new emails and save drafts. Sending a saved draft needs **Full access**.</Tip>

## Connect Gmail

Before you start:

* You need a Gmail account that you can sign in to.
* Your Squad subscription must be active. Squad does not connect apps while the subscription is not active.

<Steps>
  <Step title="Open Integrations">
    Open **Settings** > **Integrations**.
  </Step>

  <Step title="Add an integration">
    On the **Connected apps** tab, click **+ Add integration**.
  </Step>

  <Step title="Find Gmail">
    Find **Gmail** in the catalog and click it. You can type the name in **Search the catalog…**.
  </Step>

  <Step title="Choose an access level">
    Under **Default scope**, choose an access level. This level applies to every agent.
  </Step>

  <Step title="Click Connect Gmail">
    Click **Connect Gmail**. The Gmail sign-in page opens in a new tab.
  </Step>

  <Step title="Sign in to Gmail">
    Sign in to Gmail and approve the request.
  </Step>
</Steps>

Check that it works: Gmail shows under **YOUR CONNECTIONS**, with a row for the account and its access level.

## Change the access level

1. Under **YOUR CONNECTIONS**, find the Gmail account.
2. Open the account menu (⋯) and click **Manage scope**.
3. Under **Default scope**, choose the new level.
4. Click **Save access**.

The change does not need a new sign-in. Agents get the new level from their next call.

## Set access for one agent

Every agent uses the account's level unless you set something else for it. You can narrow one agent to a lower level, or block it.

1. Under **YOUR CONNECTIONS**, open the account menu (⋯) on the Gmail account.
2. Click **Manage scope**.
3. Under **Per-agent access**, find the agent.
4. Choose the **Default** option to follow the account's level, choose a lower level, or choose **No access**.
5. Click **Save access**.

An agent never gets more than the account's level, even if you choose a higher level for it. Changes apply from the agent's next call. An agent with **No access** does not see the account.

## Use more than one Gmail account

Click **+ Account** on the Gmail card to connect another account. Agents use the primary account unless they are asked to use a specific one.

* After you click **+ Account**, follow the connect steps above.
* Each account has its own access level.
* The first account you connect becomes the primary account. It shows **★ PRIMARY**.
* To change the primary account, open the account menu (⋯) and click **Make primary**.
* To tell accounts apart, open the account menu (⋯) and click **Rename**.

## Reconnect or disconnect

Reconnect when the connection has expired, or when you need to change what the account can reach on the Gmail side:

1. Open the account menu (⋯) and click **Reconnect**.
2. Click **Reauthorize on Gmail**.
3. Sign in to Gmail and approve the request.

Reconnect signs in to the same account again. It does not add a second connection.

Open the account menu (⋯) on the Gmail account and click **Disconnect**. Agents lose access to that account at once.

<Warning>**Disconnect** acts at once, with no confirmation step. If it was the primary account, another connected Gmail account becomes primary.</Warning>

## Costs

Gmail actions do not use Squad credits. Connected apps never use credits. For what does use credits, see [What Squad costs](/docs/costs).

## Troubleshooting

An agent reports that an action is not allowed on this account.

* Cause: the action is outside the account's access level, or outside the level you set for that agent.
* Fix: choose a higher level in **Manage scope**, or change the agent's row under **Per-agent access**.

An agent says it has no access to Gmail, or it does not see the account.

* Cause: the agent is set to **No access** under **Per-agent access**, or the account is not connected.
* Fix: open **Manage scope** and change the agent's row. If the account is missing, connect it again.

Connecting or saving fails with "Your subscription isn't active."

* Cause: your Squad subscription is not active.
* Fix: resubscribe. See [Manage your subscription](/docs/billing).

An agent says the Gmail connection has expired.

* Cause: the sign-in for that account is no longer valid.
* Fix: use **Reconnect** on the account.

## Common questions

<AccordionGroup>
  <Accordion title="Can I limit what agents can do in Gmail?">
    Each Gmail account has an access level: **Read-only**, **Read + send**, and **Full access**. Squad refuses any agent action outside that level. You can also narrow or block single agents under **Per-agent access**.
  </Accordion>

  <Accordion title="Can I connect more than one Gmail account?">
    Click **+ Account** on the Gmail card to connect another account. Agents use the primary account unless they are asked to use a specific one.
  </Accordion>

  <Accordion title="How do I disconnect Gmail?">
    Open the account menu (⋯) on the Gmail account and click **Disconnect**. Agents lose access to that account at once.
  </Accordion>
</AccordionGroup>

## Related pages

<CardGroup cols={2}>
  <Card title="Connect apps" icon="plug" href="/docs/integrations" />

  <Card title="Add an MCP server or an API key" icon="server" href="/docs/custom-integrations">
    Use this when an action you need is not in this app.
  </Card>
</CardGroup>
