> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference blacklist

> Maintain the WEBSALE newsletter email blacklist through the Admin Interface API: add hashed addresses or remove entries to control campaign delivery.

The `/blacklist/` interface enables the management of a blacklist for email addresses that should be excluded from newsletter mailings.

Corresponding endpoints can be used to add new entries or delete existing ones.

***

## Supported methods

List of all supported methods.

| **Command/info**     | **Endpoints** | **GET**             | **POST**              | **PUT**             | **DELETE**          |
| -------------------- | ------------- | ------------------- | --------------------- | ------------------- | ------------------- |
| **Manage blacklist** | blacklist/    | <Icon icon="ban" /> | <Icon icon="check" /> | <Icon icon="ban" /> | <Icon icon="ban" /> |

## Using the methods

### POST blacklist/add

This endpoint adds an email address to the blacklist.

The address is transmitted in the request body and, on successful processing, stored as a hash. The response indicates whether the operation was successful (`true`) or failed (`false`).

Access to this endpoint requires a user account with the appropriate permissions.

#### Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://www.<your-shop>.de/admin/api/v1/blacklist/add
```

#### Request body

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "email": "example@example.com"
}
```

#### Response

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
true/false
```

#### Error codes

| **Error**        | **Type**           | **Reason**                                                        |
| ---------------- | ------------------ | ----------------------------------------------------------------- |
| 401 Unauthorized |                    | Not authorized: you are not logged in.                            |
| 403 Forbidden    |                    | You do not have the required permissions to write blacklist data. |
| 400 Bad Request  |                    | Request body could not be loaded.                                 |
| 400 Bad Request  | "missing"          | `email` was not provided.                                         |
| 400 Bad Request  | "invalidFormat"    | `email` is not a string.                                          |
| 400 Bad Request  | "invalidValue"     | `email` must not be empty.                                        |
| 400 Bad Request  | "unknownDataField" | An unknown field was provided.                                    |

### POST blacklist/remove

This endpoint removes an email address from the blacklist.

The address is transmitted in the request body. The response indicates whether the operation was successful (`true`) or failed (`false`).

Access to this endpoint requires a user account with the appropriate permissions.

#### Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://www.<your-shop>.de/admin/api/v1/blacklist/remove
```

#### Request body

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "email": "example@example.com"
}
```

#### Response

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
true/false
```

#### Error codes

| **Error**        | **Type**           | **Reason**                                                         |
| ---------------- | ------------------ | ------------------------------------------------------------------ |
| 401 Unauthorized |                    | Not authorized: you are not logged in.                             |
| 403 Forbidden    |                    | You do not have the required permissions to delete blacklist data. |
| 400 Bad Request  |                    | Request body could not be loaded.                                  |
| 400 Bad Request  | "missing"          | `email` was not provided.                                          |
| 400 Bad Request  | "invalidFormat"    | `email` is not a string.                                           |
| 400 Bad Request  | "invalidValue"     | `email` must not be empty.                                         |
| 400 Bad Request  | "unknownDataField" | An unknown field was provided.                                     |

## Support

Bei technischen Fragen und Hilfestellungen ist unser Support-Team für Sie erreichbar: [Zum Kundenportal](https://websale.atlassian.net/servicedesk/customer/portal/6)

Bitte senden Sie uns eine möglichst detaillierte Beschreibung sowie Screenshots, Requests/Antworten, damit wir Ihre Anfrage zeitnah und zielführend beantworten können.
