Docly Developers
Function API only Updated 15 Oct 2026

createFolder(folderPath, [folderType])

Creates a folder from the specified path, including any missing parent folders. Folders that already exist are left as they are.

See also Path traversal

Parameters

folderPathstringrequired

Folder path to create, from the site root. Separate levels with /.

folderTypestringoptional

Path to a folder schema (for example "#/Schemas/Project"). Every folder this call creates gets this schema. Throws if the schema is not found (error 77) or is not a folder schema (error 78).

Returns

An object with Id, Guid and Name for the LAST folder this call created. Returns null when every folder in the path already existed — use getFolder to look the folder up in that case.

Example

Normal JavaScript, running in the browser or on the Docly™ server.
// Ensures the folder path exists, creating any missing levels
let created = docly.createFolder("folder 1/part 2/folder");

// created is null when the folder already existed
let folder = created || docly.getFolder("folder 1/part 2/folder");
write(folder.Guid);