Gmail connector
Set up the Gmail connector in Kaivo: authentication, configuration, the 8 BigQuery tables it syncs, and answers to common questions.
Gmail connector pricing, tier and credits on kaivo.ioKaivo is a fully managed data platform that syncs your Gmail data into a Google BigQuery warehouse and keeps it up to date automatically. There is no pipeline to build and no infrastructure to run, so you can spend your time analysing your survey and email data instead of moving it.
What is the Gmail connector
Section titled “What is the Gmail connector”Sync your Gmail metadata into BigQuery with Kaivo to analyse mailbox size, label volume, and thread activity.
| Category | Surveys & Email |
|---|---|
| Authentication | API key |
| Setup | Self-service |
Getting started with the Gmail connector
Section titled “Getting started with the Gmail connector”- Sign up for Kaivo and create a workspace.
- Connect your Gmail account.
- Choose which tables to sync.
- Wait for the initial sync to finish.
- Query your data in BigQuery or your favourite AI or BI tool.
Authenticating Gmail
Section titled “Authenticating Gmail”Authenticate with your Service Account Information.
| Field | Description |
|---|---|
| Service Account Information | |
| The JSON key of the service account to use for authorization. Read more here. |
|
Configuring the Gmail connector
Section titled “Configuring the Gmail connector”When you set up the connector, you provide:
| Field | Description |
|---|---|
| Include Spam & Trash | |
| Include drafts/messages from SPAM and TRASH in the results. |
| | Start Date |
Any data before this date will not be fetched.
|
Tables and columns synced from Gmail
Section titled “Tables and columns synced from Gmail”Kaivo syncs 8 tables from Gmail into a dedicated dataset in your BigQuery warehouse. Click any table to see its columns and types.
drafts (5 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
id |
STRING |
|
message__id |
STRING |
|
message__thread_id |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
labels (7 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
type |
STRING |
|
id |
STRING |
|
label_list_visibility |
STRING |
|
message_list_visibility |
STRING |
|
name |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
labels_details (11 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
type |
STRING |
|
id |
STRING |
|
label_list_visibility |
STRING |
|
message_list_visibility |
STRING |
|
messages_total |
FLOAT64 |
|
messages_unread |
FLOAT64 |
|
name |
STRING |
|
threads_total |
FLOAT64 |
|
threads_unread |
FLOAT64 |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
messages (4 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
id |
STRING |
|
thread_id |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
messages_details (13 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
history_id |
STRING |
|
id |
STRING |
|
internal_date |
STRING |
|
payload__body__data |
STRING |
|
payload__body__size |
FLOAT64 |
|
payload__filename |
STRING |
|
payload__mime_type |
STRING |
|
payload__part_id |
STRING |
|
size_estimate |
FLOAT64 |
|
snippet |
STRING |
|
thread_id |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: messages_details__label_ids
Section titled “Subtable: messages_details__label_ids”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
value |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: messages_details__payload__headers
Section titled “Subtable: messages_details__payload__headers”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
name |
STRING |
|
value |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: messages_details__payload__parts
Section titled “Subtable: messages_details__payload__parts”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
body__data |
STRING |
|
body__size |
FLOAT64 |
|
filename |
STRING |
|
mime_type |
STRING |
|
part_id |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: messages_details__payload__parts__headers
Section titled “Subtable: messages_details__payload__parts__headers”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
name |
STRING |
|
value |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
profile (6 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
email_address |
STRING |
|
history_id |
STRING |
|
messages_total |
FLOAT64 |
|
threads_total |
FLOAT64 |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
threads (5 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
history_id |
STRING |
|
id |
STRING |
|
snippet |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
threads_details (4 columns)
| Column | Type | Description |
|---|---|---|
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
history_id |
STRING |
|
id |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: threads_details__messages
Section titled “Subtable: threads_details__messages”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
history_id |
STRING |
|
id |
STRING |
|
internal_date |
STRING |
|
payload__body__data |
STRING |
|
payload__body__size |
FLOAT64 |
|
payload__filename |
STRING |
|
payload__mime_type |
STRING |
|
payload__part_id |
STRING |
|
size_estimate |
FLOAT64 |
|
snippet |
STRING |
|
thread_id |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: threads_details__messages__label_ids
Section titled “Subtable: threads_details__messages__label_ids”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
value |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: threads_details__messages__payload__headers
Section titled “Subtable: threads_details__messages__payload__headers”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
name |
STRING |
|
value |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: threads_details__messages__payload__parts
Section titled “Subtable: threads_details__messages__payload__parts”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
body__data |
STRING |
|
body__size |
FLOAT64 |
|
filename |
STRING |
|
mime_type |
STRING |
|
part_id |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
Subtable: threads_details__messages__payload__parts__headers
Section titled “Subtable: threads_details__messages__payload__parts__headers”| Column | Type | Description |
|---|---|---|
_kaivo_parent_id |
STRING |
Foreign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo. |
_kaivo_id |
STRING |
Primary key that uniquely identifies the row. Auto-generated by Kaivo. |
name |
STRING |
|
value |
STRING |
|
_kaivo_extracted_at |
TIMESTAMP |
Timestamp that shows when the row was extracted. Auto-generated by Kaivo. |
How the Gmail sync works
Section titled “How the Gmail sync works”After the first load, Kaivo keeps your BigQuery warehouse up to date for you. Where Gmail supports it, each sync pulls only new and changed records so it stays fast; otherwise it refreshes the whole table. Every record keeps its original ID, so you won’t get duplicate rows.
Frequently asked questions
Section titled “Frequently asked questions”How long does the initial sync take for Gmail?
Section titled “How long does the initial sync take for Gmail?”It depends on how much history is in your Gmail account. Most initial syncs finish within minutes, while large accounts can take a few hours. After that, syncs only fetch new and changed records, so they’re much faster.
Can I sync only some tables or columns?
Section titled “Can I sync only some tables or columns?”Yes. You pick which tables to sync when you set up the connection and can change the selection later. Tables you don’t select are never copied to your warehouse.
What happens when Gmail’s schema changes?
Section titled “What happens when Gmail’s schema changes?”New fields are never added automatically. You choose which fields to sync, so data you haven’t selected (sensitive personal data, for example) never lands in your warehouse. When a new field appears, it becomes available for you to add. What happens to removed or renamed fields depends on a table’s sync mode: full-refresh tables always match what’s currently in Gmail, so dropped fields disappear, while incremental tables keep their existing columns and history, so an old field stays and newly added fields fill in over time.
How do I handle GDPR or data deletion requests?
Section titled “How do I handle GDPR or data deletion requests?”Your data lives in your own Kaivo-managed BigQuery warehouse, so the most direct option is to delete or anonymise specific records right in BigQuery. If you delete data in Gmail instead, full-refresh tables drop it on the next sync, while incremental tables keep it, so you would remove the row in BigQuery or ask us to run a full refresh. To remove everything, delete the Gmail connector in Kaivo and all of its synced data is deleted with it.
Common use cases for Gmail data
Section titled “Common use cases for Gmail data”Label volume
Section titled “Label volume”Use labels_details to see message and unread counts per label and where backlog builds up.
Mailbox trends
Section titled “Mailbox trends”Track the profile totals to watch how message and thread counts grow over time.
Thread activity
Section titled “Thread activity”Use threads_details and message snippets to understand conversation activity.
Combine with other data
Section titled “Combine with other data”Bring Gmail metadata into BigQuery to report on it next to the rest of your data.
Use Gmail data in your AI and BI tools
Section titled “Use Gmail data in your AI and BI tools”Once Gmail data lands in your Kaivo-managed BigQuery warehouse, you can explore it with AI tools or any BI tool that connects to BigQuery. Here’s how the most common destinations work with Gmail data.
Claude
Section titled “Claude”Use Kaivo’s MCP server to give Claude secure, workspace-scoped access to your data. Setup guide →
Power BI
Section titled “Power BI”Microsoft’s BI tool with a native BigQuery connector. Supports direct query and scheduled refresh. Setup guide →
Data Studio
Section titled “Data Studio”Free Google BI tool with native BigQuery support. One-click connection to your Kaivo warehouse; great for SMB teams on Google Workspace. Setup guide →
Tableau
Section titled “Tableau”The premium analytics standard, with native BigQuery integration. Setup guide →
Google Sheets
Section titled “Google Sheets”Use Connected Sheets to query BigQuery directly from a spreadsheet, with no SQL. Setup guide →
Connect via Power Query’s BigQuery connector. Setup guide →
Metabase
Section titled “Metabase”Open-source BI tool with strong BigQuery support. Setup guide →
See our pricing page for Gmail connector pricing and plan details.