Overview
Add Mailgun to any ModuleX agent or workflow. Transactional email API integration for sending, receiving, and tracking email via the Mailgun REST API (api.mailgun.net).
Categories : Communication · Email · Auth : Mailgun API Key · Actions : 9
Authentication
Mailgun API Key
Authenticate using your Mailgun API key and region
Step 2
Go to Settings > API Security
Step 3
Copy your Private API key
Step 4
Set MAILGUN_REGION to ‘EU’ if your account is on the EU infrastructure, otherwise leave as ‘US’
Required Credentials
Field Description Required Format Mailgun API Key Private API key from Mailgun dashboard (Settings > API Security) Yes key-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMailgun Region API region: ‘US’ (default) or ‘EU’ No US
Available Actions
send_email — Send an email via Mailgun
Parameters Mailgun domain name to send from
Recipient email address(es) as a list of strings
Enable Mailgun test mode (message accepted but not delivered) (Default: true)
Enable or disable DKIM signatures on the message (Default: true)
Enable or disable tracking on the message (Default: true)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"id" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Id"
},
"message" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Message"
}
},
"required" : [
"success"
],
"title" : "SendEmailOutput" ,
"type" : "object"
}
verify_email — Verify an email address for deliverability using Mailgun's validation API
Parameters Response {
"$defs" : {
"EmailVerificationResult" : {
"additionalProperties" : false ,
"properties" : {
"address" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Address"
},
"did_you_mean" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Did You Mean"
},
"is_disposable_address" : {
"anyOf" : [
{
"type" : "boolean"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Is Disposable Address"
},
"is_role_address" : {
"anyOf" : [
{
"type" : "boolean"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Is Role Address"
},
"reason" : {
"items" : {
"type" : "string"
},
"title" : "Reason" ,
"type" : "array"
},
"result" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Result"
},
"risk" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Risk"
}
},
"title" : "EmailVerificationResult" ,
"type" : "object"
}
},
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"verification" : {
"anyOf" : [
{
"$ref" : "#/$defs/EmailVerificationResult"
},
{
"type" : "null"
}
],
"default" : null
}
},
"required" : [
"success"
],
"title" : "VerifyEmailOutput" ,
"type" : "object"
}
create_mailinglist_member — Add a member to an existing Mailgun mailing list
Parameters Email address of the member to add
Display name of the member
Extra arbitrary member data as a JSON object
Subscription status: ‘yes’ (default) or ‘no’ for unsubscribed (Default: yes)
If ‘yes’, update existing member; if ‘no’, error on duplicate. Values: yes, no (Default: no)
Response {
"$defs" : {
"MailinglistMember" : {
"additionalProperties" : false ,
"properties" : {
"address" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Address"
},
"name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Name"
},
"subscribed" : {
"anyOf" : [
{
"type" : "boolean"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Subscribed"
},
"vars" : {
"anyOf" : [
{
"additionalProperties" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "integer"
},
{
"type" : "number"
},
{
"type" : "boolean"
},
{
"type" : "null"
}
]
},
"type" : "object"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Vars"
}
},
"title" : "MailinglistMember" ,
"type" : "object"
}
},
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"member" : {
"anyOf" : [
{
"$ref" : "#/$defs/MailinglistMember"
},
{
"type" : "null"
}
],
"default" : null
}
},
"required" : [
"success"
],
"title" : "CreateMailinglistMemberOutput" ,
"type" : "object"
}
create_route — Create a new Mailgun route for email matching and forwarding
Parameters Route priority (lower numbers are evaluated first)
Human-readable description of the route
Mailgun route filter expression, e.g. match_recipient(’.*@example.com’)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"route_id" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Route Id"
},
"route_message" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Route Message"
}
},
"required" : [
"success"
],
"title" : "CreateRouteOutput" ,
"type" : "object"
}
delete_mailinglist_member — Delete a member from a Mailgun mailing list by email address
Parameters Email address of the member to remove
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"member_address" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Member Address"
},
"message" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Message"
}
},
"required" : [
"success"
],
"title" : "DeleteMailinglistMemberOutput" ,
"type" : "object"
}
list_domains — List all domains configured in the Mailgun account
Parameters Filter by domain state: active, unverified, disabled (Default: active)
Response {
"$defs" : {
"DomainSummary" : {
"additionalProperties" : false ,
"properties" : {
"name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Name"
},
"state" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "State"
},
"type" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Type"
},
"created_at" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Created At"
},
"smtp_login" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Smtp Login"
},
"web_prefix" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Web Prefix"
}
},
"title" : "DomainSummary" ,
"type" : "object"
}
},
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"domains" : {
"items" : {
"$ref" : "#/$defs/DomainSummary"
},
"title" : "Domains" ,
"type" : "array"
},
"total_count" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Total Count"
}
},
"required" : [
"success"
],
"title" : "ListDomainsOutput" ,
"type" : "object"
}
list_mailinglist_members — List all members of a Mailgun mailing list
Parameters Filter by subscription: ‘true’ for subscribed only, ‘false’ for unsubscribed only, or omit for all
Response {
"$defs" : {
"MailinglistMember" : {
"additionalProperties" : false ,
"properties" : {
"address" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Address"
},
"name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Name"
},
"subscribed" : {
"anyOf" : [
{
"type" : "boolean"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Subscribed"
},
"vars" : {
"anyOf" : [
{
"additionalProperties" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "integer"
},
{
"type" : "number"
},
{
"type" : "boolean"
},
{
"type" : "null"
}
]
},
"type" : "object"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Vars"
}
},
"title" : "MailinglistMember" ,
"type" : "object"
}
},
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"members" : {
"items" : {
"$ref" : "#/$defs/MailinglistMember"
},
"title" : "Members" ,
"type" : "array"
},
"total_count" : {
"anyOf" : [
{
"type" : "integer"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Total Count"
}
},
"required" : [
"success"
],
"title" : "ListMailinglistMembersOutput" ,
"type" : "object"
}
retrieve_mailinglist_member — Get details of a specific mailing list member by email address
Parameters Email address of the member to retrieve
Response {
"$defs" : {
"MailinglistMember" : {
"additionalProperties" : false ,
"properties" : {
"address" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Address"
},
"name" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Name"
},
"subscribed" : {
"anyOf" : [
{
"type" : "boolean"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Subscribed"
},
"vars" : {
"anyOf" : [
{
"additionalProperties" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "integer"
},
{
"type" : "number"
},
{
"type" : "boolean"
},
{
"type" : "null"
}
]
},
"type" : "object"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Vars"
}
},
"title" : "MailinglistMember" ,
"type" : "object"
}
},
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"member" : {
"anyOf" : [
{
"$ref" : "#/$defs/MailinglistMember"
},
{
"type" : "null"
}
],
"default" : null
}
},
"required" : [
"success"
],
"title" : "RetrieveMailinglistMemberOutput" ,
"type" : "object"
}
suppress_email — Add an email address to a Mailgun suppression list (bounces, unsubscribes, or complaints)
Parameters Email address to suppress
Suppression list category: bounces, unsubscribes, or complaints
Bounce error code (only for ‘bounces’ category) (Default: 550)
Bounce error message (only for ‘bounces’ category)
Tag to unsubscribe from (only for ‘unsubscribes’ category). Use ’*’ for all. (Default: *)
Response {
"additionalProperties" : false ,
"properties" : {
"success" : {
"title" : "Success" ,
"type" : "boolean"
},
"error" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Error"
},
"message" : {
"anyOf" : [
{
"type" : "string"
},
{
"type" : "null"
}
],
"default" : null ,
"title" : "Message"
}
},
"required" : [
"success"
],
"title" : "SuppressEmailOutput" ,
"type" : "object"
}
Limits & Quotas
Free tier : 100 emails/day for the first 30 days (sandbox domain).
Paid plans : rate limits vary by plan; see https://www.mailgun.com/pricing/ .
Email validation : billed separately per validation request.
Error model : non-2xx responses and timeouts are caught and returned as success=False + error rather than raising.
Links