# SetChangeDataRetentionBarrier

## General

### Description

The method can be used to:

* Set a retention barrier for deleting consumed partitions. Setting a retention barrier will initiate periodic deletion of consumed Change Data Partitions from the target database defined for the specified task. Partitions will be deleted according to the Allow consuming applications to delete partitions every interval set on Replicate Server, and up to the specified "retention\_point".
* Remove the retention barrier, thereby stopping periodic deletion of consumed Change Data Partitions.

Information note

* Partitions will only be deleted if the Change Data Partitioning and Partition Retention options are enabled in the Replicate console.
* Partitions will only be deleted if the task is running. If the task is not running, the partitions will be deleted the next time it 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=set\_change\_data\_retention\_barrier

### HTTP method

PUT

### Required user role

See [Required Enterprise Manager permissions](https://help.qlik.com/en-US/enterprise-manager/May2026/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

### Body for setting a retention barrier

retention\_point=timestamp

application=application\_name

Where:

* timestamp is the date up to which partitions can be deleted. The timestamp must be in the following format: (yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z').
* application\_name is the name of the consuming application.

Example:

retention\_point=2020-06-30T16:15:00Z

application=Compose

### Body for removing the retention barrier

retention\_point=

application=application\_name

Where application\_name is the name of the consuming application.

## cURL example

PUT attunityenterprisemanager/api/v1/servers/roni-2012/tasks/Oracle2NULL?action=set\_change\_data\_retention\_barrier

Parameters:

"retention\_point":"2020-06-30T16:15:00Z",

"application": "xxx"

## Error response

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\_FORMAT | The specified partition retention barrier does not conform to the expected timestamp format. Timestamp format should be yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'. | Returned when the specified partition retention barrier does not conform to the expected timestamp format. |
| 500 | AEM\_SET\_CHANGE\_DATA\_RETENTION\_BARRIER\_INNER\_ERR | Failed to set change data retention barrier for task {task} on server {server}.<br><br>Message: {error\_message} | Returned when an error is encountered during partition deletion. |