Skip to main content
KiwiFS has three ways to let people read pages without an API key: Space visibility is separate: it opens read endpoints for the whole space. See Publishing for when to use each.

Publish a page

Set published: true in the page’s frontmatter, and published_at if the page has never been published.
string
Git commit author attribution.
string
required
Page path.
Returns 404 if the page does not exist and 409 if it changed during the request.
string
Page path.
boolean
Always true.
string
First publish time (RFC 3339). Republishing keeps the original value.
string
Relative URL of the published page.

Unpublish a page

Set published: false. The published_at field stays for history.
string
Git commit author attribution.
string
required
Page path.
Returns 404 if the page does not exist and 409 if it changed during the request.

Bulk publish or unpublish

Publish or unpublish many pages in a single git commit. Both endpoints take the same body and return the same shape.
string
Git commit author attribution.
string[]
required
Page paths. Duplicates are ignored, and a leading / is stripped.
Returns 400 if paths is empty or contains an empty string. Pages that are missing or fail to update are reported in errors rather than failing the whole request.
boolean
true for publish, false for unpublish.
integer
Number of paths in the request.
integer
Pages whose frontmatter changed.
integer
Unique paths that needed no change or failed.
object[]
One entry per page that is now in the requested state, with path, published, published_at, and public_url as in Publish a page.
object[]
Pages that could not be updated, each with path and error. Omitted when empty.

Get publish status

Return whether one page is published.
string
required
Page path.
Returns 404 if the page does not exist.
string
Page path.
boolean
Whether the page is published.
string
First publish time, if the page was ever published.
string
Relative public URL. Only present while published.
integer
Views of the published page since the server started counting. 0 when view tracking is off.

List published pages

Return every published markdown page, newest first.
integer
Number of published pages.
object[]
Published pages, sorted by published_at descending.

Read a published page

Render a published or visibility: public page. This route sits outside /api/kiwi and never requires authentication.
string
required
Page path. .md is appended if the path has no extension.
string
default:"text/html"
text/html for a themed reader page, text/markdown for the raw file, or application/json for frontmatter plus rendered HTML.
Returns 404 for pages that aren’t published or public, so private pages don’t leak their existence, and 406 for an Accept header with no supported type. Images and other non-markdown files are served when a markdown page in the same folder or a parent folder is published or public. Responses carry Cache-Control: public, max-age=60. With Accept: application/json:
object
Page frontmatter.
string
Rendered body HTML, with heading IDs.
string
Page body without frontmatter.

Read public files

Fetch one public or published file without authentication. Use this when you want raw bytes instead of the rendered reader page.
string
required
File path.
Returns the raw file with a content type based on its extension. Returns 400 for a missing or escaping path and 404 for files that aren’t public. Non-markdown files follow the same folder rule as /p/.

Browse the public tree

Return the directory tree, filtered to public and published pages.
string
default:"/"
Folder to start from.
string
Set to published to include only published pages and skip visibility: public pages.
Folders with no visible pages are omitted. Returns 404 if path does not exist.
Create a token that grants read access to one file, with an optional expiry and password. The page does not need to be published.
string
Recorded as createdBy.
string
required
File path. Returns 404 if it does not exist.
string
Go duration such as 168h. Omit for a link that never expires.
string
Password readers must supply. Stored as a bcrypt hash and never returned.
Returns 400 for an invalid expiresIn and 501 if share links are disabled on this server.
string
Link ID, used to revoke it.
string
Shared file path.
string
Secret token for the public URL.
string
Expiry time (RFC 3339). A zero time (0001-01-01T00:00:00Z) means no expiry.
string
Actor that created the link.
string
Creation time.
integer
Times the link has been opened.
Return the share links for one file.
string
required
File path.
Returns a JSON array of share links with the fields shown in Create a share link. Returns 501 if share links are disabled. Delete a share link by its id (not its token).
string
required
Link ID.
Returns 404 if the link does not exist.
Return the raw shared file. This route needs no API key.
string
required
Share token.
string
Password for a protected link.
string
Alternative to the password query parameter.
Returns 401 with a WWW-Authenticate header when the password is missing or wrong, and 404 when the token is unknown or expired.

Get space visibility

Return the current space’s visibility and root directory.
string
private, unlisted, or public. Defaults to private.
string
Absolute path of the knowledge root on the server.

Set space visibility

Change who can read the space without an API key. The value is saved to [space] visibility in .kiwi/config.toml and applies immediately.
string
required
  • private: every request needs auth (when auth is configured).
  • unlisted: GET requests to /file, /peek, and /section with a path are open; listing, tree, and search still need auth.
  • public: every GET and HEAD request under /api/kiwi is open.
Returns 400 for any other value.
Space visibility only relaxes reads. Writes always need auth when auth is configured.

Publishing concepts

When to publish, share, or open a space.

Web UI

The publish toggle in the page header.
Last modified on October 19, 2026