Choose where you’d like to start

Lock or Unlock Documents in Zoho Writer


The zoho.writer.documents.lock task locks or unlocks the specified document. This task is based on the Zoho Writer Lock/Unlock Document API.

Note: Applicable to all services except Zoho Creator.


<response> = zoho.writer.documents.lock(<document_id>, <enableLock>, <connection>);


ParamsData typeDescription
<response>KEY-VALUEThe response returned by Zoho Writer. It represents the status of the lock along with the detail of the user who locked/unlocked it.

The ID of the document to be locked/unlocked.

The document ID can be obtained from the URL of the document which needs to be locked/unlocked.

The URL is in the following format:<document_id>


1. If you would like to lock the document, pass the value as true.

2. If you would like to unlock the document, pass the value as false.


The connection's link name.


  • To prevent new authtoken generation and ensure new integration tasks (created after the deadline specified in the post) work as expected, a Zoho OAuth connection with appropriate scopes is mandatory. Existing integration tasks will continue to work, with or without the connections parameter, until you manually delete the authtoken from Zoho Accounts.

  • Add relevant scopes from the Zoho Writer API when creating the connection.

  • Refer to this post for a list of Zoho services that support the Connections page.

  • Learn more about connections


The following script locks the given Writer document.

document_id = "h36bc2a6c50b2754a405880c1d1679a5f5be9";
enableLock = "true";  //true|false
response = zoho.writer.documents.lock(document_id, bool enableLock, "writer_oauth_connection");
info response;


The KEY-VALUE response returned by Zoho Writer. It represents whether the document locked or not.
The TEXT that represents the ID of the document in Zoho Writer.
The TEXT that represents whether the documents needs to be locked or unlocked.
The TEXT that represents the name of the connection.

Response Format

  "result": "success",
  "locked_by": {
    "email_id": "",
    "profile_photo": "",
    "user_id": "4579020",
    "display_name": "Zylker"
  "message": "Document lock operation has been completed successfully."

Related Links

Get Started Now