Skip to content

Mailgun: Private API Key Setup

Use your Mailgun Private API key to connect a verified Mailgun domain to Patient Copilot so you can send and receive emails reliably. This guide explains where to find the key in Mailgun, exactly where to paste it in Patient Copilot at the Agency and Location levels, and how to validate and troubleshoot the connection. * * * ## What is the Mailgun Private API Key for Patient Copilot? The Mailgun Private API key authenticates Patient Copilot with your Mailgun account so Patient Copilot can access your verified sending domains, send emails, and process replies. The key is generated in Mailgun and then pasted into Patient Copilot. Once saved, eligible US‑region verified domains appear in the domain dropdown for selection at the Location level. IMPORTANT: Treat these Private API keys as a secret; do not share in tickets or screenshots. Rotate periodically or whenever you suspect exposure; generate a new key in Mailgun and update it in Patient Copilot at the Agency/Location where it’s stored. * * * ## Key Benefits of Using a Mailgun Private API Key Understanding the value of this connection helps you choose the right place to configure it and avoid sending issues. The bullets below highlight how a correct setup improves reliability, control, and scalability when emailing from Patient Copilot. - Centralized authentication: Use one key at the Agency level to power multiple Locations when appropriate. - Location‑level control: Override the Agency key at a specific Location when a client needs their own Mailgun account and domain. - Domain dropdown visibility: Selecting a verified US‑region domain from a dropdown reduces misconfiguration and ensures you send from the correct domain. - Reply handling enablement: A valid key plus a proper receiving route helps replies land in Conversations for the right sub‑account. - Security & rotation: Keys can be regenerated in Mailgun and updated in Patient Copilot to maintain account security. - Scalability: Multi‑client agencies can standardize setup, speed onboarding, and align with client‑owned infrastructure when needed. * * * ## Prerequisites Preparing the environment first prevents common blockers where the domain doesn’t appear in Patient Copilot or emails fail to send. Confirm each item before pasting your key. - A Mailgun account with at least one verified sending domain (green check) set up under the US region. - Access to the High-Level Agency view and the relevant Location with permissions to open Settings → Email Services. - DNS for the Mailgun domain is correctly configured (DKIM, SPF, MX, and tracking CNAME if you use link tracking). - Any Mailgun IP allowlist will be temporarily relaxed if needed to allow Patient Copilot to sync domains (restore after validation). * * * ## Region and Domain Visibility (US vs. EU) Patient Copilot reads verified domains from Mailgun’s US region only. If a domain is created in the EU region, it will not populate in the High-Level domain dropdown. - Ensure the Mailgun domain lives in the US and shows as Verified. - If your domain is in the EU, create/migrate a US‑region domain for use with Patient Copilot. * * * ## How To Set Up the Mailgun Private API Key in Patient Copilot Following the steps in order prevents the most common misconfigurations. Start in Mailgun to retrieve the key, then paste it into Patient Copilot at the Agency or Location level, select your domain, and validate. ### Step 1: Copy your Private API key from Mailgun Log in to Mailgun. Click your profile avatar (top‑right) → API Security. Create a new key if needed, or copy the existing Private API key.!(https://assets.patientcopilot.ai/71ba954e416b29af.png) ### Step 2: Add the key at the Agency level (optional, shared use) In Patient Copilot (Agency view), go to Settings → Email Services. Select Mailgun and paste the Private API key. Select the domain and then click Save. (Optional) Open a Location to confirm the domain appears in its dropdown after sync.!(https://assets.patientcopilot.ai/a3bcb65ff58822fa.gif) IMPORTANT: Make sure the domain is set up for US and there’s a green checkmark next to the domain.!(https://assets.patientcopilot.ai/cfa503317643e177.png) This is how a successful Connection would look-!(https://assets.patientcopilot.ai/f079c5c92b7e9e1b.png) * * * ## Location Settings Considerations - You can configure each location with your client’s own Mailgun or your Mailgun.