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

GET/api/external/v1/spaces

Every 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

GET/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

GET/api/external/v1/spaces/{spaceId}/file

The 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)pathRequired
  • pathstringquery

    The file, relative to the Space's root, e.g. `docs/pricing.md`.

  • revisioninteger (int32)query

    An older revision number; the newest when left out.

Responses

  • 200OK

Create or replace a file in a space

PUT/api/external/v1/spaces/{spaceId}/file

Writes 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

  • pathstring
  • contentstring
  • expectedEtagstring
  • mediaTypestring
  • reasonstring

Responses

  • 200OK

Delete a file or folder of a space

DELETE/api/external/v1/spaces/{spaceId}/file

Moves 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)pathRequired
  • pathstringquery

    What to delete, relative to the Space's root.

Responses

  • 200OK

List a file's revisions

GET/api/external/v1/spaces/{spaceId}/revisions

The 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)pathRequired
  • pathstringquery

    The file, relative to the Space's root.

Responses

  • 200OK

List a space's folders and files

GET/api/external/v1/spaces/{spaceId}/tree

What 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)pathRequired
  • pathstringquery

    A folder relative to the Space's root; empty for the root.

  • depthinteger (int32)query

    How many levels to list, 1 to 5 (default 1).

  • limitinteger (int32)query

    Entries per page, 1 to 100 (default 100).

  • cursorstringquery

    The `cursor` of the previous page.

Responses

  • 200OK

List wikis

GET/api/external/v1/wikis

The 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

GET/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

GET/api/external/v1/wikis/{wikiId}/page

The 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)pathRequired
  • pathstringquery

    The page, relative to the wiki's root.

  • revisioninteger (int32)query

    An older revision number; the newest when left out.

Responses

  • 200OK

Change a wiki page

PUT/api/external/v1/wikis/{wikiId}/page

Replaces 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

DELETE/api/external/v1/wikis/{wikiId}/page

Moves 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)pathRequired
  • pathstringquery

    The page, relative to the wiki's root.

Responses

  • 200OK

List a wiki's pages

GET/api/external/v1/wikis/{wikiId}/pages

The 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)pathRequired
  • pathstringquery

    A folder or section of the wiki; empty for its root.

  • depthinteger (int32)query

    How many levels to list, 1 to 5 (default 1).

Responses

  • 200OK

Create a wiki page

POST/api/external/v1/wikis/{wikiId}/pages

Makes 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

GET/api/external/v1/wikis/{wikiId}/revisions

The 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)pathRequired
  • pathstringquery

    The page, relative to the wiki's root.

Responses

  • 200OK