Skip to content

Update an account-level webhook

Request

Update an existing account-level webhook by replacing its URL, description, and event types. The webhook is identified by webhook_id and completely replaced with the new configuration. Note: Webhook changes can take up to 10 minutes to become effective due to caching.

Security
basicAuth
Path
webhook_idstringrequired

The webhook ID to update

Bodymultipart/form-datarequired
descriptionstring

Description for the webhook

event_typesstringrequired

Event types to subscribe to. Use multiple times to specify multiple event types. Maximum of 3 unique URLs per event type.

Enum ValueDescription
accepted

The accepted event occurs when Mailgun accepts a message for delivery.

clicked

The clicked event occurs when a recipient clicks a link in the email. This requires click tracking to be enabled for the domain.

opened

The opened event occurs when a recipient opens the email. This requires open tracking to be enabled for the domain.

unsubscribed

The unsubscribed event occurs when a recipient unsubscribes using an unsubscribe mechanism in your email (for example, a list-unsubscribe link).

delivered

The delivered event occurs when an email is successfully delivered to the recipient's mail server.

permanent_fail

The permanent_fail event occurs when an email cannot be delivered due to a permanent error.

temporary_fail

The temporary_fail event occurs when an email cannot be delivered due to a temporary error.

complained

The complained event occurs when a recipient marks your email as spam or their email provider registers a spam complaint.

urlstringrequired

URL for webhook to be sent to

curl -i -X PUT \
  -u '<username>:<password>' \
  'https://api.mailgun.net/v1/webhooks/{webhook_id}' \
  -H 'Content-Type: multipart/form-data' \
  -F description=string \
  -F event_types=accepted \
  -F url=string

Responses

A 204 response

Response
No content