> For the complete documentation index, see [llms.txt](https://docs.emaillabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emaillabs.io/en/account/settings/webhooks/webhook-configuration.md).

# Webhook Configuration

Choose the channel and event type you want to configure, then fill in the required fields.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2Fy1T05X0gl2IDNwPeHegC%2Fwebhooks-configuration%402x.png?alt=media&amp;token=d4a6aa36-7766-4d0d-8ef4-8bc3624cd3b2" alt=""><figcaption></figcaption></figure>

* **URL** - Enter the endpoint (URL) where EmailLabs servers will send the data.
* **Secondary URL (optional)** - This is a backup URL. If the main URL is unavailable or returns an error, the webhook will be sent to this backup addresses.
* **Retry rule** - Choose your preferred notification frequency:
  * **Option 1**: every 1 hour, every 6 hours, every 24 hours.
  * **Option 2:** every 30 minutes, every 2 hours, every 24 hours.
* **Authentication mode:**
  * **None** - No additional authentication.
  * **Basic auth** - If this option is activated, provide the username and password that will be used to authorize the webhook. You should also configure these credentials in the authorization settings of your endpoint.

{% hint style="info" %}
Regardless of the chosen mode, it is always recommended to verify the integrity of the incoming webhook’s hash.
{% endhint %}

#### Important Note for Transactional Emails&#x20;

If you want to receive events split by subaccounts for delivery reports, check the ‘Broken-down by sub-accounts’ checkbox.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2FrCGq0bBwdLgy2AnVXmvy%2Fwebhooks-subaccounts%402x.png?alt=media&amp;token=6a46d4ce-f4af-4537-91a1-e646e7e20e02" alt=""><figcaption></figcaption></figure>

Always use a unique `message_id` when sending emails. This allows for the aggregation of all webhooks with subsequent statuses.

* After preparing your script to receive the data, use the ‘Test’ option to check if your script is correctly receiving the data. Webhook settings will only be saved after a successful test.&#x20;
* Ensure that your endpoint returns `HTTP/1.1 200 OK`, which confirms the correct receipt of data.
* 'Generate a SecretKey', which is a unique string used to protect the transmitted data and enhance security.
* Once everything is configured and the test passes successfully, click 'Save' to apply the settings.
