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

# UNLOAD

> Reference for the `UNLOAD` DLC operation, covering the `DlcUnloadRequest` fields (topics, scope, branch, garbage collection) and the `DlcUnloadResponse` and `UnloadReport` returned.

## Overview

When unloading, elements are deleted from the datastore. The deleted elements are not recorded.

A Garbage collection can be performed after an `UNLOAD` operation. This can be done by specifying
the [Garbage collection scope properties](https://docs.activeviam.com/solutions/libraries/data-load-controller/functional/scope-parameters.md#garbage-collection) in the request.

## Request

> [tab] Java
>
> ### `DlcUnloadRequest`
>
> | Key | Required | Type | Description |
> | - | :-: | :- | - |
> | topics | Y | `Set<String>` | Set of topics or aliases. |
> | scope | | `IDlcScope` | [Scope Parameters](https://docs.activeviam.com/solutions/libraries/data-load-controller/functional/scope-parameters.md) |
> | branch | | `String` | The branch to unload data from. |
> | performGcOnStart | | `Boolean` | Perform a [Garbage collection](https://docs.activeviam.com/solutions/libraries/data-load-controller/functional/garbage-collection.md) before the datastore transaction. |
> | performGcOnCompletion | | `Boolean` | Perform a [Garbage collection](https://docs.activeviam.com/solutions/libraries/data-load-controller/functional/garbage-collection.md) after the datastore transaction. |
>
> #### Example:
>
> ```Java theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
> DlcUnloadRequest.builder()
>     .topics("Topic1", "Topic2") // Required
>     .scope(DlcScope.of(
> 			"AsOfDate", "2025-02-14",
>             "performGcOnCompletion", true
>     ))
>     .branch("BranchToLoadInto")
>     .build();
> ```

> [tab] JSON
>
> ### `DlcUnloadRequestDTO`
>
> | Key | Type | Description |
> | - | :- | - |
> | unloadedRecords | `Map<String, Long>` | Number of records removed from each store. |
> | status | `DlcStatus` | Overall status of the DLC Operation. |
>
> #### Example:
>
> ```json theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
> {
>   "operation": "UNLOAD",
>   "topics": ["Topic1", "Topic2"],
>   "scope": {
>     "AsOfDate": "2025-02-14"
>   },
>   "performGcOnCompletion": true,
>   "branch": "BranchToUnloadFrom"
> }
> ```

## Response

> [tab] Java
>
> ### `DlcUnloadResponse`
>
> | Key | Type | Description |
> | - | :- | - |
> | report | `UnloadReport` | Report of what occurred during the unload operation. |
> | status | `DlcStatus` | Overall status of the DLC Operation. |
>
> ### `UnloadReport`
>
> | Key | Type | Description |
> | - | :- | - |
> | unloadedRecords | `Map<String, Long>` | Number of records removed from each store. |
>
> ### `DlcStatus`
>
> A simple enum to capture if the DLC request was executed.
>
> | Key | Description |
> | - | - |
> | OK | Request was handled successfully. |
> | ERROR | Request was not able to be performed correctly. |

> [tab] JSON
>
> ### `DlcUnloadResponseDTO`
>
> | Key | Type | Description |
> | - | :- | - |
> | unloadedRecordsPerStore | `Map<String, Long>` | Number of records removed from each store. |
> | status | `DlcStatus` | Overall status of the DLC Operation. |
>
> #### Example:
>
> ```json theme={"languages":{"custom":["/engine/python-sdk/6.2/languages/pycon.tmLanguage.json"]}}
> {
>   "unloadedRecordsPerStore": {
>     "StoreA": 12,
>     "StoreB": 200
>   },
>   "status": "OK"
> }
> ```
