Skip to main content

Gmail Bubble

Gmail integration for email management

Quick Start

import { GmailBubble } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new GmailBubble({
operation: 'send_email',
credentials: {
[CredentialType.GMAIL_CRED]: process.env.GMAIL_CRED as string,
},
}).action();

Operation Details

send_email

operation 'send_email' required
Send an email message
to string[] required
List of recipient email addresses
cc string[]
List of CC recipient email addresses
bcc string[]
List of BCC recipient email addresses
subject string required
Email subject line
body_text string
Plain text email body
body_html string
HTML email body
reply_to string
Reply-to email address
thread_id string
Thread ID to reply to (for threaded conversations)
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

list_emails

operation 'list_emails' required
List emails in the user mailbox
query string
Gmail search query (e.g., "from:user@example.com is:unread")
label_ids string[]
Filter by specific label IDs
include_spam_trash boolean
Include messages from SPAM and TRASH
max_results number
Maximum number of messages to return
page_token string
Token for pagination to get next page
include_details boolean
Whether to fetch full message details including snippet, headers, and body
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

get_email

operation 'get_email' required
Get a specific email message
message_id string required
Gmail message ID to retrieve
format 'minimal' | 'full' | 'raw' | 'metadata'
Format to return the message in
metadata_headers string[]
List of headers to include when format is metadata
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

search_emails

operation 'search_emails' required
Search emails with query
query string required
Gmail search query string
max_results number
Maximum number of results to return
include_spam_trash boolean
Include messages from SPAM and TRASH
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

mark_as_read

operation 'mark_as_read' required
Mark one or more messages as read
message_ids string[] required
List of message IDs to mark as read
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

mark_as_unread

operation 'mark_as_unread' required
Mark one or more messages as unread
message_ids string[] required
List of message IDs to mark as unread
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

create_draft

operation 'create_draft' required
Create a draft email
to string[] required
List of recipient email addresses
cc string[]
List of CC recipient email addresses
bcc string[]
List of BCC recipient email addresses
subject string required
Email subject line
body_text string
Plain text email body
body_html string
HTML email body
reply_to string
Reply-to email address
thread_id string
Thread ID to reply to (for threaded conversations)
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

send_draft

operation 'send_draft' required
Send a draft email
draft_id string required
Gmail draft ID to send
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

list_drafts

operation 'list_drafts' required
List draft emails
query string
Search query to filter drafts
max_results number
Maximum number of drafts to return
page_token string
Token for pagination to get next page
include_spam_trash boolean
Include drafts from SPAM and TRASH
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

delete_email

operation 'delete_email' required
Delete an email message permanently
message_id string required
Gmail message ID to delete
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

trash_email

operation 'trash_email' required
Move an email message to trash
message_id string required
Gmail message ID to move to trash
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

list_threads

operation 'list_threads' required
List email threads
query string
Gmail search query to filter threads
label_ids string[]
Filter by specific label IDs
include_spam_trash boolean
Include threads from SPAM and TRASH
max_results number
Maximum number of threads to return
page_token string
Token for pagination to get next page
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

list_labels

operation 'list_labels' required
List all labels in mailbox
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

create_label

operation 'create_label' required
Create a new custom label
name string required
Label name (display name)
label_list_visibility 'labelShow' | 'labelShowIfUnread' | 'labelHide'
Visibility in label list
message_list_visibility 'show' | 'hide'
Visibility in message list
background_color string
Background color in hex format (e.g., #000000)
text_color string
Text color in hex format (e.g., #ffffff)
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

modify_message_labels

operation 'modify_message_labels' required
Add or remove labels from a message
message_id string required
Gmail message ID to modify
add_label_ids string[]
List of label IDs to add (max 100)
remove_label_ids string[]
List of label IDs to remove (max 100)
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)

modify_thread_labels

operation 'modify_thread_labels' required
Add or remove labels from all messages in a thread
thread_id string required
Gmail thread ID to modify
add_label_ids string[]
List of label IDs to add to all messages in thread (max 100)
remove_label_ids string[]
List of label IDs to remove from all messages in thread (max 100)
credentials Record<CredentialType,string>
Object mapping credential types to values (injected at runtime)