---
title: Mailgun API Integration on Truto
slug: mailgun
category: Email
canonical: "https://truto.one/integrations/detail/mailgun/"
---

# Mailgun API Integration on Truto



**Category:** Email  
**Status:** Generally available

## Unified APIs

### Unified User Directory API

- **Roles** — The Role object represents a role of a User.
- **Users** — The User object represents a User.

## How it works

1. **Link your customer's Mailgun account.** Use Truto's frontend SDK; we handle every OAuth and API key flow so you don't need to create the OAuth app.
2. **Authentication is automatic.** Truto refreshes tokens, stores credentials securely, and injects them into every API request.
3. **Call Truto's API to reach Mailgun.** The Proxy API is a 1-to-1 mapping of the Mailgun API.
4. **Get a unified response format.** Every response uses a single shape, with cursor-based pagination and data in the `result` field.

## Use cases

- **Let end users send emails from their own Mailgun infrastructure** — SaaS platforms can offer a 'Bring Your Own Carrier' model where end users authenticate their Mailgun accounts, allowing the SaaS to send transactional or marketing emails through the user's own domain and IP — shifting deliverability responsibility and improving inbox placement.
- **Automate inbound email parsing for ticketing and workflow apps** — Helpdesk or workflow SaaS products can programmatically configure Mailgun inbound routes on behalf of their users, capturing incoming emails as structured JSON to automatically create tickets, tasks, or database records without manual setup.
- **Sync email engagement data into CRM and sales tools** — Sales and CRM platforms can pull historical email events (opens, clicks, bounces) from a user's Mailgun account to populate contact timelines, update engagement scores, and trigger automated follow-up sequences.
- **Protect sender reputation with suppression list management** — SaaS products running outreach or notification workflows can check Mailgun's suppression lists (bounces, complaints, unsubscribes) before sending, ensuring compliance and preserving the end user's domain reputation.
- **Validate email addresses at the point of capture** — Form builders, lead-gen tools, and signup flows can use Mailgun's email validation API through the end user's account to reject typos, disposable addresses, and invalid emails before they enter the system.

## What you can build

- **User-authenticated outbound email sending** — Ship a feature where your users connect their Mailgun account and your platform sends personalized transactional or campaign emails through their authenticated domain and IPs.
- **Auto-provisioned inbound email routes** — Programmatically create Mailgun inbound routing rules on a user's account so incoming emails to addresses like support@theirdomain.com are parsed and forwarded to your app as structured data.
- **Real-time engagement webhook configuration** — Automatically register Mailgun webhooks on behalf of users so your platform receives open, click, bounce, and complaint events without requiring users to manually configure anything in the Mailgun dashboard.
- **Bounce and suppression list sync** — Continuously read a user's Mailgun suppression lists to flag invalid or unsubscribed contacts in your app, preventing sends that would damage deliverability.
- **Email event timeline for contacts** — Query a user's Mailgun events API to display a 30-day engagement history — opens, clicks, deliveries, and failures — directly on contact profiles inside your product.
- **Inline email validation on forms and imports** — Call Mailgun's address validation endpoint during CSV imports or form submissions to catch bad emails before they pollute your user's contact database.

## FAQs

### How do end users authenticate their Mailgun accounts through Truto?

Mailgun uses API key authentication. End users provide their Mailgun API key (found in their Mailgun dashboard), which Truto securely stores and uses for all subsequent API calls on their behalf.

### What Unified APIs does Truto currently support for Mailgun?

Truto currently maps Mailgun to the Unified User Directory API, covering Roles and Users resources. Additional tools and unified API mappings for Mailgun-specific capabilities (messages, routes, webhooks, events, suppressions, validation) are built on request.

### What are Mailgun's API rate limits and how does Truto handle them?

Mailgun enforces rate limits that vary by endpoint and plan — for example, the Messages API supports batch sending of up to 1,000 recipients per call. Truto handles pagination and respects rate limit headers to avoid throttling your end users' accounts.

### Can I access Mailgun-specific endpoints that aren't part of a Unified API?

Yes. Truto supports proxy requests, allowing you to call any Mailgun API endpoint directly (messages, events, suppressions, routes, webhooks, validation) through Truto's auth and connection management layer, even if a unified model isn't yet mapped.

### How fresh is the data when querying Mailgun events?

Mailgun's Events API provides near-real-time logs with a retention window of up to 30 days depending on the plan. For truly real-time data, you can programmatically register webhooks via the API to receive instant event notifications.

### Does Mailgun support multi-domain setups for a single user?

Yes. Mailgun accounts can manage multiple sending domains. API calls are scoped per domain (e.g., /v3/{domain}/messages), so your integration can target whichever domain the end user selects or your app specifies.
