# Gmail Integration
Give your AI agent the ability to read, search, send, reply to, and manage emails in Gmail.
---
Connect Gmail to your Chipp AI so it can search your inbox, read emails, compose new messages, reply to threads, and manage your mailbox -- all through natural conversation.
## What the AI Can Do
Once connected, your agent gains seven tools for full inbox management:
| Tool | Description |
|------|-------------|
| **gmail_list_emails** | Search and list emails with Gmail query syntax |
| **gmail_read_email** | Read the full content of a specific email |
| **gmail_send_email** | Compose and send a new email (with optional attachments) |
| **gmail_reply_to_email** | Reply to an email thread with correct headers |
| **gmail_unsubscribe** | Automatically unsubscribe from mailing lists and newsletters |
| **gmail_trash_email** | Move an email to the trash |
| **gmail_modify_labels** | Mark as read/unread, star, archive, or apply labels |
### Search Capabilities
The list tool supports Gmail's full search syntax:
- `from:alice@example.com` -- emails from a specific sender
- `is:unread` -- unread emails only
- `subject:invoice` -- emails with a specific subject
- `newer_than:2d` -- emails from the last 2 days
- `has:attachment` -- emails with attachments
- `label:INBOX` -- emails in a specific label
## Connecting Gmail
**1.**
Open the Integrations tab
In your app's builder, navigate to the **Build** section and select the **Integrations** tab. Find **Gmail** in the list of available integrations.
**2.**
Click Connect
Click the **Connect** button next to Gmail. A Google OAuth popup will appear.
**3.**
Authorize access
Sign in with the Google account whose inbox you want the AI to manage. Grant the requested permissions for reading and sending emails.
> **Warning:** Gmail integration requests modify and send permissions. The AI can read, send, reply, trash, and label emails. Only connect accounts you trust the agent to manage.
**4.**
Test it out
Once connected, open the chat preview and try:
- "Show me my unread emails"
- "Read the latest email from Sarah"
- "Send an email to team@example.com about the meeting tomorrow"
- "Unsubscribe me from that newsletter"
## Key Features
### Sending and Replying
The agent can compose new emails and reply to existing threads:
- **New emails** support To, CC, BCC recipients, plain text or HTML body
- **Replies** automatically set the correct `In-Reply-To` and `References` headers to keep the thread intact
- **Reply All** includes all original recipients
- **Attachments** -- files uploaded in the conversation can be attached to outgoing emails
### Unsubscribe
The unsubscribe tool is a standout feature. When asked to unsubscribe from a newsletter, the agent:
1. Reads the `List-Unsubscribe` header from the email
2. Tries RFC 8058 one-click unsubscribe (POST request) first
3. Falls back to visiting the unsubscribe URL and submitting confirmation forms
4. As a last resort, sends an unsubscribe email via the `mailto:` link
5. Optionally trashes the email afterward
### Label Management
Use labels to organize emails through conversation:
- "Mark that email as read" -- removes the `UNREAD` label
- "Star the email from the client" -- adds the `STARRED` label
- "Archive all newsletters" -- removes the `INBOX` label
## Example Use Cases
- **Email assistant** -- "Summarize my unread emails from today"
- **Customer support triage** -- "Show me emails tagged 'support' and draft replies"
- **Inbox cleanup** -- "Unsubscribe me from all marketing emails and trash them"
- **Automated follow-ups** -- "Reply to John's email saying we'll have the report by Friday"
- **Email search** -- "Find the email with the contract attachment from last month"
## Billing
Gmail tool calls use your standard LLM token billing. There is no separate per-call fee. Listing and reading emails consume tokens based on the content length returned.