Skip To Content
ArcGIS Developer

Cleanup Assets (Feature Service/Layer)

  • URL:https://<featurelayer-url>/cleanupAssets
  • Required Capability:Admin privileges
  • Version Introduced:11.1


The cleanupAssets operation cleans unused assets and reclaims space. As assets are never deleted, they may become unnecessary when the asset map is updated. When an asset map updates, it deletes the last reference from the asset map to a specific asset.


A user-configurable, periodic task similar to the Directory Cleaner administrator plug-in will perform frequent asset cleanup. As such, the cleanupAssets operation should not need to be invoked on a regular basis.

Unused assets can be purposefully created using the uploadAssets operation. These assets would be added to the asset map at a later time with an applyEdits request. To avoid deleting these assets, the cleanupAssets operation can be used to set a retention period. The retention period limits asset deletion to assets that are older than the specified period, preserving assets that do not exceed the retention period.

Request parameters


A numerical value representing the retention period. Only unused assets older than this value are deleted.


Specifies the units of the retention period.

Values: days | hours | minutes | seconds


The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a sample request URL used to access the cleanupAssets endpoint:

JSON Response syntax

  "success": "<true | false>",
  "error": {"code": <error code>, "description": "<error description>"}   

JSON Response example

  "success": "true"