API reference
Spaces & Wikis
The workspace's Spaces (folders of files your agents and automations work with) and its wikis (pages your team and your agents read). List and read them, search across them, and create, change and delete files and pages with the same rules, revision history and review as in the app. 16 endpoints. Add your API key in the authentication panel to send test requests from this page.
List spaces
/api/external/v1/spacesEvery live Space of the workspace, by name. Each has id, slug, name, description, iconKey, sourceKind (NATIVE, PROJECT for a project's Space, AGENT_HOME / FLOW_HOME for an agent's or a flow's own Space, GIT for a repository Space), sourceId, defaultPolicy (aiChange: OPEN, PROPOSE or LOCKED - what an AI's change does there), createdAt, updatedAt, and isWiki (the hub of a wiki: its id is the wiki's id) or isRepository with repository where they apply.
The assistant's own notebooks are not listed here.
Responses
200OK
Read a space
/api/external/v1/spaces/{spaceId}One Space (the fields of GET /spaces), with isWiki true when it is a wiki's hub.
Errors: 404 SPACE_NOT_FOUND when it is not one of your Spaces.
Parameters
spaceIdstring (uuid)pathRequired
Responses
200OK
Read a file of a space
/api/external/v1/spaces/{spaceId}/fileThe file at path (relative to the Space), or an older revision of it. Answers path, ref, revision, etag (send it back as expectedEtag when you change the file), mediaType, content (text; null for a binary file, with binary true), totalLines, size.
Errors: 404 SPACE_NOT_FOUND, PATH_NOT_FOUND; 400 MISSING_FIELD without path, OPERATION_REFUSED (a folder, or a read the Space's rules refuse).
Parameters
spaceIdstring (uuid)pathRequiredpathstringqueryThe file, relative to the Space's root, e.g. `docs/pricing.md`.
revisioninteger (int32)queryAn older revision number; the newest when left out.
Responses
200OK
Create or replace a file in a space
/api/external/v1/spaces/{spaceId}/fileWrites the whole text content of the file at path, making it (and its folders) when it is not there. Each write is a new revision; nothing is lost.
Fields: path (required, relative to the Space), content (required; "" for an empty file), expectedEtag (the etag you read: the write is refused with 409 when the file changed since - send it whenever you change an existing file), mediaType (e.g. text/markdown), reason (kept in the revision history; when left out, the history says the change came through the API and names your credential).
The Space's rules apply as in the app: answers outcome written with the new revision and etag, or proposed when the change waits for review in the Review inbox, with path relative to the Space.
Errors: 404 SPACE_NOT_FOUND; 400 MISSING_FIELD, OPERATION_REFUSED (a folder there, a read-only place, a rule that refuses); 409 CONTENT_CHANGED (with currentEtag, currentRevision).
403 AI_ORIGIN_WRITE when the request comes from one of the workspace's own AIs (an agent or an MCP client): they change Spaces with their own Space tools, under each Space's rule for AI changes. A builder of yours (a coding agent working one of your tasks, with your workspace open to it) writes as an AI under the Space's rule for AI changes: written, proposed for review, or refused.
Parameters
spaceIdstring (uuid)pathRequired
Request body application/json
pathstringcontentstringexpectedEtagstringmediaTypestringreasonstring
Responses
200OK
Delete a file or folder of a space
/api/external/v1/spaces/{spaceId}/fileMoves what is at path (a file, or a folder with everything in it) to the Space's trash, where it is kept for 30 days and can be restored in the app. Answers 204; or 202 with outcome proposed when the Space's rules make the deletion wait for review.
Errors: 404 SPACE_NOT_FOUND, PATH_NOT_FOUND; 400 MISSING_FIELD without path, OPERATION_REFUSED (the Space's root, a linked resource, a rule that refuses).
403 AI_ORIGIN_WRITE when the request comes from one of the workspace's own AIs (an agent or an MCP client): they change Spaces with their own Space tools, under each Space's rule for AI changes. A builder of yours (a coding agent working one of your tasks, with your workspace open to it) writes as an AI under the Space's rule for AI changes: written, proposed for review, or refused.
Parameters
spaceIdstring (uuid)pathRequiredpathstringqueryWhat to delete, relative to the Space's root.
Responses
200OK
List a file's revisions
/api/external/v1/spaces/{spaceId}/revisionsThe revisions of the file at path, newest first: revisionNo, createdAt, authorKind (USER, AI, SYSTEM), authorUserId, reason, sizeBytes, sha256. Read one with GET .../file?revision=.
Errors: 404 SPACE_NOT_FOUND, PATH_NOT_FOUND; 400 MISSING_FIELD, OPERATION_REFUSED (not a file).
Parameters
spaceIdstring (uuid)pathRequiredpathstringqueryThe file, relative to the Space's root.
Responses
200OK
List a space's folders and files
/api/external/v1/spaces/{spaceId}/treeWhat is below path (relative to the Space; empty for its root), depth levels deep (1 to 5). Answers path, entries - each with path (relative), name, kind (file, dir, link, mount, view), and for files size, mediaType, revision, etag, updatedAt - and complete. When more entries remain, cursor is given: send it back to read the next page.
Errors: 404 SPACE_NOT_FOUND, PATH_NOT_FOUND; 400 OPERATION_REFUSED with the reason.
Parameters
spaceIdstring (uuid)pathRequiredpathstringqueryA folder relative to the Space's root; empty for the root.
depthinteger (int32)queryHow many levels to list, 1 to 5 (default 1).
limitinteger (int32)queryEntries per page, 1 to 100 (default 100).
cursorstringqueryThe `cursor` of the previous page.
Responses
200OK
Search spaces and wikis
/api/external/v1/spaces/searchRanked full-text search over the files and wiki pages of your Spaces (a wiki is searched through its hub Space, so spaceId may be a wiki's id). Name up to 50 Spaces with spaceId (repeat it, or separate the ids with commas); without one the 50 most recently changed Spaces are searched, and spacesLeftOut says how many were not.
Each result has spaceId, isWiki, path (relative to that Space or wiki), revision, score, snippet (the lines around the best hit), lineStart/lineEnd, and ref. The answer also carries count, complete (false when the time or size budget cut the search short, with truncatedReason) and spacesSearched. Ranked search finds words, not exact strings.
Errors: 400 MISSING_FIELD without query, INVALID_ID for an id that is not a UUID, SEARCH_FAILED for a query the search refuses; 404 SPACE_NOT_FOUND for a Space that is not yours.
Parameters
querystringqueryWords to find (at most 500 characters).
spaceIdarray of stringqueryOnly these Spaces or wikis (ids); repeat it or separate with commas.
limitinteger (int32)queryHow many results, 1 to 50 (default 20).
Responses
200OK
List wikis
/api/external/v1/wikisThe workspace's wikis: id (also its hub Space's id), name, slug, description, iconKey, isDefault, template, homePage (the page a reader starts at), aiChange (OPEN, PROPOSE or LOCKED: what an AI's edit does), sectionCount, updatedAt.
Responses
200OK
Read a wiki
/api/external/v1/wikis/{wikiId}One wiki (the fields of GET /wikis) with its sections - each id, kind (FOLDER, SPACE for another Space shown here, KNOWLEDGE for knowledge items, IMPORT for imported pages), title, path (the page path it starts at), audience (internal or customer), its owner and review interval - and its gardener settings.
Errors: 404 WIKI_NOT_FOUND.
Parameters
wikiIdstring (uuid)pathRequired
Responses
200OK
Read a wiki page
/api/external/v1/wikis/{wikiId}/pageThe page at path (relative to the wiki, e.g. Sales/Pricing.md), or an older revision of it. Answers path, name, title, content (markdown), revision, etag (send it back as expectedEtag when you change the page), mediaType, updatedAt, updatedByKind, updatedByName, section (the section it is in), meta (owner, verified, review date), links (the pages it links to, resolved) and backlinks (the pages that link to it).
Errors: 404 WIKI_NOT_FOUND, PAGE_NOT_FOUND; 400 MISSING_FIELD without path.
Parameters
wikiIdstring (uuid)pathRequiredpathstringqueryThe page, relative to the wiki's root.
revisioninteger (int32)queryAn older revision number; the newest when left out.
Responses
200OK
Change a wiki page
/api/external/v1/wikis/{wikiId}/pageReplaces the content of the page at path and answers the page as it now is (the shape of GET .../page). Each change is a new revision; the history keeps every one.
Fields: path (required), content (required, markdown), expectedEtag (the etag you read: the change is refused with 409 when someone changed the page since - send it), reason (kept in the history; when left out, the history says the change came through the API and names your credential).
Errors: 404 WIKI_NOT_FOUND, PAGE_NOT_FOUND (make a page with POST .../pages); 400 MISSING_FIELD, INVALID_REQUEST; 409 CONTENT_CHANGED.
403 AI_ORIGIN_WRITE when the request comes from one of the workspace's own AIs (an agent or an MCP client): they change Spaces with their own Space tools, under each Space's rule for AI changes. A builder of yours (a coding agent working one of your tasks, with your workspace open to it) writes as an AI under the Space's rule for AI changes: written, proposed for review, or refused.
Parameters
wikiIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
Delete a wiki page
/api/external/v1/wikis/{wikiId}/pageMoves the page (or folder) at path to the wiki's trash, kept for 30 days and restorable in the app. Answers 204. A section itself is removed in the wiki's settings in the app, not here.
Errors: 404 WIKI_NOT_FOUND, PAGE_NOT_FOUND; 400 MISSING_FIELD, INVALID_REQUEST (a section).
403 AI_ORIGIN_WRITE when the request comes from one of the workspace's own AIs (an agent or an MCP client): they change Spaces with their own Space tools, under each Space's rule for AI changes. A builder of yours (a coding agent working one of your tasks, with your workspace open to it) writes as an AI under the Space's rule for AI changes: written, proposed for review, or refused.
Parameters
wikiIdstring (uuid)pathRequiredpathstringqueryThe page, relative to the wiki's root.
Responses
200OK
List a wiki's pages
/api/external/v1/wikis/{wikiId}/pagesThe pages and folders below path (relative to the wiki; empty for its root), depth levels deep (1 to 5). Answers path, entries (each with path, name, title, kind, and for pages revision, etag, updatedAt) and complete.
Errors: 404 WIKI_NOT_FOUND, PAGE_NOT_FOUND (no such folder).
Parameters
wikiIdstring (uuid)pathRequiredpathstringqueryA folder or section of the wiki; empty for its root.
depthinteger (int32)queryHow many levels to list, 1 to 5 (default 1).
Responses
200OK
Create a wiki page
/api/external/v1/wikis/{wikiId}/pagesMakes a new page and answers it (201, the shape of GET .../page). A path without .md gets it.
Fields: path (required, relative to the wiki: Sales/Pricing puts it in the Sales section or folder), content (markdown; may be empty; [[Other page]] links to another page), reason (kept in the history; when left out, the history says the page came through the API and names your credential).
Errors: 404 WIKI_NOT_FOUND; 400 MISSING_FIELD, INVALID_REQUEST (a path the wiki refuses, such as a knowledge section); 409 PAGE_EXISTS when a page is already at that path (change it with PUT .../page).
403 AI_ORIGIN_WRITE when the request comes from one of the workspace's own AIs (an agent or an MCP client): they change Spaces with their own Space tools, under each Space's rule for AI changes. A builder of yours (a coding agent working one of your tasks, with your workspace open to it) writes as an AI under the Space's rule for AI changes: written, proposed for review, or refused.
Parameters
wikiIdstring (uuid)pathRequired
Request body application/json
object
Responses
200OK
List a wiki page's revisions
/api/external/v1/wikis/{wikiId}/revisionsThe revisions of the page at path, newest first: revision, at, byKind (USER, AI, SYSTEM), byName (the person, when a person wrote it), reason, size. Read one with GET .../page?revision=.
Errors: 404 WIKI_NOT_FOUND, PAGE_NOT_FOUND; 400 MISSING_FIELD.
Parameters
wikiIdstring (uuid)pathRequiredpathstringqueryThe page, relative to the wiki's root.
Responses
200OK