> ## 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 Log Manager

> Query shop logs and configure log groups and notifications through the Admin Interface API Log Manager for monitoring and automated alerting.

The interface at the `logmanager/` endpoint provides access to the logs recorded in the shop system. It lets you retrieve individual logs or entire log lists as well as perform targeted analyses by filtering by parameters such as severity, subshop or timestamp.

In addition, log groups can be created and managed to save specific filter criteria and receive notifications about new relevant entries.

The API therefore supports both manual analysis and automated monitoring of system events.

The corresponding access rights are required to use the interfaces.

***

## Supported methods

List of all supported methods.

| **Command/Info**  | **Endpoints**         | **GET**               | **POST**              | **PUT**               | **DELETE**            |
| ----------------- | --------------------- | --------------------- | --------------------- | --------------------- | --------------------- |
| **Logs**          | logmanager/logs       | <Icon icon="check" /> | <Icon icon="ban" />   | <Icon icon="ban" />   | <Icon icon="ban" />   |
| **Log groups**    | logmanager/groups     | <Icon icon="check" /> | <Icon icon="check" /> | <Icon icon="check" /> | <Icon icon="check" /> |
| **Notifications** | <Icon icon="check" /> | <Icon icon="ban" />   | <Icon icon="check" /> | <Icon icon="ban" />   |                       |

## Resources: fields in logs

### Important data fields in logs

Logs in the system are based on data from *Elasticsearch* and therefore do not follow a rigid structure. Nevertheless, there are central fields that appear in almost all log entries and can be used for filters, sorting or evaluation.

The following overview lists the most important of these fields:

| **Name**                 | **Type** | **Usage**                                                                                                                                     |
| ------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **@timestamp**           | String   | Time of creation.                                                                                                                             |
| **\_id**                 | String   | Unique ID of the log.                                                                                                                         |
| **app**                  | String   | Name of the program that generated the log (e.g. `reastapi`, `shop`, `statisticAggregator`).                                                  |
| **logger**               | String   | Name of the logger that serves to categorize (e.g. `restapi.controllers.customers`).                                                          |
| **msg**                  | String   | The message of the log.                                                                                                                       |
| **sessionId (optional)** | String   | Unique ID of the session in which the log was generated.                                                                                      |
| **severity**             | String   | Severity of the log used for categorization. <br /> Possible values: <br /> `debug` <br /> `info` <br /> `warning` <br /> `err` <br /> `crit` |
| **shopId**               | String   | The technical name of the shop.                                                                                                               |
| **stageId (optional)**   | String   | Stage where the log was generated.                                                                                                            |
| **subshopId (optional)** | String   | Subshop in which the log was generated.                                                                                                       |

**Note:** Additional fields may be present depending on the origin and context of the log. The actual structure of individual log entries can vary.

#### Example

The following log entry comes from the system and shows typical fields as returned by Elasticsearch. Optional fields such as `agent`, `host` or `tags` may vary depending on the origin of the log.

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "@timestamp": "2025-05-07T06:51:15.148Z",
    "@version": "1",
    "_id": "KJGDqZYBCZfVknTATek6",
    "agent": {
        "ephemeral_id": "166b1b26-3479-44a0-abd5-01eb97dfde6a",
        "hostname": "849eec2f201d",
        "id": "1bac5950-93cd-45c0-83ef-96f0f835523b",
        "name": "849eec2f201d",
        "type": "filebeat",
        "version": "7.17.3"
    },
    "app": "restapi",
    "ecs": {
        "version": "1.12.0"
    },
    "host": {
        "name": "849eec2f201d"
    },
    "hostname": "db762f83481f",
    "input": {
        "type": "log"
    },
    "log": {
        "file": {
            "path": "/opt/ws/v9-logs/restapi/2025_05_07.log"
        },
        "offset": 4746
    },
    "logger": "restapi.controller.statistics",
    "msg": "Failed to get yesterday's active visitors: {\"error\":{\"root_cause\":[{\"type\":\"index_not_found_exception\",\"reason\":\"no such index [visitors]\",\"resource.type\":\"index_or_alias\",\"resource.id\":\"visitors\",\"index_uuid\":\"_na_\",\"index\":\"visitors\"}],\"type\":\"index_not_found_exception\",\"reason\":\"no such index [visitors]\",\"resource.type\":\"index_or_alias\",\"resource.id\":\"visitors\",\"index_uuid\":\"_na_\",\"index\":\"visitors\"},\"status\":404}",
    "severity": "err",
    "shopId": "myshop",
    "tags": [
        "v9",
        "beats_input_raw_event"
    ]
}
```

### Programs that produce logs

The `app` field in a log entry indicates which program or service generated the log. The following overview lists the possible programs that can appear as the `app` value in practice — including a brief description of their task within the shop system.

| **Values A - Z (app)**      | **Description**                                                                                                                                                          |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `admin`                     | Backend interface for shop administration.                                                                                                                               |
| `appAutomation`             | Automation processes in the shop system.                                                                                                                                 |
| `asse`                      | Automatic service for executing and delivering server-side HTTP notifications (Asynchronous Server Side Events).                                                         |
| `backInStock`               | Management of notifications for items that are available again.                                                                                                          |
| `cache`                     | Cache updates.                                                                                                                                                           |
| `captureExecutor`           | Automatically processes payment capture files for orders, performs payment requests to the payment provider if necessary, and manages retries as well as error handling. |
| `categoryProductsRebuilder` | Process that automatically assigns products to categories with rule-based product assignment.                                                                            |
| `configUpdater`             | Internal service that reacts to the update of configuration data.                                                                                                        |
| `feedBuilder`               | Creation of data feeds for exports and of sitemaps.                                                                                                                      |
| `garbageCollector`          | Automatic cleanup of data that is no longer needed.                                                                                                                      |
| `heartbeatChecker`          | Monitoring of background programs.                                                                                                                                       |
| `html2mime`                 | Conversion of HTML into emails.                                                                                                                                          |
| `imageChecker`              | Checks whether there are unused product images and whether referenced images exist.                                                                                      |
| `imageconverter`            | Converts images into other formats.                                                                                                                                      |
| `importer`                  | Import of data such as products, customer data etc.                                                                                                                      |
| `mailbackup`                | Backup of sent emails.                                                                                                                                                   |
| `mailer`                    | Sending emails from the system.                                                                                                                                          |
| `newsletterSubscribeHelper` | Process that sends double opt-in emails with an invitation to newsletter sign-up.                                                                                        |
| `notificator`               | Notification service for the app.                                                                                                                                        |
| `productRatingBackend`      | Sending of rating requests.                                                                                                                                              |
| `restapi`                   | Logs from the REST API.                                                                                                                                                  |
| `searchindexer`             | Indexing of products for shop search.                                                                                                                                    |
| `shop`                      | General shop process (e.g. cart, checkout, navigation).                                                                                                                  |
| `spChecker`                 | Monitoring of System Points usage.                                                                                                                                       |
| `statisticAggregator`       | Aggregation and preparation of statistical data.                                                                                                                         |
| `templateCompiler`          | Compiles templates, can be started via the REST API.                                                                                                                     |

## Methods for logs

The following endpoints let you retrieve log entries from the system. The logs contain detailed information about events in the shop, such as error messages, debug output or security-relevant hints.

Entries can be filtered and sorted as well as loaded individually by their ID.

For access to this data, the corresponding read permissions are required.

### GET logmanager/logs

This endpoint can be used to query a list of log entries.

The results can be filtered and sorted by timestamp, severity (`severity`), shop, subshop, logger, session ID or other fields. By default, sorting is done by the `@timestamp` field. For the query, a time range can be specified with `filter_gte[createdAt]` and `filter_lte[createdAt]`. Access is limited to a maximum of 300 entries per request; pagination is done via `nextPageToken`.

The maximum number of results is 10,000 — even with pagination. Data beyond that cannot be retrieved.

Logs of various applications (e.g. `shop`, `restapi`) and sources (e.g. `filebeat`) are available. They contain structured metadata and error messages that serve to analyze processes or errors in the shop. To determine the actual log files or paths, the `log.file.path` field can be used.

#### Example

Access up to 100 logs of any kind in the period 2025.03.24–2025.04.24

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://www.<your-shop>.de/admin/api/v1/logmanager/logs?size=100&sort=@timestamp:asc&filter_eq[severity]=debug&filter_eq[severity]=info&filter_eq[severity]=warning&filter_eq[severity]=err&filter_eq[severity]=crit&filter_gte[createdAt]=2025-03-24T00:00:00.371Z&filter_lte[createdAt]=2025-04-23T23:59:59.371Z&filter_eq[subshopId]=deutsch
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "endReached": false,
    "items": [
        {
            "@timestamp": "2025-04-04T13:41:51.097Z",
            "@version": "1",
            "_id": "9e2uHpYBZKNjyb2oXatY",
            "agent": {
                "ephemeral_id": "70e334c2-f5ac-4599-aa32-dd5dc7d7551d",
                "hostname": "9f46d9c66ba8",
                "id": "1bac5950-93cd-45c0-83ef-96f0f835523b",
                "name": "9f46d9c66ba8",
                "type": "filebeat",
                "version": "7.17.3"
            },
            "app": "shop",
            "ecs": {
                "version": "1.12.0"
            },
            "host": {
                "name": "9f46d9c66ba8"
            },
            "hostname": "f87daf6dd2fe",
            "input": {
                "type": "log"
            },
            "log": {
                "file": {
                    "path": "/opt/ws/v9-logs/shop/2025_04_04.log"
                },
                "offset": 5825
            },
            "logger": "form",
            "msg": "Missing recaptcha parameters:\nverifyUrl='https://www.google.com/re...",
            "sessionId": "973dda5db818b2a57942baed66f27f0939f78ee162b6bb65490e8fea3772791e",
            "severity": "crit",
            "shopId": "myshop",
            "stageId": "3",
            "subshopId": "deutsch",
            "tags": [
                "v9",
                "beats_input_raw_event"
            ]
        },
        {
            "@timestamp": "2025-04-09T13:17:57.461Z",
            "@version": "1",
            "_id": "iu7LHpYBZKNjyb2o-KEm",
            "agent": {
                "ephemeral_id": "70e334c2-f5ac-4599-aa32-dd5dc7d7551d",
                "hostname": "9f46d9c66ba8",
                "id": "1bac5950-93cd-45c0-83ef-96f0f835523b",
                "name": "9f46d9c66ba8",
                "type": "filebeat",
                "version": "7.17.3"
            },
            "app": "shop",
            "ecs": {
                "version": "1.12.0"
            },
            "host": {
                "name": "9f46d9c66ba8"
            },
            "hostname": "f87daf6dd2fe",
            "input": {
                "type": "log"
            },
            "log": {
                "file": {
                    "path": "/opt/ws/v9-logs/shop/2025_04_09.log"
                },
                "offset": 85186
            },
            "logger": "product",
            "msg": "Meta title field of the product is not a string",
            "sessionId": "269300aab23352c10324f82817bcb12aaf433e325425753b3c89018cee7fc0fd",
            "severity": "err",
            "shopId": "myshop",
            "stageId": "3",
            "subshopId": "deutsch",
            "tags": [
                "v9",
                "beats_input_raw_event"
            ]
        },
        {
            "@timestamp": "2025-04-03T07:41:46.882Z",
            "@version": "1",
            "_id": "Hd7LYZYBUuEsdVP_P_eb",
            "agent": {
                "ephemeral_id": "71484722-483c-4c99-9436-b470708d50c7",
                "hostname": "0d81d1bd24c9",
                "id": "1bac5950-93cd-45c0-83ef-96f0f835523b",
                "name": "0d81d1bd24c9",
                "type": "filebeat",
                "version": "7.17.3"
            },
            "app": "restapi",
            "ecs": {
                "version": "1.12.0"
            },
            "host": {
                "name": "0d81d1bd24c9"
            },
            "hostname": "2d3c543a9bfd",
            "input": {
                "type": "log"
            },
            "log": {
                "file": {
                    "path": "/opt/ws/v9-logs/restapi/2025_04_03.log"
                },
                "offset": 93145
            },
            "logger": "data.products.repository",
            "msg": "Generating XML for combination",
            "severity": "info",
            "shopId": "myshop",
            "stageId": "3",
            "subshopId": "deutsch",
            "tags": [
                "v9",
                "beats_input_raw_event"
            ]
        }
    ],
    "nextPageToken": "MTAw",
    "totalCount": 10000
}
```

#### Filter fields

`logger` (if not specified — all), `createdAt` (instead of `@timestamp`), other fields of a log such as `subshopId`, `severity`, `app`

#### Sort fields

It is possible to sort logs by different fields (e.g. by `sessionId.keyword`), but by default only sorting by `@timestamp` is used.

#### Error codes

| **Error**               | **Type**            | **Reason**                                                |
| ----------------------- | ------------------- | --------------------------------------------------------- |
| 401 Unauthorized        |                     | Not authorized: you are not logged in.                    |
| 403 Forbidden           |                     | You do not have the required permissions to read logs.    |
| 400 Bad Request         | "invalidValue"      |                                                           |
| 400 Bad Request         | "invalidCharacters" | `size` is not an integer.<br />A filter value is invalid. |
| 400 Bad Request         | "unknownDataField"  | A filter or sort field is invalid.                        |
| 400 Bad Request         | "unknownOperation"  | A filter type is invalid.                                 |
| 400 Bad Request         | "syntaxError"       | `sort` contains more than one or no ":".                  |
| 503 Service Unavailable | "internalError"     | Logs could not be loaded.                                 |

### GET logmanager/logs/\{id}

This method loads a single log event by its ID.

All associated fields are returned, such as timestamp, source, severity, message and context information.

To use this method, the corresponding read permissions for logs must be available.

#### Example

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

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "@timestamp": "2025-04-01T15:38:07.934Z",
    "@version": "1",
    "agent": {
        "ephemeral_id": "70e334c2-f5ac-4599-aa32-dd5dc7d7551d",
        "hostname": "9f46d9c66ba8",
        "id": "1bac5950-93cd-45c0-83ef-96f0f835523b",
        "name": "9f46d9c66ba8",
        "type": "filebeat",
        "version": "7.17.3"
    },
    "app": "shop",
    "ecs": {
        "version": "1.12.0"
    },
    "host": {
        "name": "9f46d9c66ba8"
    },
    "hostname": "f87daf6dd2fe",
    "input": {
        "type": "log"
    },
    "log": {
        "file": {
            "path": "/opt/ws/v9-logs/shop/2025_04_01.log"
        },
        "offset": 0
    },
    "logger": "router",
    "msg": "Path '/favicon.ico' not known",
    "sessionId": "8fd2e99fb7fe7da9c35f0685b8381f0ab6ac05ff159a0767e2f3b2e899d7aadf",
    "severity": "info",
    "shopId": "myshop",
    "stageId": "3",
    "subshopId": "deutsch",
    "tags": [
        "v9",
        "beats_input_raw_event"
    ]
}
```

#### Error codes

| **Error**               | **Type**        | **Reason**                                             |
| ----------------------- | --------------- | ------------------------------------------------------ |
| 401 Unauthorized        |                 | Not authorized: you are not logged in.                 |
| 403 Forbidden           |                 | You do not have the required permissions to read logs. |
| 404 Not Found           |                 | The log was not found.                                 |
| 503 Service Unavailable | "internalError" | The log could not be loaded.                           |

## Methods for log groups

Through the following endpoints, log groups can be created, retrieved, updated and deleted in the shop system. Log groups define which types of logs are to be observed — e.g. by severity, subshop or source — and form the basis for targeted evaluations and notifications.

In addition, notification settings of a group can be configured to receive regular information about new log entries.

To use the interfaces, the corresponding permissions to manage logs are required.

### GET logmanager/groups

This endpoint can be used to query log groups. A log group bundles certain log entries based on a configurable filter, e.g. by severity or time range. The result list can be limited via filter and sort parameters.

For access to this data, the corresponding read permissions are required.

#### Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://www.<your-shop>.de/admin/api/v1/logmanager/groups?size=100
&filter_gte[createdAt]=2025-03-25T00:00:00.913Z
&filter_lte[createdAt]=2025-04-25T23:59:59.913Z
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "endReached": true,
    "items": [
        {
            "createdAt": "2025-04-23T16:03:37.000Z",
            "description": "myDescription",
            "filter": {
                "or": []
            },
            "id": 4,
            "name": "myGroup",
            "notificationEnabled": false,
            "notificationId": 3
        }
    ],
    "nextPageToken": "MA",
    "totalCount": 1
}
```

#### Filter fields

`id`, `name`, `description`, `notificationId`, `filter`, `createdAt`

#### Sort fields

`id`, `name`, `description`, `createdAt`

#### Error codes

| **Error**        | **Type**            | **Reason**                                                |
| ---------------- | ------------------- | --------------------------------------------------------- |
| 401 Unauthorized |                     | Not authorized: you are not logged in.                    |
| 403 Forbidden    |                     | You do not have the required permissions to read logs.    |
| 400 Bad Request  | "invalidValue"      |                                                           |
| 400 Bad Request  | "invalidCharacters" | `size` is not an integer.<br />A filter value is invalid. |
| 400 Bad Request  | "unknownDataField"  | A filter or sort field is invalid.                        |
| 400 Bad Request  | "unknownOperation"  | A filter type is invalid.                                 |
| 400 Bad Request  | "syntaxError"       | `sort` contains more than one or no ":".                  |

### GET logmanager/groups/\{id}

This endpoint can be used to retrieve a single log group by its ID.

The log group contains metadata such as name, description, time of creation, filter, and an optional reference to a notification configuration.

For access, the corresponding read permissions are required.

#### Example

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

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "createdAt": "2025-04-23T16:03:37.000Z",
    "description": "myDescription",
    "filter": {
        "or": []
    },
    "id": 4,
    "name": "myGroup",
    "notificationId": 3
}
```

#### Error codes

| **Error**        | **Type**       | **Reason**                                             |
| ---------------- | -------------- | ------------------------------------------------------ |
| 401 Unauthorized |                | Not authorized: you are not logged in.                 |
| 403 Forbidden    |                | You do not have the required permissions to read logs. |
| 400 Bad Request  | "invalidValue" | `id` is missing or invalid.                            |
| 404 Not Found    |                | The log group was not found.                           |

### GET logmanager/groups/\{id}/logs

This endpoint can be used to retrieve a list of logs that belong to a specific log group. The ID of the log group must be provided in the URL.

The query supports filtering, sorting and pagination via the `size`, `sort` and `pageToken` parameters.

For access, the corresponding read permissions must be available.

#### Example

```text theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
https://www.<your-shop>.de/admin/api/v1/logmanager/groups/3/logs?size=100
&filter_gte[createdAt]=2025-03-24T00:00:00.186Z
&filter_lte[createdAt]=2025-04-25T23:59:59.186Z
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "endReached": false,
    "items": [
        {
            "@timestamp": "2025-04-11T09:35:24.646Z",
            "@version": "1",
            "_id": "6ckRXZYBlnEc1Y7xhdd4",
            "agent": {
                "ephemeral_id": "823e4491-dab9-468c-98d4-d5303323ee16",
                "hostname": "0d81d1bd24c9",
                "id": "1bac5950-93cd-45c0-83ef-96f0f835523b",
                "name": "0d81d1bd24c9",
                "type": "filebeat",
                "version": "7.17.3"
            },
            "app": "shop",
            "ecs": {
                "version": "1.12.0"
            },
            "host": {
                "name": "0d81d1bd24c9"
            },
            "hostname": "391a58954768",
            "input": {
                "type": "log"
            },
            "log": {
                "file": {
                    "path": "/opt/ws/v9-logs/shop/2025_04_11.log"
                },
                "offset": 94691
            },
            "logger": "shop.parseView",
            "msg": "RenderView Time 72703 us",
            "sessionId": "b831971cb73728321b979bdd49906512fdc48efd4be5022011abecd4bec9da89",
            "severity": "debug",
            "shopId": "myshop",
            "tags": [
                "v9",
                "beats_input_raw_event"
            ]
        },
        ...
    ],
    "nextPageToken": "MTAw",
    "totalCount": 10000
}
```

#### Error codes

| **Error**               | **Type**            | **Reason**                                                |
| ----------------------- | ------------------- | --------------------------------------------------------- |
| 401 Unauthorized        |                     | Not authorized: you are not logged in.                    |
| 403 Forbidden           |                     | You do not have the required permissions to read logs.    |
| 400 Bad Request         | "invalidValue"      |                                                           |
| 400 Bad Request         | "invalidCharacters" | `size` is not an integer.<br />A filter value is invalid. |
| 400 Bad Request         | "unknownDataField"  | A filter or sort field is invalid.                        |
| 400 Bad Request         | "unknownOperation"  | A filter type is invalid.                                 |
| 400 Bad Request         | "syntaxError"       | `sort` contains more than one or no ":".                  |
| 404 Not Found           |                     | The log group was not found.                              |
| 503 Service Unavailable | "internalError"     | Logs could not be loaded.                                 |

### GET logmanager/groups/\{id}/notifications

This endpoint can be used to retrieve the notification settings of a specific log group. This includes the recipients, the notification period and the time of the last sending, among other things. The ID of the log group must be provided in the URL.

For access, the corresponding read permissions are required.

#### Example

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

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "createdAt": "2025-04-23T15:08:56.000Z",
    "creator": 1,
    "enabled": true,
    "filter": {
        "or": []
    },
    "id": 2,
    "lastSentTimestamp": "2025-04-23T15:08:17.000Z",
    "logGroupId": 3,
    "notificationPeriod": 1440,
    "recipients": {
        "accounts": [
            {
                "enabled": true,
                "id": 1
            }
        ],
        "emails": []
    },
    "startDate": "2025-04-23T15:08:17.000Z",
    "subject": "asdf"
}
```

#### Error codes

| **Error**        | **Type**       | **Reason**                                             |
| ---------------- | -------------- | ------------------------------------------------------ |
| 401 Unauthorized |                | Not authorized: you are not logged in.                 |
| 403 Forbidden    |                | You do not have the required permissions to read logs. |
| 400 Bad Request  | "invalidValue" | `id` is missing or invalid.                            |
| 404 Not Found    |                | The log group was not found.                           |

### POST logmanager/groups

This endpoint can be used to create a new log group.

Mandatory fields are `name` and `filter`; the `description` field is optional. The filter defines which logs should be assigned to the group. Filters consist of nested logical conditions (e.g. `or`, `and`, `eq`).

To use the endpoint, the required permissions to create log groups must be available.

#### Example

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

#### Request body

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "name": "asdf",
    "description": "fdsa",
    "filter": {
        "or": [
            {
                "and": [
                    {
                        "or": [
                            {
                                "eq": {
                                    "app": "restapi.cgi"
                                }
                            }
                        ]
                    },
                    {
                        "or": [
                            {
                                "eq": {
                                    "logger": "restapi.controllers.products"
                                }
                            }
                        ]
                    },
                    {
                        "or": [
                            {
                                "eq": {
                                    "severity": "error"
                                }
                            },
                            {
                                "eq": {
                                    "severity": "crit"
                                }
                            }
                        ]
                    },
                    {
                        "or": [
                            {
                                "eq": {
                                    "subshopId": "deutsch"
                                }
                            },
                            {
                                "eq": {
                                    "subshopId": "english"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    }
}
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "createdAt": "2025-04-23T16:03:37.000Z",
    "description": "fdsa",
    "filter": {
        "or": [
            {
                "and": [
                    {
                        "or": [
                            {
                                "eq": {
                                    "app": "restapi.cgi"
                                }
                            }
                        ]
                    },
                    {
                        "or": [
                            {
                                "eq": {
                                    "logger": "restapi.controllers.products"
                                }
                            }
                        ]
                    },
                    {
                        "or": [
                            {
                                "eq": {
                                    "severity": "error"
                                }
                            },
                            {
                                "eq": {
                                    "severity": "crit"
                                }
                            }
                        ]
                    },
                    {
                        "or": [
                            {
                                "eq": {
                                    "subshopId": "deutsch"
                                }
                            },
                            {
                                "eq": {
                                    "subshopId": "english"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "id": 1,
    "name": "asdf",
    "notificationId": 0
}
```

**Note:** A newly created log group always has `notificationId: 0` because no notification configuration has been assigned yet. It can then be set up via `PUT logmanager/groups/{id}/notifications`.

#### Error codes

| **Error**               | **Type**           | **Reason**                                                               |
| ----------------------- | ------------------ | ------------------------------------------------------------------------ |
| 401 Unauthorized        |                    | Not authorized: you are not logged in.                                   |
| 403 Forbidden           |                    | You do not have the required permissions to create logs.                 |
| 400 Bad Request         |                    | Request body could not be loaded.                                        |
| 400 Bad Request         | "unknownDataField" | An unknown field was provided in the request body.                       |
| 400 Bad Request         | "invalidFormat"    | `name` or `description` is not a string.<br />`filter` is not an object. |
| 400 Bad Request         | "invalidValue"     | `name` is an empty string.                                               |
| 400 Bad Request         | "missing"          | `name` or `filter` was not provided.                                     |
| 503 Service Unavailable | "internalError"    | The newly created log group could not be loaded.                         |

### PUT logmanager/groups/\{id}

This endpoint can be used to update an existing log group by its ID. Changes can affect, for example, the name, description or filter object of the group. If a filter is provided, it must be a tree-like object.

To use the endpoint, the required permissions to edit log groups must be available.

#### Example

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

#### Request body

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "name": "myGroup",
    "description": "newDescription",
    "filter": {
        "or": []
    }
}
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "createdAt": "2025-04-23T16:03:37.000Z",
    "description": "newDescription",
    "filter": {
        "or": []
    },
    "id": 4,
    "name": "myGroup",
    "notificationId": 3
}
```

#### 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 logs.                  |
| 400 Bad Request  |                    | Request body could not be loaded.                                        |
| 400 Bad Request  | "unknownDataField" | An unknown field was provided in the request body.                       |
| 400 Bad Request  | "invalidValue"     | `id` is missing or invalid.                                              |
| 400 Bad Request  | "invalidFormat"    | `name` or `description` is not a string.<br />`filter` is not an object. |
| 404 Not Found    |                    | The log group was not found.                                             |

### PUT logmanager/groups/\{id}/notifications

This endpoint can be used to change the notification settings of an existing log group by its ID. You can define or adapt, for example, recipients, start time, notification interval and subject.

To use it, the corresponding write permissions for log groups are required.

#### Example

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

#### Request body

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "enabled": true,
    "subject": "asdf",
    "recipients": {
        "accounts": [
            {
                "id": 1,
                "enabled": true
            }
        ]
    },
    "startDate": "2025-04-23T15:08:17.550Z",
    "notificationPeriod": 1440
}
```

#### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "createdAt": "2025-04-23T15:08:56.000Z",
    "creator": 1,
    "enabled": true,
    "filter": {
        "or": []
    },
    "id": 2,
    "lastSentTimestamp": "2025-04-23T15:08:17.000Z",
    "logGroupId": 3,
    "notificationPeriod": 1440,
    "recipients": {
        "accounts": [
            {
                "enabled": true,
                "id": 1
            }
        ],
        "emails": []
    },
    "startDate": "2025-04-23T15:08:17.000Z",
    "subject": "asdf"
}
```

#### 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 logs.                                                                                                                                                                                                                                         |
| 400 Bad Request  |                    | Request body could not be loaded.                                                                                                                                                                                                                                                               |
| 400 Bad Request  | "unknownDataField" | An unknown field was provided in the request body.                                                                                                                                                                                                                                              |
| 400 Bad Request  | "invalidValue"     |                                                                                                                                                                                                                                                                                                 |
| 400 Bad Request  | "invalidFormat"    | `enabled` is not a boolean.<br />`subject` is not a string.<br />`recipients` is not an object.<br />`notificationPeriod` is not a positive number.<br />`startDate` is not a string.<br />`customSendTime` is not a boolean.<br />`sendDate` is not a string.<br />`sendTime` is not a string. |
| 400 Bad Request  | "missing"          | `sendDate` or `sendTime` was not provided although `customSendTime` is set to `true`.                                                                                                                                                                                                           |
| 404 Not Found    |                    | The log group was not found.                                                                                                                                                                                                                                                                    |

### PUT logmanager/groups/\{id}/notifications/enabled

This endpoint can be used to enable or disable the notifications of an existing log group by its ID. If no notification settings yet exist for the log group, default settings are created upon activation.

To use it, the corresponding write permissions for log groups are required.

#### Example

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

#### Request body

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

#### Response

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

#### 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 logs.                  |
| 400 Bad Request  |                | Request body could not be loaded.                                        |
| 400 Bad Request  | "invalidValue" | Invalid route parameter `id` or invalid `enabled` field in request body. |
| 404 Not Found    |                | The log group was not found.                                             |

### DELETE logmanager/groups/\{id}

This endpoint can be used to delete an existing log group by its ID. The associated notification settings are also removed.

To execute, the corresponding delete permissions for logs are required.

#### Example

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

#### Response

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

#### 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 logs. |
| 400 Bad Request  | "invalidValue" | `id` is missing or invalid.                              |
| 404 Not Found    |                | The log group was not found.                             |

## 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.
