Gmail Integration

Connect Gmail in 60 seconds. Start parsing immediately.

InboxParse uses Google OAuth 2.0 to sync your Gmail account. No IMAP passwords. No app-specific credentials. Just authorize and go.

Connect a Gmail mailbox via OAuth
# Initiate Gmail OAuth connection (user authorization flow)
# The user visits this URL in their browser:
GET https://inboxparse.com/api/mailboxes/gmail/authorize
  ?workspace_id=ws_01jxxx
  &redirect_uri=https://yourapp.com/callback

# After authorization, InboxParse completes the OAuth flow
# and begins syncing. Then access threads via the API:

curl https://inboxparse.com/api/v1/threads?limit=20 \
  -H "Authorization: Bearer ip..."

# Filter by mailbox
curl "https://inboxparse.com/api/v1/threads?mailbox_id=mb_01jxxx&limit=20" \
  -H "Authorization: Bearer ip..."

OAuth 2.0 - no passwords

Users authorize via Google's OAuth consent screen. No app passwords. No less-secure-app settings. Fully compliant.

Automatic sync

InboxParse syncs Gmail in real time via Google Push Notifications. New emails appear in the API within seconds.

Multi-account support

Connect multiple Gmail accounts to a single workspace. Each mailbox synced and parsed independently.

AI labels on every thread

Every Gmail thread is processed by AI: category, action, sentiment - automatically computed on sync.

Thread & message model

Gmail's native thread model is preserved. Read entire conversations - not isolated messages - through the API.

Unified API across providers

Same API endpoints whether you're using Gmail, Outlook via IMAP, or any other provider. No provider-specific code.

Read and process Gmail threads programmatically

Copy-and-paste ready. No boilerplate.

Read and process Gmail threads programmatically
// Fetch latest Gmail threads (parsed as Markdown)
const response = await fetch(
  "https://inboxparse.com/api/v1/threads?limit=50&format=markdown",
  {
    headers: {
      Authorization: "Bearer ip...",
    },
  }
)

const { data: threads } = await response.json()

// Filter by AI label (e.g. only sales threads)
const salesThreads = threads.filter(
  (t) => t.labels?.category === "sales"
)

// Build a context block for your LLM
const context = salesThreads
  .map((t) => {
    const lastMessage = t.messages.at(-1)
    return [
      `Subject: ${t.subject}`,
      `From: ${lastMessage?.from}`,
      `---`,
      lastMessage?.content?.markdown,
    ].join("\n")
  })
  .join("\n\n====\n\n")

console.log(`Loaded ${salesThreads.length} sales Gmail threads.`)

Frequently asked questions

Do I need to set up IMAP for Gmail?+

No. InboxParse connects to Gmail via OAuth 2.0. Users authorize through Google's consent screen - no IMAP passwords, no app-specific credentials, and no less-secure-app settings required.

How quickly do new Gmail messages appear in the API?+

InboxParse syncs Gmail using Google Push Notifications. New emails typically appear in the API within seconds of arriving in the inbox.

Can I connect multiple Gmail accounts?+

Yes. You can connect multiple Gmail accounts to a single workspace. Each mailbox is synced and parsed independently, and you can filter API results by mailbox_id.

Gmail, parsed and ready for AI.

No IMAP config. No credential storage. OAuth in, data out.