---
title: Remove Old Message Types and Endpoints in Nodinite 7 – Find Unused Items and Permanently Delete
description: "Remove unused Message Types and Endpoints from Nodinite 7 the supported way: find them by Last Event, delete, then Permanently Delete with an impact preview and a Log Audit entry. Read-only SQL finds candidates; direct DELETE scripts are not supported."
---

# Manually Removing Old Configuration Data

Keep your <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> environment lean by removing [Message Types][] and [Endpoints][] that no longer receive [Log Events][Log Event]. In <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> 7 you do this in the [Web Client][]: find the unused items, delete them, then permanently delete them. Every permanent delete shows what goes with the item first and leaves a [Log Audit][Log Audit Search] entry.

* ✅ Find unused Message Types and Endpoints by their **Last Event**, without SQL  
* ✅ Remove many at once with **With Selected**, after an impact preview  
* ✅ Every removal is restorable until you permanently delete it, and audited when you do  
* ✅ Read-only SQL queries find candidates when the lists are very long  

<aside aria-label="Important" class="nodinite-note nodinite-note--important">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-message-exclamation"></i> Important</p>
<div class="nodinite-note__content"><p>Don't run DELETE statements against the <a href="https://docs.nodinite.com/core-services/configuration-database/overview/">Configuration Database</a>. A direct DELETE skips the soft delete, the impact preview and the Log Audit entry. In 7.x it also fails halfway (C4 Flows hold a foreign key to Message Types), removes Endpoints the product would keep, and leaves <a href="https://docs.nodinite.com/administration/customize/tags/features/what-is-a-tag/">Tag</a>, <a href="https://docs.nodinite.com/repository-model/knowledge-base-articles/overview/">Article</a> and C4 node links pointing at ids that get reused. <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> never removes configuration data on its own: removing it is always an Administrator's decision in the Web Client.</p></div>
</aside>

## <i class="fal fa-diagram-project" aria-hidden="true"></i> Understanding the Cleanup

<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> tracks every combination of Message Type and Endpoint it has logged in the `LogPoints` table of the [Configuration Database][], with `FirstSeen` and `LastSeen`. The [Logging Service][] keeps them current. An item whose newest `LastSeen` is older than the retention of its events has no Log Events left in the [Log Databases][]: it is no longer in use.

<div class="mermaid">
flowchart LR
    F["fa:fa-magnifying-glass Find<br/>sort by Last Event"] --> D["fa:fa-trash-can Delete<br/>restorable"]
    D --> P["fa:fa-trash-xmark Permanently Delete<br/>impact preview"]
    P --> A["fa:fa-clipboard-list Log Audit<br/>one entry"]
    style F fill:#2678BD,color:#fff
    style D fill:#FFD525,color:#000
    style P fill:#c33d34,color:#fff
    style A fill:#3F827B,color:#fff
</div>

*Blue: you find the candidates in the Message Types or Endpoints list. Yellow: Delete is a soft delete you can undo with Restore. Red: Permanently Delete removes the item and everything that refers to it. Teal: [Log Audit Search][] records who removed what. See [Two delete models][Delete models].*

| Item | Its retention | Who may remove it |
|---|---|---|
| [Message Type][Message Types] | Its own **Days to keep events** (also messages and context) | Administrators ([Permanently Delete][Message Types - Permanently Delete]) |
| [Endpoint][Endpoints] | None of its own: its Log Events follow their Message Types' retention | Administrators ([Permanently Delete][Endpoints - Permanently Delete]) |
| [Log Agent][Log Agents - Permanently Delete] | Not applicable | Administrators, one at a time; removes every Endpoint of the agent |

## <i class="fal fa-magnifying-glass" aria-hidden="true"></i> Step 1: Find Unused Message Types and Endpoints

1. In **Administration** > **Repository**, open **Message Types** (or **Endpoints**).
2. Sort the list by **Last Event**, oldest first. **Last Event** is the last time an event with this Message Type (or on this Endpoint) was seen. **N/A** means the item was never logged.
3. The items at the top are your candidates. Compare a Message Type's **Last Event** with its **Days to keep events**. For Endpoints, choose your own threshold, such as the longest retention of the Message Types logged on them.

The [Web API][] returns the same value as `EventLastSeen` for Administrators.

### Find candidates with SQL (read-only)

With thousands of items, a query can list the candidates for you. These queries only read; run them in SQL Server Management Studio against the [Configuration Database][], then remove the items in the Web Client (Step 2).

```sql
-- Message Types whose every Log Point is older than the Message Type's retention.
-- Id 0 is the default Unknown Message Type and is never removed.
;WITH Old AS (
    SELECT LP.MessageTypeId, MAX(LP.LastSeen) AS LastSeen
    FROM LogPoints LP
    JOIN MessageTypes MT ON LP.MessageTypeId = MT.MessageTypeId AND MT.MessageTypeId > 0
    GROUP BY LP.MessageTypeId, MT.DaysToKeepEvents
    HAVING MAX(LP.LastSeen) < DATEADD(DD, MT.DaysToKeepEvents * -1, GETDATE())
)
SELECT MT.MessageTypeId, MT.Name, Old.LastSeen
FROM Old
JOIN MessageTypes MT ON MT.MessageTypeId = Old.MessageTypeId
ORDER BY Old.LastSeen
```

*Each Message Type listed has no Log Point newer than its own retention.*  

```sql
-- Endpoints with no Log Point newer than your threshold (92 days here; Endpoints have no retention of their own).
-- Id 0 is the default Endpoint and is never removed.
DECLARE @days INT = 92;
SELECT EP.EndPointId, EP.Name, MAX(LP.LastSeen) AS LastSeen
FROM [EndPoints] EP
LEFT JOIN LogPoints LP ON LP.EndPointId = EP.EndPointId
WHERE EP.EndPointId > 0
GROUP BY EP.EndPointId, EP.Name
HAVING MAX(LP.LastSeen) IS NULL OR MAX(LP.LastSeen) < DATEADD(DD, @days * -1, GETDATE())
ORDER BY LastSeen
```

*A `NULL` LastSeen means the Endpoint was never logged.*  

## <i class="fal fa-trash-can" aria-hidden="true"></i> Step 2: Delete, Then Permanently Delete

1. In the list, tick the candidates, and choose **With Selected** > **Delete**. They are soft deleted and can still be restored.
2. Tick **Include deleted**, tick the same items again, and choose **With Selected** > **Permanently Delete**.
3. Read the impact dialog. It counts what goes with the items (Log Points and their metrics, [Custom Metadata][] values, Tag and Article links, Log and [Monitor View][Monitor Views] filters, [Transport Contract][Transport Contracts] links) and lists the Log and Monitor Views that change.
4. Tick that you understand it can't be undone, and confirm.

A Message Type that a C4 Flow carries loses only that binding: the Flow stays. An Endpoint's default Message Type is cleared, not the Endpoint. A Transport Contract left without a Message Type or an Endpoint is removed with its [Contract][Contracts]. The full lists are in [What is removed, and what is kept][Message Types - What is removed] for Message Types and [the same section][Endpoints - What is removed] for Endpoints.

<aside aria-label="Note" class="nodinite-note nodinite-note--note">
<p class="nodinite-note__label" aria-hidden="true"><i class="far fa-fw fa-note"></i> Note</p>
<div class="nodinite-note__content"><p>An Endpoint that still receives Log Events is created again by the <a href="https://docs.nodinite.com/core-services/logging-service/overview/">Logging Service</a>. Remove the Endpoint once its sender is retired. To retire a whole <a href="https://docs.nodinite.com/administration/log-management/log-agents/overview/#permanently-delete-log-agent">Log Agent</a>, permanently delete the Log Agent: it removes every Endpoint it created.</p></div>
</aside>

## <i class="fal fa-clipboard-list" aria-hidden="true"></i> Step 3: Check the Log Audit

In **Administration** > **Tools** > [Log Audit Search][], pick the Function `cnfg_MessageTypes_HardDelete` or `cnfg_EndPoints_HardDelete`, and click **Search**. Each permanent delete is one entry that names what was removed and who removed it.

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

* <i class="fal fa-file" aria-hidden="true"></i> [Message Types - Permanently Delete][]  
* <i class="fal fa-sign-out" aria-hidden="true"></i> [Endpoints - Permanently Delete][]  
* <i class="fal fa-database" aria-hidden="true"></i> [Remove duplicate Endpoints][]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-trash-can" aria-hidden="true"></i> [Two delete models][Delete models]  
* <i class="fal fa-user-tag" aria-hidden="true"></i> [Log Audit Search][]  
* <i class="fal fa-database" aria-hidden="true"></i> [Configuration Database][]  
* <i class="fal fa-database" aria-hidden="true"></i> [Log Databases][]  
* <i class="fal fa-database" aria-hidden="true"></i> [SQL Server Troubleshooting][SQL Server Overview]  
* <i class="fal fa-trash" aria-hidden="true"></i> [Automating removal of old Log Databases][AutoRemove]  

[Articles]:https://docs.nodinite.com/repository-model/knowledge-base-articles/overview/
[AutoRemove]:https://docs.nodinite.com/install-and-update/troubleshooting/sql-server/automating-removal-of-old-log-databases/
[Configuration Database]:https://docs.nodinite.com/core-services/configuration-database/overview/
[Contracts]:https://docs.nodinite.com/getting-started/repository/contracts/overview/
[Custom Metadata]:https://docs.nodinite.com/repository-model/custom-metadata/overview/
[Delete models]:https://docs.nodinite.com/administration/repository/overview/#fa-trash-can-two-delete-models
[Endpoints]:https://docs.nodinite.com/repository-model/endpoints/overview/
[Endpoints - Permanently Delete]:https://docs.nodinite.com/administration/repository/endpoints/overview/#fa-trash-xmark-permanently-delete-endpoints
[Endpoints - What is removed]:https://docs.nodinite.com/administration/repository/endpoints/overview/#what-is-removed-and-what-is-kept
[Log Agents - Permanently Delete]:https://docs.nodinite.com/administration/log-management/log-agents/overview/#permanently-delete-log-agent
[Log Audit Search]:https://docs.nodinite.com/administration/tools/log-audit-search/
[Log Databases]:https://docs.nodinite.com/core-services/log-databases/overview/
[Log Event]:https://docs.nodinite.com/core-services/log-event/overview/
[Logging Service]:https://docs.nodinite.com/core-services/logging-service/overview/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Message Types - Permanently Delete]:https://docs.nodinite.com/administration/repository/message-types/overview/#fa-trash-xmark-permanently-delete-message-types
[Message Types - What is removed]:https://docs.nodinite.com/administration/repository/message-types/overview/#what-is-removed-and-what-is-kept
[Monitor Views]:https://docs.nodinite.com/administration/monitor-management/monitor-views/features/what-is-a-monitor-view/
[Remove duplicate Endpoints]:https://docs.nodinite.com/install-and-update/troubleshooting/sql-server/remove-duplicate-endpoints/
[SQL Server Overview]:https://docs.nodinite.com/install-and-update/troubleshooting/sql-server/overview/
[Tags]:https://docs.nodinite.com/administration/customize/tags/features/what-is-a-tag/
[Transport Contracts]:https://docs.nodinite.com/repository-model/services/overview/#fa-microchip-transport-contracts-the-heart-of-service-definitions
[Web API]:https://docs.nodinite.com/core-services/web-api/overview/
[Web Client]:https://docs.nodinite.com/getting-started/overview/