---
title: Webhooks
slug: campaign/docs/NlcG-webhooks
docTags: 
createdAt: 2026-07-20T15:45:08.879Z
---

## Overview

:::hint{type="info"}
**Note**

To enable this feature, contact [customer support](docId\:ZWe1T3UPz3JW6_4mc76qV).
:::

This topic describes how to use webhooks to send real-time [event data](docId\:l1fmyem53PgyeFhBqlqHe) about your campaigns from Optimizely Campaign to other applications. You can create webhooks for the following events:

- Message opened (open)
- Link clicked (click)
- Message sent (sent)
- Message bounced (bounce)
- Recipent unsubscribed (unsubscribe)
- Spam complaint (spamcomplaint)
- Opt-in (singleoptin, confirmedoptin, doubleoptin)
- Recipient added to blocklist (blocklist)
- Sent message was archived (archive)
- Message discarded due to blocklist entry (filteredbyblocklist)

For example, you can use the data for notifications and analyses in external systems such as CRM software. You manage webhooks using the Optimizely Campaign [REST API](docId\:XhqDfbEVueM9jA-rOwNM6).

Additionally, there are webhooks of the type *node* which are used for [app connections](docId\:u1JjXABfIuf6zf6ixuTy6).

:::hint{type="info"}
**Note**

Make sure you adhere to all statutory regulations when sharing any data with a third-party application!
:::

## [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Creating and managing webhooks

### Creating webhooks

**Prerequisites:** You see the Optimizely Campaign [REST API Website](https://api.campaign.episerver.net/apidoc/).

1. Open the operation [Create a webhook](https://api.campaign.episerver.net/apidoc/index.html#/Webhooks/createWebhook) and click **Try it out**.

   ![Image: Try it out](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/G6VEzi3MbK0mcBKXJjg9O-20260720-145204.png "Image: Try it out")
2. Enter the following information in the corresponding mandatory fields:
   - **clientId**. Client ID. To see the client ID, open the Optimizely Campaign menu and select **Administration** > **API Overview** > **REST API**.
   - **targetUrl**. URL to which the event data is to be sent.
     Prerequisites:
     - URL must be accessible and able to receive data via HTTP POST requests from the IP address 193.169.180.1 at any time
     - current HTTPS version and standard port 443 for HTTPS connections
   - **type**. Type of the event data to be sent.
     - **open**. Opened mailing.
     - **click**. Clicked links.
     - **sent**. Sent mailing.
     - **bounce**. Generated hard or soft bounce.
     - **unsubscribe**. Unsubscribed from newsletters. See also: [Unsubscribers](docId:2wUKfol9g5WNDgfoer24-).
     - **spamcomplaint**. Message marked as spam.
     - **singleoptin**. New recipient via single opt-in.
     - **confirmedoptin**. New recipient via confirmed opt-in.
     - **doubleoptin**.New recipient via double Opt-in.
     - **blocklist**. Recipient added to a blocklist.
     - **archive**. Sent message archived.
     - **filteredbyblocklist**. Message discarded due to a blocklist entry.
   - **format**. Data format in which the event data is to be sent.

     :::hint{type="info"}
     **Note**

     The following data format is currently available: *JSON*.
     :::
3. Optionally, enter the following information if you want to submit the Basic HTTP Authentication header:
   - **basicAuthUsername**. User name.
   - **basicAuthPassword**. Password.
4. Click **Execute**. If the creation was successful, you receive the HTTP response status code 201.

### [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Retrieving webhook information

**Context:** Examples for webhook information are *webhook ID*, *target URL* and *event type*.

**Prerequisites:** You see the Optimizely Campaign [REST API Website](https://api.campaign.episerver.net/apidoc/).

1. Open the operation [Get information about all webhooks](https://api.campaign.episerver.net/apidoc/index.html#/Webhooks/selectWebhooks) and click **Try it out**.
2. In the **clientId** mandatory field, enter your client ID. To see the client ID, open the Optimizely Campaign menu and select **Administration** > **API Overview** > **REST API**.
3. Click **Execute**.

:::hint{type="info"}
**Tip**

You need the webhook ID for [updating](docId\:l1fmyem53PgyeFhBqlqHe), [verifying](docId\:l1fmyem53PgyeFhBqlqHe), [activating](docId\:l1fmyem53PgyeFhBqlqHe), [deactivating](docId\:l1fmyem53PgyeFhBqlqHe) and [deleting](docId\:l1fmyem53PgyeFhBqlqHe) the webhook.
:::

### [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Updating webhooks

**Prerequisites:** You see the Optimizely Campaign [REST API Website](https://api.campaign.episerver.net/apidoc/).

1. Open the operation [Update a webhook](https://api.campaign.episerver.net/apidoc/index.html#/Webhooks/updateWebhook) and click **Try it out**.
2. Enter the following information in the corresponding mandatory fields:
   - **clientID**. Your client ID. To see the client ID, open the Optimizely Campaign menu and select **Administration** > **API Overview** > **REST API**.
   - **webhookId**. Webhook ID. You can retrieve the webhook ID with the operation [Get information about all webhooks](docId\:l1fmyem53PgyeFhBqlqHe).
3. Update the information as described in [Creating webhooks](docId\:l1fmyem53PgyeFhBqlqHe).
4. Click **Execute**. If the update was successful, you receive the HTTP response status code 200.

### [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Verifying webhooks

**Context:** Verification checks that the webhook is ready to use and can send event data to the specified URL.

**Prerequisites:** You see the Optimizely Campaign [REST API Website](https://api.campaign.episerver.net/apidoc/).

1. Open the operation [Verify a webhook](https://api.campaign.episerver.net/apidoc/index.html#/Webhooks/verifyWebhook) and click **Try it out**.
2. Enter the following information:
   - **clientID**. Your client ID. To see the client ID, open the Optimizely Campaign menu and select **Administration** > **API Overview** > **REST API**.
   - **webhookId**. Webhook ID. You can retrieve the webhook ID with the operation [Get information about all webhooks](docId\:l1fmyem53PgyeFhBqlqHe).
   - **mailinId**. ID of a valid mailing, for example a test mailing in [Smart Campaigns](docId\:R5uUa03fN0LjqmSAh30Ol).
3. Click **Execute**. If the verification was successful, you receive the HTTP response status code 200.

### [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Activating webhooks

**Context:** To export event data in real time, you must activate the corresponding webhook.

**Prerequisites:** You see the Optimizely Campaign [REST API Website](https://api.campaign.episerver.net/apidoc/).

1. Open the operation [Activate a webhook](https://api.campaign.episerver.net/apidoc/index.html#/Webhooks/activateWebhook) and click **Try it out**.
2. Enter the following information in the corresponding mandatory fields:
   - **clientID**. Your client ID. To see the client ID, open the Optimizely Campaign menu and select **Administration** > **API Overview** > **REST API**.
   - **webhookId**. Webhook ID. You can retrieve the webhook ID with the operation [Get information about all webhooks](docId\:l1fmyem53PgyeFhBqlqHe).
3. Click **Execute**. If the activation was successful, you receive the HTTP response status code 200.

### [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Deactivating webhooks

**Context:** If you no longer want to export event data, you must deactivate the webhook. The webhook still exists and you can reactivate it later.

**Prerequisites:** You see the Optimizely Campaign [REST API Website](https://api.campaign.episerver.net/apidoc/).

1. Open the operation [Dectivate a webhook](https://api.campaign.episerver.net/apidoc/index.html#/Webhooks/deactivateWebhook) and click **Try it out**.
2. Enter the following information in the corresponding mandatory fields:
   - **clientID**. Your client ID. To see the client ID, open the Optimizely Campaign menu and select **Administration** > **API Overview** > **REST API**.
   - **webhookId**. Webhook ID. You can retrieve the webhook ID with the operation [Get information about all webhooks](docId\:l1fmyem53PgyeFhBqlqHe).
3. Click **Execute**.

### [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Deleting webhooks

**Context:** For example, if you no longer need a webhook or want to create new webhooks, but the creation limit per client is reached, you can delete webhooks.

**Prerequisites:** You see the Optimizely Campaign [REST API Website](https://api.campaign.episerver.net/apidoc/).

:::hint{type="info"}
**Note**

You can only delete deactivated webhooks. See [Deactivating a webhook](docId\:l1fmyem53PgyeFhBqlqHe).
:::

1. Open the operation [Delete a webhook](https://api.campaign.episerver.net/apidoc/index.html#/Webhooks/deleteWebhook) and click **Try it out**.
2. Enter the following information in the corresponding mandatory fields:
   - **clientID**. Your client ID. To see the client ID, open the Optimizely Campaign menu and select **Administration** > **API Overview** > **REST API**.
   - **webhookId**. Webhook ID. You can retrieve the webhook ID with the operation [Get information about all webhooks](docId\:l1fmyem53PgyeFhBqlqHe).
3. Click **Execute**.

## [NlcG-webhooks.mdx](docId\:l1fmyem53PgyeFhBqlqHe)Event data

### Overview

As soon as a mailing recipient performs an action, Optimizely Campaign sends the corresponding event data via a HTTP POST request to the target URL. The event data is sent in batches (lists) consisting of a maximum of 100 events each.

The JSON payload of a webhook contains the number of the current transmission attempt in the variable *attempt*. 

:::hint{type="info"}
**Note**

After successful data receiving, the target URL must return the HTTP response status code 200. Otherwise the export is retried every 10 seconds. If no data can be delivered three days after the event is created, the event is discarded.
:::

The following sections show sample data for various webhooks. Some lines are marked in green because they are always included in the webhook payload, the other lines are determined by the type of webhook.

### Sample data for opens

```json
[{
{
"type":"open",
"clientId":123456789001,
"created":1564590054000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"3P5W8B4-3P5W0LI-BSLXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":1234567,
"userListId":123456789003,
"attempt":2,
"remoteAddress":"10.420.3.42",
"mailingId":123456789004,
"device":"desktop",
"operatingSystem":"Windows 10",
"browser":"Firefox 64.1",
},  {
"type":"open",
"clientId":123456789001,
"created":1564590054000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W8B4-4P6W0LI-BSLXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":1234567,
"userListId":123456789003,
"attempt":5,
"remoteAddress":"10.420.3.42",
"mailingId":123456789004,
"device":"desktop",
"operatingSystem":"Windows 10",
"browser":"Firefox 64.1",
}]
```

### Sample data for clicks

```json
{
"type":"click",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W8B4-4P6W0LI-BSLXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10227900201,
"userListId":123456789003,
"attempt":5,
"link":"https://www.optimizely.com",
"mailingId":10230355206,
"remoteAddress":"10.420.3.42",
"linkId":10180855027,
"device":"desktop",
"browser":"Safari 13.1",
"operatingSystem":"Mac 10.13",
}
```

### Sample data for sent messages

```json
{
"type":"sent",
"clientId":10180860001,
"created":1617108575391,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W8B4-4P6W0LI-BSLXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10227900201,
"userListId":10180860004,
"attempt":1,
"mailingType":"campaign",
"id":"0a673110-17883138caf-178832ea49f-2690c03e51f4cc26",
"mailingId":10230355206,
"mediaType":"EMAIL",
"mailingName":"Welcome",
"created":1617108575391,
}
```

### Sample data for bounces

```json
{
"type":"bounce",
"clientId":10180860001,
"created":1617108575391,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W8B4-4P6W0LI-BSLXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10227900201,
"userListId":10180860004,
"attempt":1,
"id":"0a673102-178d27b2c8c-178d2cac0e4-c7420699923845e",
"mailingId":10230355206,
"category":"softbounce",
"mediaType":"EMAIL",
"reason":"other",
"thresholdExceeded":false,
}
```

:::hint{type="info"}
**Tip**

The `"category"` parameter defines the bounce category; `"softbounce"` or `"hardbounce"`. The `"reason"` parameter defines the bounce reason; `"spam-related"` or `"other"`. The `"thresholdExceeded"` parameter defines whether the recipient exceeded the bounce limit.
:::

### Sample data for unsubscribes

```json
{
"type":"unsubscribe",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W7B7-4P5W0LI-BALXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10237984200,
"userListId":10180860009,
"attempt":2,
"reason":"Unsubscribe via REST API",
"id":"0acb3115-17aa6042099-17aaa1c69bf-6efb42209c0b1",
"mailingId":10230355205,
"mediaType":"EMAIL"
}
```

### Sample data for spam complaints

```json
{
"type":"spamcomplaint",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W7B7-4P5W0LI-BALXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10237984200,
"userListId":10180860009,
"attempt":2,
"mailingType": "campaign",
"providerName": "AOL",
"id": "0a0a3742-17k7f11690c-13c82b66689-63eb542f53667a61",
"mailingId": 365704742069
}
```

### Sample data for single opt-in and confirmed opt-in

```json
{
"type":"singleoptin",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W7B7-4P5W0LI-BALXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10237984200,
"userListId":10180860009,
"attempt":2,
optinProcessId: 123456,
id: "abcdef",
mediaType: "EMAIL"
}
```

### Sample data for double opt-in

```json
{
"type":"doubleoptin",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W7B7-4P5W0LI-BALXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10237984200,
"userListId":10180860009,
"attempt":2,
optinProcessId: 123456,
id: abcdef,
mediaType: EMAIL,
mailingId: 123456,
mailingType: "abcdef"
mailingName: "abcdef"
}
```

### Sample data for adding recipient to blocklist

```json
{
"type":"blocklist",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W7B7-4P5W0LI-BALXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10237984200,
"userListId":10180860009,
"attempt":2
"reason": "abc"
}
```

### Sample data for archiving

```json
{
"type":"archived",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W7B7-4P5W0LI-BALXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10237984200,
"userListId":10180860009,
"attempt":2,
"id": "123456",
"mailingId": 123456,
"mailingType": "abcdef",
"mailingName": "abcdef",
"mediaType": "EMAIL"
}
```

### Sample data for discarding message due to blocklist entry

```json
{
"type":"filteredbyblocklist",
"clientId":10180860001,
"created":1617108763000,
"mediaTypesToAddresses": { "EMAIL":"john.smith@example.com" },
"mailId":"4P6W7B7-4P5W0LI-BALXEC",
"recipientId":"john.smith@example.com",
"subscriptionId":10237984200,
"userListId":10180860009,
"attempt":2,
mailingId: 123456
}
```
