Gmail Integration
First time? If setup_complete: false above, run ./SETUP.md first, then set setup_complete: true.
Full Gmail automation via Google Apps Script API: send, read inbox, create drafts, mark as read.
Workflow
- Read inbox - Get unread emails with optional filters
- Send email - Send with HTML support, CC/BCC
- Create drafts - Save for review before sending
- Mark as read - Update email status
API Actions
| Action |
Description |
Required Params |
Optional |
send |
Send email |
to, subject, body |
html, cc, bcc, name |
inbox |
Read inbox |
- |
maxResults, query, hours |
draft |
Create draft |
to, subject, body |
html, replyTo |
markRead |
Mark as read |
messageId |
- |
Examples
# Send email
curl -sL "$URL?token=$TOKEN&action=send&to=user@example.com&subject=Hello&body=Message"
# Get last 10 unread emails from last 6 hours
curl -sL "$URL?token=$TOKEN&action=inbox&maxResults=10&hours=6"
# Search for specific emails
curl -sL "$URL?token=$TOKEN&action=inbox&query=from:important@client.com"
# Create draft
curl -sL "$URL?token=$TOKEN&action=draft&to=user@example.com&subject=Follow%20Up&body=Draft"
# Mark email as read
curl -sL "$URL?token=$TOKEN&action=markRead&messageId=MESSAGE_ID"
Response Format
Send:
{
"success": true,
"email": { "to": "user@example.com", "subject": "Hello", "cc": null, "bcc": null }
}
Inbox:
{
"success": true,
"count": 5,
"emails": [
{
"id": "message_id",
"threadId": "thread_id",
"from": "sender@example.com",
"subject": "Email Subject",
"date": "2026-01-14T08:30:00Z",
"snippet": "First 200 chars...",
"body": "Full email body",
"isUnread": true,
"labels": ["INBOX", "UNREAD"]
}
]
}
Important Notes
- No emojis in subject/body - URL encoding breaks them
- Default inbox query:
is:unread with time filter
hours param defaults to 24
Integration
Works with other skills:
- whatsapp - Forward important emails as messages
- calendar - Create events from email content
1---
2name: gmail
3description: "Gmail automation via Google Apps Script. Use for: send emails, read inbox, create drafts, search messages."
4version: "1.0.0"
5author: aviz85
6tags:
7 - gmail
8 - email
9 - google
10 - automation
11setup: "./SETUP.md"
12setup_complete: false
13---
14
15# Gmail Integration
16
17> **First time?** If `setup_complete: false` above, run `./SETUP.md` first, then set `setup_complete: true`.
18
19Full Gmail automation via Google Apps Script API: send, read inbox, create drafts, mark as read.
20
21## Workflow
22
231. **Read inbox** - Get unread emails with optional filters
242. **Send email** - Send with HTML support, CC/BCC
253. **Create drafts** - Save for review before sending
264. **Mark as read** - Update email status
27
28## API Actions
29
30| Action | Description | Required Params | Optional |
31|--------|-------------|-----------------|----------|
32| `send` | Send email | `to`, `subject`, `body` | `html`, `cc`, `bcc`, `name` |
33| `inbox` | Read inbox | - | `maxResults`, `query`, `hours` |
34| `draft` | Create draft | `to`, `subject`, `body` | `html`, `replyTo` |
35| `markRead` | Mark as read | `messageId` | - |
36
37## Examples
38
39```bash
40# Send email
41curl -sL "$URL?token=$TOKEN&action=send&to=user@example.com&subject=Hello&body=Message"
42
43# Get last 10 unread emails from last 6 hours
44curl -sL "$URL?token=$TOKEN&action=inbox&maxResults=10&hours=6"
45
46# Search for specific emails
47curl -sL "$URL?token=$TOKEN&action=inbox&query=from:important@client.com"
48
49# Create draft
50curl -sL "$URL?token=$TOKEN&action=draft&to=user@example.com&subject=Follow%20Up&body=Draft"
51
52# Mark email as read
53curl -sL "$URL?token=$TOKEN&action=markRead&messageId=MESSAGE_ID"
54```
55
56## Response Format
57
58**Send:**
59```json
60{
61 "success": true,
62 "email": { "to": "user@example.com", "subject": "Hello", "cc": null, "bcc": null }
63}
64```
65
66**Inbox:**
67```json
68{
69 "success": true,
70 "count": 5,
71 "emails": [
72 {
73 "id": "message_id",
74 "threadId": "thread_id",
75 "from": "sender@example.com",
76 "subject": "Email Subject",
77 "date": "2026-01-14T08:30:00Z",
78 "snippet": "First 200 chars...",
79 "body": "Full email body",
80 "isUnread": true,
81 "labels": ["INBOX", "UNREAD"]
82 }
83 ]
84}
85```
86
87## Important Notes
88
89- **No emojis** in subject/body - URL encoding breaks them
90- Default inbox query: `is:unread` with time filter
91- `hours` param defaults to 24
92
93## Integration
94
95Works with other skills:
96- **whatsapp** - Forward important emails as messages
97- **calendar** - Create events from email content