Skip to main content
Connectors

Mailgun connector

Set up the Mailgun connector in Kaivo: authentication, configuration, the 2 BigQuery tables it syncs, and answers to common questions.

Written By Lauri Raivio

Last updated 15 days ago

Kaivo is a fully managed data platform that syncs your Mailgun 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 Mailgun connector

Sync your Mailgun delivery data into BigQuery with Kaivo to monitor deliverability and engagement across your sending domains.

CategorySurveys & Email
AuthenticationAPI key
SetupSelf-service

Getting started with the Mailgun connector

  1. Sign up for Kaivo and create a workspace.
  2. Connect your Mailgun account.
  3. Choose which tables to sync.
  4. Wait for the initial sync to finish.
  5. Query your data in BigQuery or your favourite AI or BI tool.

Authenticating Mailgun

Authenticate with your Private API Key.

FieldDescription
Private API Key

Primary account API key to access your Mailgun data.

Configuring the Mailgun connector

When you set up the connector, you provide:

FieldDescription
Domain Region Code

Domain region code. 'EU' or 'US' are possible values. The default is 'US'.

Start Date

Any data before this date will not be fetched.

Tables and columns synced from Mailgun

Kaivo syncs 2 tables from Mailgun into a dedicated dataset in your BigQuery warehouse. Click any table to see its columns and types.

ColumnTypeDescription
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
typeSTRINGType of the domain (e.g., custom, sandbox).
created_atSTRINGThe date and time when the domain was created.
dkim_key_sizeINT64The size of the DKIM key associated with the domain.
force_dkim_authorityBOOLIndicates whether DKIM authority needs to be enforced.
idSTRINGThe unique identifier for the domain.
is_disabledBOOLSpecifies if the domain is disabled.
nameSTRINGThe name of the domain.
poolSTRINGThe pool to which the domain belongs.
require_tlsBOOLSpecifies if TLS is required for emails sent from this domain.
skip_verificationBOOLIndicates whether email verification should be skipped.
smtp_loginSTRINGSMTP login credentials for the domain.
smtp_passwordSTRINGSMTP password associated with the domain.
spam_actionSTRINGAction to take for emails marked as spam.
stateSTRINGThe current state of the domain.
web_prefixSTRINGPrefix for webhooks related to the domain.
web_schemeSTRINGThe scheme for webhook URLs (e.g., https).
wildcardBOOLIndicates if the domain allows wildcard addresses.
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.

Subtable: domains__ips

ColumnTypeDescription
_kaivo_parent_idSTRINGForeign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo.
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
valueSTRINGIP address
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.
ColumnTypeDescription
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
client_info__client_nameSTRINGName of the client device
client_info__client_osSTRINGOperating system of the client device
client_info__client_typeSTRINGType of the client device
client_info__device_typeSTRINGType of the device (e.g., desktop, mobile)
client_info__user_agentSTRINGUser agent string of the client device
delivery_status__attempt_noFLOAT64Number of delivery attempts
delivery_status__certificate_verifiedBOOLWhether the certificate is verified
delivery_status__codeSTRINGDelivery status code
delivery_status__descriptionSTRINGDescription of the delivery status
delivery_status__messageSTRINGDelivery message
delivery_status__mx_hostSTRINGMX host information
delivery_status__retry_secondsFLOAT64Number of seconds before retrying delivery
delivery_status__session_secondsFLOAT64Duration of the delivery session in seconds
delivery_status__tlsBOOLTLS information
delivery_status__utf8BOOLWhether UTF-8 encoding is used
envelop__senderSTRINGEmail address of the sender
envelop__sending_ipSTRINGIP address used for sending
envelop__targetsSTRINGList of target email addresses
envelop__transportSTRINGTransport information
eventSTRINGType of event (e.g., opened, clicked)
flags__is_authenticatedBOOLWhether the email is authenticated
flags__is_delayed_bounceBOOLFlag for delayed bounce
flags__is_routedBOOLFlag for routed email
flags__is_system_testBOOLFlag for system test email
flags__is_test_modeBOOLFlag for test mode email
geolocation__citySTRINGCity of the recipient
geolocation__countrySTRINGCountry of the recipient
geolocation__regionSTRINGRegion of the recipient
idSTRINGID of the email event
ipSTRINGIP address of the recipient
log_levelSTRINGLog level information
message__headers__fromSTRINGSender's email address
message__headers__message_idSTRINGMessage ID of the email
message__headers__subjectSTRINGSubject of the email
message__headers__toSTRINGRecipient's email address
message__sizeFLOAT64Size of the email message
methodSTRINGMethod used for the event (e.g., POST, GET)
storage__keySTRINGKey identifier for storage
storage__urlSTRINGURL for accessing stored email
reasonSTRINGReason for the event
reject__descriptionSTRINGDescription of rejection
reject__reasonSTRINGReason for rejection
recipientSTRINGEmail address of the recipient
recipient_domainSTRINGRecipient's domain name
severitySTRINGSeverity of the event
timestampFLOAT64Timestamp of the event
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.

Subtable: events__campaigns

ColumnTypeDescription
_kaivo_parent_idSTRINGForeign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo.
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
valueJSON
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.

Subtable: events__message__attachments

ColumnTypeDescription
_kaivo_parent_idSTRINGForeign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo.
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
valueJSON
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.

Subtable: events__message__recipients

ColumnTypeDescription
_kaivo_parent_idSTRINGForeign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo.
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
valueSTRING
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.

Subtable: events__routes

ColumnTypeDescription
_kaivo_parent_idSTRINGForeign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo.
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
expressionSTRINGExpression used for routing
idSTRINGID of the route
match__recipientSTRINGRecipient email address
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.

Subtable: events__tags

ColumnTypeDescription
_kaivo_parent_idSTRINGForeign key referencing _kaivo_id in the parent table. Auto-generated by Kaivo.
_kaivo_idSTRINGPrimary key that uniquely identifies the row. Auto-generated by Kaivo.
valueSTRING
_kaivo_extracted_atTIMESTAMPTimestamp that shows when the row was extracted. Auto-generated by Kaivo.

How the Mailgun sync works

After the first load, Kaivo keeps your BigQuery warehouse up to date for you. Where Mailgun 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

How long does the initial sync take for Mailgun?

It depends on how much history is in your Mailgun 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?

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 Mailgun'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 Mailgun, 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?

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 Mailgun 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 Mailgun connector in Kaivo and all of its synced data is deleted with it.

Common use cases for Mailgun data

Deliverability monitoring

Use the delivery_status code and description in events to track delivered, bounced, and failed messages with reasons.

Engagement tracking

Use client_info in events to measure opens and clicks by device and client.

Domain reporting

Join domains with events to compare deliverability across sending domains.

Product context

Combine Mailgun events with your product data to connect sends to user actions.

Use Mailgun data in your AI and BI tools

Once Mailgun 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 Mailgun data.

Claude

Use Kaivo's MCP server to give Claude secure, workspace-scoped access to your data. Setup guide →

Power BI

Microsoft's BI tool with a native BigQuery connector. Supports direct query and scheduled refresh. Setup guide →

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

The premium analytics standard, with native BigQuery integration. Setup guide →

Google Sheets

Use Connected Sheets to query BigQuery directly from a spreadsheet, with no SQL. Setup guide →

Excel

Connect via Power Query's BigQuery connector. Setup guide →

Metabase

Open-source BI tool with strong BigQuery support. Setup guide →

See our pricing page for Mailgun connector pricing and plan details.

Was this helpful?

Still need help? Share an idea