● Email data infrastructure

Your inbox,
as a database

InboxQL syncs Gmail into structured Postgres tables. Threads, messages, participants, attachments. Query everything with SQL. Built for AI agents and apps that need email as data, not an inbox.

query.sql
-- Find all customer emails from the last 7 days
SELECT m.subject, m.body_text, m.created_at,
       p.email AS sender
FROM messages m
JOIN participants p ON p.message_id = m.id
WHERE p.email = 'customer@acme.com'
  AND m.created_at > now() - interval '7 days'
ORDER BY m.created_at DESC;

-- Count unread threads per sender domain
SELECT split_part(p.email, '@', 2) AS domain,
       count(DISTINCT t.id) AS thread_count
FROM threads t
JOIN messages m ON m.thread_id = t.id
JOIN participants p ON p.message_id = m.id
GROUP BY domain
ORDER BY thread_count DESC;

Connect. Sync. Query.

Two minutes from Gmail OAuth to your first SQL query. No infrastructure to manage. Your data, your database.

01

Connect Gmail

OAuth flow handles everything. Tokens stored encrypted. One click to authorize.

02

Backfill history

Worker fetches your full inbox. Every message parsed, normalized, and inserted into clean relational tables.

03

Real-time sync

Gmail push notifications trigger incremental sync via history API. New emails land in your database within seconds.

04

Query with SQL

Standard Postgres. Use Supabase client, raw SQL, or any ORM. Your AI agent just runs SELECT statements.

Four tables. All of email.

Clean, normalized, queryable. Plus the raw Gmail payload in JSONB for anything we missed.

threads
iduuid
gmail_thread_idtext
subjecttext
message_countint
last_message_attimestamptz
messages
iduuid
thread_iduuid
subjecttext
body_texttext
body_htmltext
raw_payloadjsonb
participants
iduuid
message_iduuid
nametext
emailtext
roleenum
attachments
iduuid
message_iduuid
filenametext
mime_typetext
size_bytesbigint

APIs give you a straw. We give you the lake.

Existing email APIs make you fetch one thing at a time through their servers. InboxQL puts the entire dataset in your Postgres.

Every other email API

Call their servers. Every time.

Need an email? API call. Search threads? API call. Count messages from a domain? API call with pagination. Your agent waits on network latency for every single operation. Rate limits apply.

InboxQL

Query your own database.

Everything synced into your Postgres. Run SELECT, JOIN, GROUP BY, aggregations, full-text search. Zero network calls. Zero rate limits. Your data never leaves your infrastructure.

Email is the largest unstructured dataset in every company.

InboxQL makes it structured. Four tables. Real-time sync. Standard Postgres. Your agents can finally live in someone's actual inbox.