/
Create a forward rule
You can add multiple email recipients by including the 'forward.recipient' parameter multiple times up to a maximum of 5.
$ curl -X POST https://api.mailgun.net/v3/forwards
-F match='email@mg.example.com'
-F forward.recipient=destination1@gmail.com
-F forward.recipient=destination2@gmail.comThe match parameter can contain a wild card expression
$ curl -X POST https://api.mailgun.net/v3/forwards
-F match='match*@mg.example.com'
-F forward.recipient=catchall@gmail.comRules only support * or literal characters where * matches any sequence of characters. So a.*@example.com matches email addresses that start with a. not email addresses that start with a like a regex match would.
Security
basicAuth
- US Mailgunhttps://api.mailgun.net/v3/forwards
- EU Mailgunhttps://api.eu.mailgun.net/v3/forwards
curl -i -X POST \
-u '<username>:<password>' \
'https://api.mailgun.net/v3/forwards?match=string&forward.url=string&forward.recipient=string&forward.store=string'Response
{ "id": "60d9431e582ecdc84b886284", "account_id": "646634cc58ea2b8fe43e0000", "domain_name": "my-domain.com", "domain_id": "642134nn58ea2b8fe43e0000", "match": "wild*card@example.com", "forward": { "urls": [ … ], "recipients": [ … ], "store": "https://my-store-url.com/store" }, "created_at": "Mon, 28 Jun 2021 03:33:50 UTC", "updated_at": "Mon, 28 Jun 2021 03:33:50 UTC" }