/canDelete: Can Delete Item

URL:
https://[root]/content/users/[userName]/items/[itemID]/canDelete
Methods:
POST
Version Introduced:
ArcGIS Enterprise 10.6.1

Example Usage

URL for Can Delete Item

Use dark colors for code blocksCopy
1
https://org.arcgis.com/sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/canDelete

Description

The canDelete operation indicates whether an item can be deleted or not. When the returned response from Can Delete Item is true, the item can be deleted. When the returned response is false, the item cannot be deleted due to a variety of reasons. For example, delete protection has been set on the item or it has dependent capabilities.

Request Parameters

ParameterDetails

[Common Parameters]

For a complete listing, see Common parameters.

Response Properties

PropertyDetails

itemID

The ID of the queried item.

success

Indicates if the operation was successful.

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
{
  "itemId": "<item id>",
  "success": true | false
}

JSON Response example

Item can be deleted:

Use dark colors for code blocksCopy
1
2
3
4
{
  "itemId": "e03f626be86946f997c29d6dfc7a9666",
  "success": true
}

Item cannot be deleted as delete protection has been enabled:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
  "itemId": "a34c2e6711494e62b3b8d7452d4d6235",
  "success": false,
  "error": {
    "code": 400,
    "messageCode": "CONT_0048",
    "message": "Unable to delete item. Delete protection is turned on.",
    "offendingItems": [

    ]
  }
}

Item cannot be deleted as it has dependent capabilities:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "itemId": "e03f626be86946f997c29d6dfc7a9666",
  "success": false,
  "error": {
    "code": 400,
    "messageCode": "CONT_00481",
    "message": "Unable to delete item. This service item has a related Service item",
    "offendingItems": [
      {
        "itemId": "9fcec52e8c924bd49d56a8f07e4214d5",
        "title": "map_wfs",
        "type": "WFS"
      }
    ]
  }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.