# Email Unsubscribe Page

Every email campaign needs an unsubscribe option.

Netmera supports two setups. You can also support category-based opt-out.

### Choose your model

#### Global unsubscribe (one-click opt-out)

Use this when any unsubscribe should stop all campaign emails.

#### Category-based unsubscribe (preference management)

Use this when you want per-topic opt-out. This requires [Message Categories](/netmera-user-guide/panel-settings/netmera-panel-settings/message-categories.md).

{% hint style="info" %}
If Message Categories are enabled, send `categoryIds`. Otherwise, the unsubscribe acts as a global opt-out.
{% endhint %}

### Option 1: Netmera-hosted unsubscribe page

This is the fastest setup. You only add a link to your email template.

#### Global unsubscribe link

```
https://cdn.netmera-web.com/unsubscribe/?appkey=@{appkey}&userid=@{email}&campaignId=@{campaignId}
```

#### Category-based unsubscribe link

```
https://cdn.netmera-web.com/unsubscribe/?appkey=@{appkey}&userid=@{email}&campaignId=@{campaignId}&categoryIds=@{ctgid}
```

Parameters:

* `appkey`: your Netmera application key.
* `userid`: your user identifier (commonly the email address).
* `campaignId`: the email campaign ID.
* `categoryIds`: one or more category IDs to unsubscribe from.

#### See who unsubscribed

1. Go to **Panel > Campaigns**.
2. Open a completed email campaign.
3. See [Broken mention](broken://pages/MkdMfSclktOIqr16TiPy),
4. Or search the **Email Unsubscribe** event on Event Insight&#x20;

<figure><img src="/files/USMsYUDJCq2uPlR7jPKC" alt="" width="563"><figcaption><p>Netmera-hosted Unsubscribe Page</p></figcaption></figure>

### Option 2: Custom unsubscribe page (you host)

Use this when you want full branding control. You still report the opt-out back to Netmera.

#### How it works

1. Put your own unsubscribe URL in the email template.
2. When the user confirms, call Netmera’s unsubscribe endpoint.
3. Optionally collect and send an unsubscribe reason.

#### Endpoint

Send a `POST` request when the user unsubscribes:

```
https://report.netmera.com/reporter/email-unsubscribe/{appKey}/{userId}/{campaignId}/{reason}
```

* `appKey`: required.
* `userId`: required. Usually the email address.
* `campaignId`: required.
* `reason`: optional. Free text or a short code.

{% hint style="info" %}
If you send a reason, it also appears in reporting under the email unsubscribe event. This helps you analyze opt-out drivers.
{% endhint %}

### Category-based unsubscribe (custom page)

Add `categoryIds` as a repeatable query parameter. Send multiple IDs by repeating the key.

```
POST https://report.netmera.com/reporter/email-unsubscribe/{appKey}/{userId}/{campaignId}/{reason}?categoryIds=1&categoryIds=2&categoryIds=
```

* `appKey`: required.
* `userId`: required. Usually the email address.
* `campaignId`: required.
* `reason`: optional. Free text or a short code.
* `categoryIds` is handled as a list of integers.
* Keep using your own page link in templates for this flow.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://user.netmera.com/netmera-user-guide/omnichannel-engagement/email/email-unsubscribe-page.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
