Skip to main content

Editing documents

You can edit document with the editDocument API. This allows you to change the name of a document, change the document's permissions, etc.

client.editDocument(docId, data): Promise<Document>

docId is the ID of the document to edit. The current document's ID can be retrieved with client.getDocumentId()

data is the data you wish to edit on the document. You can provide any of the following properties (all optional).

{
name: string, // name of the document
isPublic: boolean // whether or not the document is publicly viewable
}

The function will resolve with the updated document object if the operation is successful.

The function will reject if the user does not have permission to update the document, or some other error occurs.