Docly Developers
Function API only Updated 22 Oct 2026

getPublications(, [options])

Lists where the site's own workspace is published — published folders (sites) and published documents — with the same data as the CLI command "docly published". Only available in API mode (.js endpoints).

Parameters

optionsobjectoptional
Specify any of the following options parameters:
pathstring

Path relative to the site root, like the other docly.* functions. A folder gives the publications of that folder and everything below it; a file gives that document's own publications.
Omitted: the whole workspace the site runs in — also when the site itself is published from a subfolder.
The template's files are never looked up. A path that does not exist throws an error (it does not return an empty list).

templateGuidstring

Only publications made with this template folder. Short guid (22 characters), the same with the F prefix, or a regular guid. An invalid value throws an error instead of being ignored.

typestring

Only publications whose template name matches — the "Type" column in "docly published". Not case-sensitive. For a published document it is the display name of the template the document was published with ("" when there is none) — not the schema name.
If both templateGuid and type are given, both must match.

Returns

An array with one object per publication:

  • url: the full address. Folder addresses end with /
  • guid: the publication's id
  • type: the template name (for documents: the display name of the document template, "" when there is none)
  • templateGuid: the template folder's short guid, null for documents
  • public: true if no login is required
  • authMode: null for public, 2 = OAuth redirect, 3 = OAuth popup
  • folderPath: the folder's path relative to the workspace root ("/" for the root)
  • folderGuid: the folder's short guid
  • name: the name of the published folder or document
  • isDocument: true for a published document

An empty array means nothing matched. The answer contains no secrets: no OAuth client, no JWT key and no e-mail address of the publisher.
The list is cached per workspace and can be up to 60 seconds old.

Example

Normal JavaScript, running in the browser or on the Docly™ server.
// The public app's address in this workspace — e.g. for an embed snippet.
let pubs = docly.getPublications({ templateGuid: "F4xS2k9aQ0uYb1cDeFgHiJw" });
if (pubs.length == 0) return { error: "The public app is not published in this workspace." };
return pubs[0].url;   // "https://dops.no/chat/"

// The same, by template name (case-insensitive):
docly.getPublications({ type: "Docly support (public app)" });

// Only what is published from /chat and below:
docly.getPublications("/chat");

// One item looks like this:
// {
//   url: "https://dops.no/chat/",
//   guid: "q3Vb8wYtP0K2m1cR4sT6uA",
//   type: "Docly support (public app)",
//   templateGuid: "4xS2k9aQ0uYb1cDeFgHiJw",
//   public: true,
//   authMode: null,
//   folderPath: "/chat",
//   folderGuid: "Zr7x1BqWm0aE3d5Fh8JkLw",
//   name: "chat",
//   isDocument: false
// }