/
Create a route
Adds a new route to the account
Security
basicAuth
Smaller number indicates higher priority. Higher priority routes are handled first. Defaults to 0.
- US Mailgunhttps://api.mailgun.net/v3/routes
- EU Mailgunhttps://api.eu.mailgun.net/v3/routes
curl -i -X POST \
-u '<username>:<password>' \
https://api.mailgun.net/v3/routes \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d priority=0 \
-d 'description=it'\''s a new route' \
-d 'expression=match_recipient('\''.*@gmail.com'\'')' \
-d 'action=["forward(\"http://myhost.com/messages/\")","stop()"]'Response
{ "message": "Route has been created", "route": { "id": "4f3bad2335335426750048c6", "priority": 0, "description": "it's a new route", "expression": "match_recipient('.*@gmail.com')", "actions": [ … ], "created_at": "Wed, 15 Feb 2012 13:03:31 GMT" } }