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.
-- 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;
Two minutes from Gmail OAuth to your first SQL query. No infrastructure to manage. Your data, your database.
OAuth flow handles everything. Tokens stored encrypted. One click to authorize.
Worker fetches your full inbox. Every message parsed, normalized, and inserted into clean relational tables.
Gmail push notifications trigger incremental sync via history API. New emails land in your database within seconds.
Standard Postgres. Use Supabase client, raw SQL, or any ORM. Your AI agent just runs SELECT statements.
Clean, normalized, queryable. Plus the raw Gmail payload in JSONB for anything we missed.
Existing email APIs make you fetch one thing at a time through their servers. InboxQL puts the entire dataset in your Postgres.
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.
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.
InboxQL makes it structured. Four tables. Real-time sync. Standard Postgres. Your agents can finally live in someone's actual inbox.