Node reference
Mailgun
Mailgun node reference - all 83 operations, the credential it needs, and a worked example.
Mailgun API (Email marketing), 83 operations: send email (attachments, templates, tags, scheduling, tracking, batch recipient variables) and raw MIME, stored-message retrieval and resend, sending queues; templates and template versions; bounce, unsubscribe, complaint and allowlist suppressions; mailing lists and members including bulk add and list validation; inbound routes; domain and account webhooks; logs, events, metrics and tags; domains; and email validation. US and EU regions.
Credential: Mailgun private API key - see Credentials.
Each operation below lists the API key type it needs. API key types are decided when the key is created in the Mailgun dashboard. Mailgun has no OAuth, no consent screen and no per-endpoint scopes - but it is not scope-free either, because it issues two kinds of key with very different reach. The primary account API key (Account Settings > API Keys > Private API key) can call every endpoint below for every sending domain. A Domain Sending Key (Sending > Domains > your domain > Domain Settings > Sending API keys) can call exactly two of them - POST /messages and POST /messages.mime, and only for the domain it was created under - so a sending key pasted into this node works for Send email and 401s on all 81 other operations. That is the single most common Mailgun credential mistake. A second axis fails identically without being a permission at all: keys are per-REGION, so a US key used against api.eu.mailgun.net (or the reverse) is indistinguishable from a wrong key - check the node's Region field before rotating anything. If a run fails with a permission error, the node names the missing API key type in the error - grant it and re-run; you do not need to rebuild the workflow.
| Operation | What it does | API key type |
|---|
sendMessage | Send email | Domain Sending Key for this domain, or the primary account API key. This is one of only two endpoints a sending key can call. |
sendMimeMessage | Send email (raw MIME) | Domain Sending Key for this domain, or the primary account API key. This is one of only two endpoints a sending key can call. |
getStoredMessage | Get a stored message | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
resendStoredMessage | Resend a stored message | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getSendingQueues | Get sending queue status | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listTemplates | List templates | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getTemplate | Get template | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
createTemplate | Create template | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateTemplate | Update template description | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteTemplate | Delete template | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
copyTemplate | Copy template to another account | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
renameTemplate | Rename template | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
listTemplateVersions | List template versions | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getTemplateVersion | Get template version | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
createTemplateVersion | Create template version | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateTemplateVersion | Update template version | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteTemplateVersion | Delete template version | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
copyTemplateVersion | Copy template version | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listBounces | List bounces | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getBounce | Get bounce | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
addBounces | Add bounce(s) | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteBounce | Delete bounce | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listUnsubscribes | List unsubscribes | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getUnsubscribe | Get unsubscribe | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
addUnsubscribes | Add unsubscribe(s) | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteUnsubscribe | Delete unsubscribe | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listComplaints | List complaints | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getComplaint | Get complaint | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
addComplaints | Add complaint(s) | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteComplaint | Delete complaint | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listAllowlist | List allowlist entries | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getAllowlistEntry | Get allowlist entry | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
addAllowlistEntry | Add allowlist entry | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteAllowlistEntry | Delete allowlist entry | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listMailingLists | List mailing lists | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getMailingList | Get mailing list | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
createMailingList | Create mailing list | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateMailingList | Update mailing list | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteMailingList | Delete mailing list | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
listMailingListMembers | List members | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getMailingListMember | Get member | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
addMailingListMember | Add member | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
addMailingListMembers | Add members in bulk (JSON) | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateMailingListMember | Update member | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteMailingListMember | Delete member | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
startListValidation | Start list validation | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getListValidation | Get list validation status | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
cancelListValidation | Cancel list validation | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listRoutes | List routes | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getRoute | Get route | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
createRoute | Create route | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateRoute | Update route | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteRoute | Delete route | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
matchRoute | Match an address against the routes | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listDomainWebhooks | List domain webhooks | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getDomainWebhook | Get domain webhook by event type | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
createDomainWebhook | Create domain webhook (one event type) | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateDomainWebhook | Update domain webhook URLs | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteDomainWebhook | Delete domain webhook by event type | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
createDomainWebhookV4 | Create domain webhook (many event types) | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateDomainWebhookV4 | Re-map a webhook URL to event types | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteDomainWebhookV4 | Delete a webhook URL from all event types | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listAccountWebhooks | List account webhooks | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getAccountWebhook | Get account webhook | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
createAccountWebhook | Create account webhook | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateAccountWebhook | Update account webhook | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteAccountWebhook | Delete account webhook | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getWebhookSigningKey | Get the webhook signing key | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
queryLogs | Query logs | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getEvents | Get events (legacy) | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
queryMetrics | Query metrics | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
queryUsageMetrics | Query usage metrics | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
listTags | List / search tags | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
updateTag | Update tag description | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
deleteTag | Delete tag | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getTagLimits | Get tag limits | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
listDomains | List domains | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getDomain | Get domain | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
verifyDomain | Re-check domain DNS records | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
| Operation | What it does | API key type |
|---|
validateEmail | Validate an email address | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
listBulkValidationJobs | List bulk validation jobs | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
getBulkValidationJob | Get bulk validation job | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
cancelBulkValidationJob | Cancel bulk validation job | Primary account API key (Account Settings → API Keys → Private API key). A Domain Sending Key cannot call this endpoint. |
Send from an EU-region Mailgun account
Mailgun runs two independent regions with separate hosts, separate accounts and separate API keys. The node hardcoded the US host until SW21-era work, which meant an EU customer's every call 401'd with nothing explaining why. region is a node field rather than a credential field so existing credentials did not need migrating; it defaults to us, so saved workflows keep hitting the host they always did.
Set Operation to sendMessage, then fill in:
| Field | Value | Notes |
|---|
region | eu | us (default) or eu — must match the region the account and key were created in |
domain | mg.acme.eu | The sending domain, as configured in Mailgun |
fromEmail | noreply@mg.acme.eu | |
toEmail | {{ myTrigger.email }} | |
subject | Welcome to Acme | |
html | <p>Hi {{ myTrigger.firstName }}, your account is ready.</p> | HTML body; text is the plain-text alternative |
Sets {{mail.id}} (Mailgun's queued message id) and {{mail.message}}.