<commit_before>.. _api-webhooks:

Webhooks
========

This API allows you to create, access, and delete webhooks programmatically. 

Supported webhooks, and their documentation, are listed below:

================= ========================================================
Webhook Name      Documentation
================= ========================================================
bounce            :ref:`um-tracking-bounces`
deliver		      :ref:`um-tracking-deliveries`
drop			  :ref:`um-tracking-failures`
spam              :ref:`um-tracking-spam-complaints`
unsubscribe       :ref:`um-tracking-unsubscribes`
click             :ref:`um-tracking-clicks`
open              :ref:`um-tracking-opens`
================= ========================================================


.. code-block:: url

     GET /domains/<domain>/webhooks

Returns a list of webhooks set for the specified domain.

.. code-block:: url

     GET /domains/<domain>/webhooks/<webhookname>

Returns details about a the webhook specified in the URL. 

.. code-block:: url

     POST /domains/<domain>/webhooks

Creates a new webhook. 

.. note:: Creating an Open or Click webhook will enable Open or Click tracking. 

.. container:: ptable

 ================= ========================================================
 Parameter         Description
 ================= ========================================================
 id                Name of the webhook. (See above for supported webhooks)
 url               URL for the webhook event.
 ================= ========================================================

.. code-block:: url

     PUT /domains/<domain>/webhooks/<webhookname>

Updates an existing webhook. 

.. container:: ptable

 ================= ========================================================
 Parameter         Description
 ================= ========================================================
 url               URL for the webhook event.
 ================= ========================================================
 
.. code-block:: url

     DELETE /domains/<domain>/webhooks/<webhookname>

Deletes an existing webhook. 

.. note:: Deleting an Open or Click webhook will enable Open or Click tracking. 

.. note:: Mailgun imposes a rate limit for the Webhook API endpoint. Users may 
		  issue no more than 300 requests per minute, per account. See the resultant
		  rate limit response below. 

Examples
~~~~~~~~

Return a list of webhooks set for the specified domain.<commit_msg>changes enable to disable for DELETE note:<commit_after>.. _api-webhooks:

Webhooks
========

This API allows you to create, access, and delete webhooks programmatically. 

Supported webhooks, and their documentation, are listed below:

================= ========================================================
Webhook Name      Documentation
================= ========================================================
bounce            :ref:`um-tracking-bounces`
deliver		      :ref:`um-tracking-deliveries`
drop			  :ref:`um-tracking-failures`
spam              :ref:`um-tracking-spam-complaints`
unsubscribe       :ref:`um-tracking-unsubscribes`
click             :ref:`um-tracking-clicks`
open              :ref:`um-tracking-opens`
================= ========================================================


.. code-block:: url

     GET /domains/<domain>/webhooks

Returns a list of webhooks set for the specified domain.

.. code-block:: url

     GET /domains/<domain>/webhooks/<webhookname>

Returns details about a the webhook specified in the URL. 

.. code-block:: url

     POST /domains/<domain>/webhooks

Creates a new webhook. 

.. note:: Creating an Open or Click webhook will enable Open or Click tracking. 

.. container:: ptable

 ================= ========================================================
 Parameter         Description
 ================= ========================================================
 id                Name of the webhook. (See above for supported webhooks)
 url               URL for the webhook event.
 ================= ========================================================

.. code-block:: url

     PUT /domains/<domain>/webhooks/<webhookname>

Updates an existing webhook. 

.. container:: ptable

 ================= ========================================================
 Parameter         Description
 ================= ========================================================
 url               URL for the webhook event.
 ================= ========================================================
 
.. code-block:: url

     DELETE /domains/<domain>/webhooks/<webhookname>

Deletes an existing webhook. 

.. note:: Deleting an Open or Click webhook will disable Open or Click tracking. 

.. note:: Mailgun imposes a rate limit for the Webhook API endpoint. Users may 
		  issue no more than 300 requests per minute, per account. See the resultant
		  rate limit response below. 

Examples
~~~~~~~~

Return a list of webhooks set for the specified domain.
{'fraction_non_alphanumeric': 0.32967252396166136, 'fraction_numerical': 0.0011980830670926517, 'mean_word_length': 3.915603532875368, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7356124', 'n_tokens_mistral': 1260, 'n_tokens_neox': 1121, 'n_words': 381}