{"openapi":"3.1.0","info":{"title":"Mailgun (BYOK) API","version":"0.1.0","description":"Mailgun (BYOK) lets an AI assistant read your own Mailgun data through the Mailgun API with a key you supply (private API key). Read-only: 10 tools (list_domains, get_domain, list_events, get_account_stats, get_domain_stats, list_bounces, list_complaints, list_unsubscribes, list_tags, list_ips). The BYOK key travels with each request, is used for that one call only and is never stored, logged or...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-mailgun.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-mailgun/docs"},"termsOfService":"https://connectorbay.com/byok-mailgun/terms"},"servers":[{"url":"https://byok-mailgun.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-mailgun/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_domains":{"post":{"operationId":"list_domains","summary":"List your Mailgun sending domains with state (active, unverified, disabled), type, creation date and TLS and spam settin","description":"List your Mailgun sending domains with state (active, unverified, disabled), type, creation date and TLS and spam settings. SMTP passwords are never returned. Use for \"Which sending domains do I have in Mailgun and are they verified\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"state":{"anyOf":[{"enum":["active","unverified","disabled"],"type":"string"},{"type":"null"}],"default":null,"description":"Only domains in this state: active, unverified or disabled.","title":"State"},"search":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only domains whose name contains this text.","title":"Search"},"sort":{"anyOf":[{"enum":["name","name:asc","name:desc"],"type":"string"},{"type":"null"}],"default":null,"description":"Order: name, name:asc or name:desc (default newest first).","title":"Sort"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 1000; default 100).","title":"Limit"},"skip":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"How many domains to skip, for paging.","title":"Skip"}},"title":"list_domainsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_domain":{"post":{"operationId":"get_domain","summary":"Get one Mailgun domain with its state and settings plus the sending and receiving DNS records (type, name, value, validi","description":"Get one Mailgun domain with its state and settings plus the sending and receiving DNS records (type, name, value, validity) to publish. Use for \"Are the DNS records of my Mailgun domain valid\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"name":{"description":"Mailgun domain name, for example 'mg.example.com'.","maxLength":253,"title":"Name","type":"string"}},"required":["name"],"title":"get_domainArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_events":{"post":{"operationId":"list_events","summary":"List recent Mailgun message events of a domain (accepted, delivered, failed, opened, clicked, complained, ...) with reci","description":"List recent Mailgun message events of a domain (accepted, delivered, failed, opened, clicked, complained, ...) with recipient, subject, severity and delivery status. Mailgun keeps events for at least 3 days; at most 300 per call. Use for \"Which emails to a@example.com failed to deliver recently\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"domain_name":{"description":"Your Mailgun sending domain, for example 'mg.example.com', as listed by list_domains.","maxLength":253,"title":"Domain Name","type":"string"},"event":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Only this event type, for example delivered, failed, accepted, opened, clicked, complained, unsubscribed.","title":"Event"},"recipient":{"anyOf":[{"maxLength":320,"type":"string"},{"type":"null"}],"default":null,"description":"Only events for this recipient email address.","title":"Recipient"},"severity":{"anyOf":[{"enum":["temporary","permanent"],"type":"string"},{"type":"null"}],"default":null,"description":"For failed events: temporary or permanent.","title":"Severity"},"begin":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the time range as epoch seconds.","title":"Begin"},"end":{"anyOf":[{"maxLength":20,"type":"string"},{"type":"null"}],"default":null,"description":"End of the time range as epoch seconds.","title":"End"},"ascending":{"anyOf":[{"enum":["yes","no"],"type":"string"},{"type":"null"}],"default":"no","description":"yes for oldest first, no for newest first.","title":"Ascending"},"subject":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Only events whose message subject matches this text.","title":"Subject"},"limit":{"anyOf":[{"maximum":300,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 300; default 100).","title":"Limit"}},"required":["domain_name"],"title":"list_eventsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_account_stats":{"post":{"operationId":"get_account_stats","summary":"Get sending statistics totals for your whole Mailgun account over a time range, bucketed by hour, day or month, for the ","description":"Get sending statistics totals for your whole Mailgun account over a time range, bucketed by hour, day or month, for the events you name. Use for \"How many emails were delivered and failed across my Mailgun account this month\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"event":{"description":"Event(s) to count, comma separated: accepted, delivered, failed, opened, clicked, unsubscribed, complained, stored.","maxLength":120,"title":"Event","type":"string"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the range (RFC 2822 date or unix epoch seconds; default 7 days ago).","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"End of the range (RFC 2822 date or unix epoch seconds; default now).","title":"End"},"resolution":{"anyOf":[{"enum":["hour","day","month"],"type":"string"},{"type":"null"}],"default":null,"description":"Bucket size: hour, day or month (default day).","title":"Resolution"},"duration":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Length of the range counted back from end, for example '30d' (overrides start).","title":"Duration"}},"required":["event"],"title":"get_account_statsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_domain_stats":{"post":{"operationId":"get_domain_stats","summary":"Get sending statistics totals for one Mailgun domain over a time range, bucketed by hour, day or month, for the events y","description":"Get sending statistics totals for one Mailgun domain over a time range, bucketed by hour, day or month, for the events you name. Use for \"What is the delivery and open count of my Mailgun domain over the last 30 days\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"domain_name":{"description":"Your Mailgun sending domain, for example 'mg.example.com', as listed by list_domains.","maxLength":253,"title":"Domain Name","type":"string"},"event":{"description":"Event(s) to count, comma separated: accepted, delivered, failed, opened, clicked, unsubscribed, complained, stored.","maxLength":120,"title":"Event","type":"string"},"start":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"Start of the range (RFC 2822 date or unix epoch seconds; default 7 days ago).","title":"Start"},"end":{"anyOf":[{"maxLength":40,"type":"string"},{"type":"null"}],"default":null,"description":"End of the range (RFC 2822 date or unix epoch seconds; default now).","title":"End"},"resolution":{"anyOf":[{"enum":["hour","day","month"],"type":"string"},{"type":"null"}],"default":null,"description":"Bucket size: hour, day or month (default day).","title":"Resolution"},"duration":{"anyOf":[{"maxLength":10,"type":"string"},{"type":"null"}],"default":null,"description":"Length of the range counted back from end, for example '30d' (overrides start).","title":"Duration"}},"required":["domain_name","event"],"title":"get_domain_statsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_bounces":{"post":{"operationId":"list_bounces","summary":"List the addresses that bounced for a Mailgun domain, with SMTP error code, error text and date. Returns the first page;","description":"List the addresses that bounced for a Mailgun domain, with SMTP error code, error text and date. Returns the first page; narrow with term. Use for \"Which addresses bounced on my Mailgun domain\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"domain_name":{"description":"Your Mailgun sending domain, for example 'mg.example.com', as listed by list_domains.","maxLength":253,"title":"Domain Name","type":"string"},"term":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only addresses starting with this text.","title":"Term"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 1000; default 100).","title":"Limit"}},"required":["domain_name"],"title":"list_bouncesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_complaints":{"post":{"operationId":"list_complaints","summary":"List the addresses that marked mail from a Mailgun domain as spam, with the complaint date. Returns the first page; narr","description":"List the addresses that marked mail from a Mailgun domain as spam, with the complaint date. Returns the first page; narrow with term. Use for \"Who has complained about my Mailgun emails\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"domain_name":{"description":"Your Mailgun sending domain, for example 'mg.example.com', as listed by list_domains.","maxLength":253,"title":"Domain Name","type":"string"},"term":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only addresses starting with this text.","title":"Term"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 1000; default 100).","title":"Limit"}},"required":["domain_name"],"title":"list_complaintsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_unsubscribes":{"post":{"operationId":"list_unsubscribes","summary":"List the addresses that unsubscribed from mail of a Mailgun domain, with the tags unsubscribed from and the date. Return","description":"List the addresses that unsubscribed from mail of a Mailgun domain, with the tags unsubscribed from and the date. Returns the first page; narrow with term. Use for \"Who unsubscribed from my Mailgun emails\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"domain_name":{"description":"Your Mailgun sending domain, for example 'mg.example.com', as listed by list_domains.","maxLength":253,"title":"Domain Name","type":"string"},"term":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only addresses starting with this text.","title":"Term"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 1000; default 100).","title":"Limit"}},"required":["domain_name"],"title":"list_unsubscribesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_tags":{"post":{"operationId":"list_tags","summary":"List the message tags used on a Mailgun domain with description and first and last time seen. Use for \"Which tags do I u","description":"List the message tags used on a Mailgun domain with description and first and last time seen. Use for \"Which tags do I use in Mailgun\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"domain":{"description":"Your Mailgun sending domain, for example 'mg.example.com'.","maxLength":253,"title":"Domain","type":"string"},"prefix":{"anyOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"default":null,"description":"Only tags starting with this text.","title":"Prefix"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":100,"description":"How many records to return (1 to 1000; default 100).","title":"Limit"}},"required":["domain"],"title":"list_tagsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_ips":{"post":{"operationId":"list_ips","summary":"List the sending IP addresses of your Mailgun account with whether each is dedicated, enabled and on warm-up. Use for \"W","description":"List the sending IP addresses of your Mailgun account with whether each is dedicated, enabled and on warm-up. Use for \"Which sending IPs does my Mailgun account have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"dedicated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to list only dedicated IPs.","title":"Dedicated"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"description":"True to list only enabled IPs.","title":"Enabled"}},"title":"list_ipsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}