# DeleteOldChangeData

## General

### Description

The method can be called on an ad-hoc basis to delete processed Change Data Partitions created on the target database by a Replicate task.

Information note

* Partitions will only be deleted if the Change Data Partitioning and Partition Retention options are enabled in the Replicate console.

  For more information, refer to the Qlik Replicate Setup and User Guide.

* Partitions will only be deleted if the task is running. If the task is not running, the partitions will be deleted the next time the task runs.

* Only partitions that are not locked by a consuming application will be deleted.

### URL

https://{host:port}/attunityenterprisemanager/api/v1/servers/{server}/tasks/ {task}?action=delete\_old\_change\_data

### HTTP method

POST

### Required user role

See [Required Enterprise Manager permissions](https://help.qlik.com/en-US/enterprise-manager/November2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/Introduction/AEMPermissions.htm).

## Request parameters

Request parameters

| Location | Name | Required | Description/Example |
| --- | --- | --- | --- |
| URL | host [string] | Yes | The host name of the Enterprise Manager machine.<br><br>Example:<br><br>computer.network.net |
| URL | server [string] | Yes | The Replicate server name, as defined in Enterprise Manager.<br><br>Example:<br><br>myrepsrv1 |
| URL | task [string] | Yes | The Replicate task name.<br><br>Example:<br><br>TargetAWSEMR |

## Request body

The point in time after which partitions can be deleted, which can either be specified as a timestamp or as an offset. If a [retention barrier](https://help.qlik.com/en-US/enterprise-manager/November2025/Content/EnterpriseManager/EnterpriseManager_APIGuide/CurlAPI/api_SetChangeDataRetentionBarrier.htm) is set, partitions will be deleted up to the retention barrier date, regardless of the specified timestamp/offset.

### Timestamp format

[Date]

(yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z')

Example:

2020-06-30T16:15:00Z

### Offset format

[Period]

Format ISO 8601 duration

Example:

P1M3DT1H2M

## cURL example

POST attunityenterprisemanager/api/v1/servers/myemserver/tasks/Oracle2NULL?action=delete\_old\_change\_data

Parameters:

"timestamp\_or\_offset":"2020-07-30T16:15:00Z"

## Error response

Error responses Error responses

| HTTP Code | Enterprise Manager Code | Text | Description |
| --- | --- | --- | --- |
| 500 | AEM\_TASK\_NOT\_FOUND | Replication task {task] on server {server} could not be found. | Returned when an unknown task name is encountered. |
| 500 | AEM\_INVALID\_TIMESTAMP\_OR\_OFFSET\_FORMAT | The specified deletion age does not conform to the expected timestamp or offset format. Timestamp format should be yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'. Offset format should conform to ISO 8601 duration. | Returned when the specified deletion age does not conform to the expected timestamp or offset format. |
| 500 | AEM\_DELETE\_OLD\_CHANGE\_DATA\_INNER\_ERR | Failed to request deletion of old change data for task {task} on server {server}.<br><br>Message: {error\_message} | Returned when an error is encountered during partition deletion. |