Copy Document

Purpose

To retrieve a copy of a specific document.

Quick Reference

PropertyValue
MethodPOST
Request URLhttps://{zohoapis_domain}/writer/api/v1/documents/{{document_id}}/copy
ScopesZohoWriter.documentEditor.ALL, ZohoPC.files.ALL, WorkDrive.files.ALL, WorkDrive.organization.ALL, WorkDrive.workspace.ALL
Rate LimitSee Writer API throttle limits

Parameters

Path Parameters

ParameterData TypeMandatory/OptionalDescription
document_idStringMandatorySpecify the unique id for the document.

Body Parameters

ParameterData TypeMandatory/OptionalDescription
document_nameStringOptionalSpecify a unique name for the copied document.
By default, the document name will be " Copy of the Original document name".
formatStringOptionalSpecify the output format in which the copied file needs to be stored.
Supported formats are: docx / zdoc / doc / odt / html / pdf and more...
Note:
- By default, the copied document will be stored in Writer native format (zdoc).
- Some keys may not be available in the response while saving the documents in any other format other than zdoc.
passwordStringOptionalSpecify a password if you would like to protect the copied document.
Note: This option is applicable only for docx and pdf files.
folder_idStringOptionalSpecify the folder_id in which you would like to store the copy of the document.
By default, the copied document will be stored under 'My Folders'.
options{
"include_changes":<String>,
"include_comments":<String>,
"include_template_settings":<Boolean> },
"include_comments":,
"include_template_settings": }
Optional

include_changes -> Specify how the track changed content needs to be reflected in copied file. The possible values are:
- as_markups: If the marked up content needs to included in copied document.
- all: To generate the copied file by accepting all the track changes done.
- none: To generate the copied document by rejecting the track changes done.


include_comments -> Specify if the comments needs to be included in the copied file or not. The possible values are:
- all: To generate the copied file with the comments.
- none: To generate the copied document without the comments.
Note: This parameter is applicable only for docx and pdf files.


include_template_settings -> Specify if the automation configuration needs to be included in the copied file or not. The possible values are True or False.
Note: This key is supported only for Sign and Fillable Templates.

options

ParameterTypePossible ValuesDefault Value
include_changesStringas_markups / all / nonenone
include_commentsStringall / nonenone
include_template_settingsBooleantrue/falsenone

Notes

  • The comments present in the document will be reflected in the copied document based on the comment visibility permission provided for that particular document.
  • You can check the possible errors list here.

Sample Request

Copiedcurl -X POST "https://www.zohoapis.com/writer/api/v1/documents/{document_id}/copy" \
  -H "Authorization: Zoho-oauthtoken <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "document_name": "Invoice_2026_001",
    "folder_id": "folder_id"
  }'
Copiedparam = Map();
param.put("document_name","new name");    //optional
param.put("folder_id","4vf3a9d1632be6ead486482a0743a338*****");    //optional
param.put("password","StrongPassword"); 	 //optional
param.put("format","zdoc"); 	 //optional

optionsmap = map();
optionsmap.put("include_changes", "all");   	//optional - possible values: all | as_markups | none
optionsmap.put("include_comments", "all");    //optional  - possible values: all | none
param.put("options", optionsmap);

response = invokeurl
[
	url :"https://zohoapis.com/writer/api/v1/documents/aoxw10d7094f66a484a9c9d627155beb*****/copy"
	type :POST
	parameters:param
	connection:"<connection_name>"
];
info response;

Sample Response

Copied{
  "role": "OWNER",
  "modified_time_ms": 1589187982831,
  "owner_id": "55576911",
  "open_url": "https://{domain}/writer/open/5rh8dc5b791e93ec74a8c855138bc2a7d1442",
  "is_favourite": false,
  "last_opened_time_ms": 1589187982441,
  "thumbnail_url": "https://{domain}/writer/thumbnail/5rh8dc5b791e93ec74a8c855138bc2a7d1442",
  "document_id": "5rh8dc5b791e93ec74a8c855138bc2a7d1442",
  "type": "document",
  "title": "Copy of New document",
  "lock_info": {
    "status": false
  },
  "document_name": "Copy of New document",
  "modified_time": "2020-05-11T09:06:22Z",
  "library_id": 20,
  "permissions": {
    "can_read_fill": true,
    "can_trash": true,
    "can_share": true,
    "can_edit": true,
    "can_lock": true,
    "can_copy": true,
    "can_org_publish": true,
    "can_read": true,
    "is_admin": true,
    "can_discard_lock": false,
    "can_remove_share": false,
    "can_publish": true,
    "can_delete": false,
    "can_restore": false,
    "can_rename": true,
    "can_favourite": true,
    "can_leave": false,
    "can_download": true,
    "can_unlock": false
  },
  "download_url": "https://{domain}/api/v1/download/5rh8dc5b791e93ec74a8c855138bc2a7d1442",
  "lastmodified_by": [
    {
      "email_id": "amelia@gmail.com",
      "profile_photo": "https://{domain}/file?t=user&ID=1308724&fs=thumb",
      "user_id": "1308724",
      "timezone": "Asia/Kolkata",
      "language": "en",
      "display_name": "Zylker"
    }
  ],
  "final_info": {
    "status": false
  },
  "parent_info": {
    "folder_name": "My Folders",
    "folder_link": "https://{domain}/home/teams/fnzpd538b91fe77cf476b924bf1578ffe4d3f/privatespace/folders/files"
  },
  "created_time": "2020-05-11T09:06:22Z",
  "parent_folder_id": "folder",
  "collaboration_id": "1203300249832967075",
  "last_opened_time": "2020-05-11T09:06:22Z",
  "version_id": "185909000000363002",
  "created_by": "amelia",
  "version": "1.0",
  "created_time_ms": 1589187982441,
  "product_type": 1,
  "preview_url": "https://{domain}/writer/zwpreview/5rh8dc5b791e93ec74a8c855138bc2a7d1442",
  "creator_id": "1308724",
  "permalink": "https://{domain}/file/5rh8dc5b791e93ec74a8c855138bc2a7d1442",
  "status": "active"
}