# Cleanup

## Overview

Logs out of the end system and cleans up any cached data for the given MBSE SDK session id. This API will be called by OpsHub, only at the end once all sync events are processed.

## API URI

This is the URI, OpsHub will execute to call this API:

```http
POST: /mbse/api/1.0/cleanup/{sdkSessionId}?systemId=<systemId>&cleanupGlobalCache=<cleanUpGlobalCache>
```

Request headers will contain all the key-value data returned from the Initialize API for the given session id.

## URI Parameters

| Name               | In    | Required | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------ | ----- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sdkSessionId       | Path  | True     | UUID    | Unique ID to distinguish each session. MBSE SDK can use this session id to cache any information for a specific session.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| systemId           | Query | False    | String  | Unique Id that identifies the integration system and can be used by the MBSE SDK to maintain a global cache or session-related data for that specific system.                                                                                                                                                                                                                                                                                                                                                                                |
| cleanupGlobalCache | Query | False    | Boolean | <p>Specifies whether to clean up the global cache associated with the given <strong>systemId</strong>.<br><br>If set to <strong>true</strong>:<br>– Indicates that the system configuration has changed or been refreshed.<br>– MBSE SDK should delete all cached or persistent data related to the specified <strong>systemId</strong>.<br>– Ensures that fresh data is loaded.<br><br>If set to <strong>false</strong> (or not provided):<br>– MBSE SDK may retain global cache and only clean up data related to the current session.</p> |

## Response

200 OK


---

# 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://opstech.gitbook.io/opstech-docs/mbse-connector-sdk-index/mbse-sdk-connector-apis/authentication-apis/session-logout.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.
