Skip to content

Update a single forward rule by ID

Request

All parameters are optional; only the provided fields will be updated. Submit an explicit empty value for forward.recipient or forward.url to clear that destination type. A rule must retain at least one forwarding action.

Security
basicAuth
Path
idstringrequired

The ID of the forward rule

Query
matchstring

A wildcard expression which matches the recipient address to forward. This is an insensitive match address

forward.urlstring

A URL to forward when the rule matches the recipient. May be repeated up to 3 times. Must be a valid URL that resolves. Submit an explicit empty value to clear all URL destinations.

forward.recipientstring

An email address to forward to when the rule matches the recipient. May be repeated up to 5 times. Submit an explicit empty value to clear all recipient destinations.

forward.storestring

A URL which will be used to notify you when the email arrives along with a URL you can use to retrieve the message. Must be a valid URL that resolves. Submit an explicit empty value to clear the store destination.

curl -i -X PUT \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v3/forwards/{id}?match=string&forward.url=string&forward.recipient=string&forward.store=string'

Responses

A 200 response

Bodyapplication/json
idstringrequired
account_idstringrequired
domain_namestringrequired
domain_idstringrequired
matchstringrequired
forwardobject(github.com-mailgun-pathfinder-httpapi-Forward)required
created_atstringrequired
updated_atstringrequired
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" }