Skip To Content
ArcGIS Developer
Dashboard

/copy: Copy Item

  • URL:https://[root]/content/users/[userName]/items/[itemID]/copy(POST only)
  • Version Introduced:ArcGIS Online September 2020 | ArcGIS Enterprise 10.9

Example usage

The following is a sample ArcGIS Online request for the copy operation:

https://www.arcgis.com/sharing/rest/content/users/jsmith/items/b512083cd1b64e2da1d3f66dbb135956/copy
title=MyNewItem Title
tags=MyTag1,MyTag2
folder=ea433f31f1bd4d6787cf6a82b0a8a7a5
includeResources=true
copyPrivateResources=true

The following is a sample ArcGIS Enterprise request for the copy operation:

POST /webadaptor/sharing/rest/content/users/jsmith/items//b512083cd1b64e2da1d3f66dbb135956/copy HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

title=MyNewItem Title&folder=ea433f31f1bd4d6787cf6a82b0a8a7a5&tags=MyTag1,MyTag2&includeResources=false&copyPrivateResources=false&=pjson

Description

The copy item operation (POST only) creates a new item that is a copy of the original item on the server side.

Copy operation is allowed for the following:

  • Original item being copied is owned by the user invoking the copy operation.
  • User is an administrator.
  • User has itemControl update capability.

The new item created by the copy operation will have system generated itemID.

Hosted services are copied as reference only. Reserved keywords, ratings, views, comments and listing properties are reset for the new item.

Sharing access of the original item is not preserved. Sharing access of new item is set to private.

Relationships and dependencies of the original item are not maintained in the new item.

Request parameters

ParameterDetails
title

The title of the destination item. If not specified, title of the original item is used.

tags

New set of tags (comma separated) of the destination item.

folder

Folder Id of the destination item. If the folder Id is not specified, then the item remains in the same folder.

If the administrator invokes a copy of an item belonging to another user, and does not specify the folder Id, the item gets created in the root folder of the administrator.

includeResources

If true, the file resources of the original item will be copied over to the new item. Private file resources will not be copied over. If false, the file resources of the original item will not be copied over to the new item. The default is false.

Values: true | false

copyPrivateResources

If true, and if includeResources is set to true as well, then the private resources of the original item will be copied over to the new item. If false, the private file resources of the original item will not be copied over to the new item. The default is false.

Values: true | false

f

The response format. The default format is html.

Values: html | json | pjson

Response properties

PropertyDetails
success

Indicates if the operation was successful.

itemId

The Id of the created item.

JSON Response syntax

{
  "success": true | false,
  "itemId": "<item id>"
}

JSON Response example

{
  "success": true,
  "id": "ea433f31f1bd4d6787cf6a82b0a8a7a5"
}

or

{"error": {
"code": 400,
"message": "Unable to copy item.",
"details": ["Folder 'fc2fa1433c314d489a6909a9990531d5' does not exist."]
}}