Skip To Content

/updateItems: Update Items With Content Categories

  • URL:https://[root]/content/updateItems(POST only)

Example Usage

URL for Update Items

https://www.arcgis.com/sharing/rest/content/updateItems

Description

The Update Items operation (POST only) allows item owner and organization administrators who has the portal:admin:updateItems privilege to add or remove organization content categories on items. A maximum of 100 items can be bulk updated per request.

Request Parameters

ParameterDetails
[Common Parameters]

For a complete listing, see Common parameters.

items

A JSON array of item objects. Each is specified with the item ID that consists of a categories object. categories is specified with an array that lists all content categories to update on the item, each with full hierarchical path prefixed with /.

In ArcGIS Online, content category limits are set based on the limits set by the organization. For ArcGIS Enterprise organizations, each item can be categorized to a maximum of 20 categories.

Example:

[{
	"2678d3002eea4e4a825e3bdf10016e61": {
		"categories": ["/Categories/Geology", "/Categories/Elevation"]
	}
}, {
	"c3ad4ed8bcf04d619537cfe252a1760d": {
		"categories": ["/Categories/Geology", "/Categories/Land cover/Forest/Deciduous Forest"]
	}
}, {
	"9ced00fdce3e4b20bb4b05155acbe817": {
		"categories": []
	}
}]

Response Properties

PropertyDetails
results

An array of JSON objects, one for each item requested. Each object is made up of the itemId and a success flag to indicate whether the item was successfully updated. If an error occurs during updating an item, an error object is also returned.

Example:

[
  {
    "itemId": "c3ad4ed8bcf04d619537cfe252a1760d",
    "success": false,
    "error": {
      "code": 400,
      "message": "Item does not exist or is inaccessible."
    }
  },
  {
    "itemId": "9ced00fdce3e4b20bb4b05155acbe817",
    "success": true
  },
  {
    "itemId": "2678d3002eea4e4a825e3bdf10016e61",
    "success": true
  }
]

JSON Response Syntax

{"results": [
  {
    "itemId": "<itemId1>",
    "success": true | false
  },
  {
    "itemId": "<itemId2>",
    "success": true | false,
    "error": {
      "code": <error code>,
      "message": "<error message>"
    }
  },
  {
    "itemId": "<itemId3>",
    "success": true | false
  }
]}

JSON Response Example

{"results": [
  {
    "itemId": "9ced00fdce3e4b20bb4b05155acbe817",
    "success": true
  },
  {
    "itemId": "c3ad4ed8bcf04d619537cfe252a1760d",
    "success": false,
    "error": {
      "code": 400,
      "message": "Item exceeds max size of 20 categories."
     }
  },
  {
    "itemId": "2678d3002eea4e4a825e3bdf10016e61",
    "success": true
  }
]}