Docly Developers
Function API only Updated 23 Oct 2026

removeFileShare(file, user)

Removes / terminates a user's access to a specific file.

Parameters

filestringrequired

Absolute path to file to remove a user from.

userstring (email)required

Email to user to remove access.

Returns

true when the share is removed. Throws "No such share!" (error 2) if the user has no share there (also when the email is not a Docly user or the share was already removed; the public everyone share is never touched), and error 101 for an invalid email. Returns null if the file is not found. The call runs as the site's publisher.

Example

Normal JavaScript, running in the browser or on the Docly™ server.
docly.removeFileShare("test file", "test@docly.net");