/api/kiwi prefix and the authentication rules in the API overview, except /raw/* and /llms.txt, which have their own rules described below.
Symlink targets (GET /api/kiwi/readlink) and page templates (GET /api/kiwi/templates, GET /api/kiwi/template) are documented with the Files API.
Content helpers
Lint markdown
Check a page, or markdown you haven’t saved yet, for structural problems the editor can’t fix automatically.string
File to lint. Ignored when
content is set.string
Markdown to lint inline.
400 when neither path nor content is set and 404 when path does not exist.
object[]
Problems found. Always an array, empty when the page is clean.
Peek at a page
Return a page’s title, frontmatter, opening paragraph, links, and headings without the full body. Use it to decide whether a page is worth reading.string
required
File path.
404 if the file does not exist.
string
File path.
string
First heading, or the file name.
object
Parsed frontmatter.
string
First paragraph, up to 300 characters.
string[]
Wiki link targets in the page, as written.
string[]
Pages that link to this one.
integer
Words in the body.
string[]
Heading text, in order.
Read one section
Return a single heading section of a page.string
required
File path.
string
Heading text, matched case-insensitively. Use
Parent > Child to pick a nested heading.integer
0-based section index. Used when
heading is not set.400 when neither heading nor index is set or index isn’t a number, and 404 when the file or section does not exist.
string
File path.
string
Matched heading text.
integer
Heading level (1–6).
string
Section markdown, from the heading to the next heading of the same or higher level.
integer
First line of the section in the body.
integer
Last line of the section in the body.
Clip a web page
Fetch a URL, convert the article to markdown, and save it as a page.string
default:"clipper"
Git commit author attribution.
string
required
Page to clip.
string
Title override. Defaults to the article title.
string[]
Tags to add to the frontmatter.
string
default:"clips/"
Folder for the new page. The file name is the slugified title.
400 if url is missing and 500 if the fetch, conversion, or write fails.
string
Path of the new page.
string
Page title.
string
Short excerpt of the article.
Ingest a document
Convert a document on the server’s filesystem (PDF, Office, HTML, images, audio, and more) to markdown and write it into the knowledge base. Requires themarkitdown CLI on the server’s PATH.
string
required
Path to the source file on the server. Supported extensions:
pdf, docx, pptx, xlsx, html, htm, csv, json, xml, epub, jpg, jpeg, png, gif, bmp, tiff, mp3, wav, m4a, zip.string
default:"single"
single writes one page. sections writes one page per heading.string
default:"imports/<file-name>/"
Folder for the output pages.
boolean
default:"false"
Add TF-IDF keywords to each page.
integer
default:"10"
Keywords per section when
extract_keywords is on.boolean
default:"false"
Turn references between sections into wiki links.
string
default:"kiwi-ingest"
Git commit author attribution.
400 for a missing file or unsupported extension and 500 if conversion or writing fails (including when markitdown is not installed).
string
Source path.
string
Source extension.
integer
Sections found in the converted document.
string[]
Pages written.
string[]
Extracted keywords, if enabled.
Agent context
Workspace context
Return the files agents read at the start of a session.string
Contents of
.kiwi/playbook.md.string
Contents of
SCHEMA.md at the knowledge root.string
Contents of
index.md at the knowledge root.string
Contents of
.kiwi/rules.md.Rules file
Read or replace.kiwi/rules.md, the team’s instructions for agents. GET can also wrap the rules in a ready-made file for a specific agent harness.
string
GET only. One of cursor, claude, agents, openclaw, or skill. Omit it to get the raw file.string
PUT only. Git commit author attribution.GET returns plain text, or an empty body when the file doesn’t exist. PUT takes raw markdown up to 256 KB, returns 413 above that, and commits the file.
PUT response
Feeds and activity
Activity timeline
List recent file changes from git history, newest first.integer
default:"50"
Events to return. Maximum 500.
integer
default:"0"
Events to skip.
string
Only events whose git author name equals this value.
string
write or delete. Omit for both.string
Only paths starting with this prefix.
400 for any other type value.
object[]
integer
offset plus the events returned, plus one when the page is full. A value greater than offset + limit means more events may exist.Atom and JSON feeds
Subscribe to the 50 most recent changes in a feed reader.string
published limits write events to pages with published: true.feed.xml returns Atom (application/atom+xml). feed.json returns JSON Feed (application/feed+json). Item titles read Updated: <path> or Deleted: <path>, and links use the server’s public URL.
Recently edited pages
Return the markdown pages edited most recently, from git history or file modification times.integer
default:"10"
Pages to return. Maximum 50.
object[]
Real-time events
Subscribe to events
Open a Server-Sent Events stream that receives an event for every change. See Real-time events for client patterns.event: line with the event type and a data: line with a JSON object. The server sends a :keep-alive comment every 15 seconds. It returns 503 when 256 clients are already connected. Events are not replayed, so reconnect and re-read state after a disconnect.
string
Event type. Same as the
event: line.string
File path, for single-file events.
string[]
File paths, for
bulk and rollback.string
Who made the change.
string
New git blob hash, on most
write events.object
Event-specific details, such as the janitor scan summary.
Comments
Comments are inline annotations anchored to a quoted span of a page. They are stored in.kiwi/comments/<path>.json, and every change is committed to git and broadcast as an SSE event.
List comments
Return every comment on a page, resolved or not.string
required
Page path.
string
Page path.
object[]
Add a comment
Attach a comment to a span of text in a page.string
required
Page path.
string
Author, used when
author is not set.object
required
string
required
Comment text.
string
Author. Falls back to
X-Actor, then the server’s default actor.400 when body or anchor.quote is missing. The response is the new comment.
Resolve a comment
Mark a comment resolved, or reopen it.string
required
Comment ID.
string
required
Page path.
boolean
required
true to resolve, false to reopen.404 if the comment does not exist. The response is the updated comment.
Delete a comment
Remove a comment.string
required
Comment ID.
string
required
Page path.
404 if the comment does not exist.
Rendering
Render a D2 diagram
Render D2 source to SVG on the server. The web UI uses this for```d2 fences. Use GET for short sources and POST when the source is too long for a URL.
string
GET only. D2 source.string
default:"light"
GET only. light or dark.string
required
POST only. D2 source, up to 64 KB.string
default:"light"
POST only. light or dark.image/svg+xml body with an ETag. Send that ETag back in If-None-Match to get 304. Layout uses dagre by default; set layout-engine: elk in the source’s d2-config to use ELK. Imports are disabled. Error codes:
400: empty source or source over 64 KB422: the diagram has a syntax or layout error (the message says where)501: the server was built without D2 support503: rendering took longer than 10 seconds
Widget fence reference
Return the schema, description, and example for every widget fence (```array, ```tree, ```table, and so on). The linter, the editor’s slash menu, and the kiwi_widget_reference MCP tool all use the same catalog. See Widgets.
string
Return only this fence. Accepts the fence tag or an alias.
404 for an unknown fence name.
integer
Catalog version. Currently
1.string[]
Keys every fence accepts at the top level, such as
steps, caption, and autoplay.string[]
Keys every step accepts, such as
note, line, and breakpoint.object[]
Raw files and llms.txt
Raw files
Serve a file’s bytes directly, for<img>, <video>, and <iframe> tags and downloads. Use GET /file instead when you need an ETag.
string
required
File path relative to the knowledge root.
string
Expiry from a signed URL.
string
Signature from a signed URL.
/api/kiwi/raw/ alias lets the web UI reach assets in a non-primary space. When auth is on and the space is private, a request must have one of:
- an
Authorizationheader - a valid
expandsigpair (otherwise403) - a target that is already public: a branding logo or favicon, a page with
published: trueorvisibility: public, or an asset next to such a page
public or unlisted visibility serve raw files without credentials. Returns 404 if the file does not exist. SVGs are served with a restrictive Content-Security-Policy.
Sign a raw URL
Get a short-lived/raw/ URL that works without an Authorization header, for embedding private assets in HTML.
string
required
File path.
400 if path is missing or escapes the knowledge root. URLs stay valid for 30 to 60 minutes and stop working when the server restarts.
string
Normalized file path.
string
Signed relative URL.
string
Expiry time (RFC 3339, UTC).
llms.txt
Describe the knowledge base in the llms.txt format, for agents that don’t use MCP. These routes sit at the server root, not under/api/kiwi.
/llms.txt returns a plain-text index: a title, a summary, and every page grouped by top-level folder, with its description frontmatter. /llms-full.txt returns the full markdown of every page, concatenated, with frontmatter stripped. It stops at 5 MiB and ends with a note saying how many pages were left out.
These routes don’t take credentials. When auth is on and the space isn’t
public, they list only pages with published: true or visibility: public, the same pages /p/* would serve.Web UI settings
UI configuration
Return the[ui] settings the web UI needs at startup.
boolean
true when theme edits are disabled.string
Page the web UI opens first.
object
pinned and hidden path lists, and sections (each with label and paths).object
name, logoUrl, faviconUrl, welcomeTitle, and welcomeMessage.object
On or off for
graph, kanban, canvas, whiteboard, timeline, bases, data_sources, edit, history, and publish.string[] | null
Views shown in the page toolbar.
null means the default set.object
banner and hide tag lists, and colors (tag to color).boolean
Whether widget fences render as widgets.
string[] | null
Fence tags allowed to render.
null means all of them.Theme
Read or replace.kiwi/theme.json, the workspace theme the web UI applies.
string
PUT only. Git commit author attribution.GET returns the stored JSON object, or {} when there is none. PUT takes any JSON object up to 64 KB, commits it, and returns it. PUT returns 400 for invalid JSON, 403 when ui.theme_locked is on, and 413 above 64 KB.
Custom CSS
Return the workspace stylesheet set by[ui] custom_css (default .kiwi/custom.css), with any <script> tags removed.
text/css, or an empty body when the file doesn’t exist.
Keybindings
Return the web UI’s keyboard shortcuts after merging the defaults,.kiwi/keybindings.json, and [ui.keybindings] in the config.
object
Action name to key chord, after merging.
object
Built-in action name to key chord.
object[]
Chords bound to more than one action, each with
chord and actions.Editor slash commands
Return the custom slash commands defined in[[ui.editor.slash_commands]]. Entries without an id or template, or with an id that isn’t letters, digits, _, or -, are skipped.
object[]
User preferences
Read or update the calling user’s web UI preferences, stored in.kiwi/users/<user-id>/preferences.json. The user comes from X-Actor, which the auth layer sets from your credentials.
string
Color theme.
boolean
Whether the sidebar starts collapsed.
string
editor or source.string
sm, base, or lg.boolean
Show line numbers in the source editor.
boolean
Enable Vim keybindings in the source editor.
PUT merges the fields you send into the stored preferences, commits the file, and returns the merged result. Both methods return 401 for anonymous callers and the built-in web UI actor. PUT returns 400 for an invalid default_view or font_size and 413 above 8 KB.
Personal state and notes
Store small JSON blobs per user, such as UI state, and read a user’s private companion note for a page. Files live in.kiwi/users/<user-id>/state/ for authenticated users and in .me/ otherwise. These files are written directly and are not committed to git.
string
me/state only, required. State name. Must not contain /, \, or ..string
me/note only, required. Page path. The note is the file with the same base name in the user’s state folder.GET /me/state returns the stored JSON, or {} when nothing is stored. PUT /me/state takes any valid JSON up to 512 KB and returns 204. It returns 400 for a bad name or invalid JSON and 413 above 512 KB. GET /me/note returns text/markdown, or 404 when there is no note.
Admin
Backup status
Report the state of the background git push configured in[backup]. See Backup and sync.
/sync/status is an alias.
boolean
false when no backup remote is configured.object
Present when enabled.
Audit log
Read the request audit log. Requires[audit] enabled = true; entries are written to .kiwi/audit/YYYY-MM-DD.jsonl. See Audit log.
string
default:"24 hours ago"
RFC 3339 timestamp. Only entries at or after this time.
integer
default:"100"
Maximum entries, up to 10000. Values outside 1–10000 fall back to 100.
400 for a malformed since and 501 when audit logging is off.
object[]
MCP equivalents
Related
Files API
Read, write, and rename pages.
Real-time events
Build clients on the SSE stream.
Widgets
Widget fences and how they render.
Audit log
Turn on and read request auditing.