Skip to content
Create a mount

Create a mount

Create a folder that is mounted into the terminal of every user in the workspace, of one group's members, or of one user.

POST/api/v1/mounts

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/mounts", {
  method: "POST",
  headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({
  "path": "/workspace/docs",
  "scope": "group",
  "groupId": "team_42",
  "description": "Product documentation. Answers to customer questions go in faq.md.",
  "settings": {
    "create": "allow"
  }
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();

Use your server-side apiKey. Replace the example IDs.

Request body#

pathstringrequired

Where the mount appears, inside /workspace, such as /workspace/docs. A canonical absolute path without empty, . or .. segments or a trailing slash, at most 1024 bytes with each segment at most 255 bytes.

scopestringrequired

global for every user in the workspace, group for the members of one group, or user for one user.

groupIdstring

Your application's group ID. Required for a group mount, and only allowed for one. The group must already exist.

userIdstring

Your application's user ID. Required for a user mount, and only allowed for one. The user must already exist.

descriptionstring | null

Optional text for agents about what the mount holds, at most 2000 characters. Surrounding whitespace is removed, and an empty description is stored as null.

settingsobject

How agents' changes to the mount are handled: create, update, delete, move, and rename, each allow, ask, or deny. Reads are always allowed. Settings you leave out are ask.

Responses#

Returns id, path, scope (global, group, or user), groupId (your group ID, for a group mount), userId (your user ID, for a user mount), nullable description, settings with create, update, delete, move, and rename (each allow, ask, or deny), fileCount (files, not folders), totalBytes, and ISO 8601 createdAt and updatedAt timestamps. groupId and userId are null when they don't apply.

201 response
{
  "id": "0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d",
  "path": "/workspace/docs",
  "scope": "group",
  "groupId": "team_42",
  "userId": null,
  "description": "Product documentation. Answers to customer questions go in faq.md.",
  "settings": {
    "create": "allow",
    "update": "ask",
    "delete": "ask",
    "move": "ask",
    "rename": "ask"
  },
  "fileCount": 0,
  "totalBytes": 0,
  "createdAt": "2026-10-10T12:00:00.000Z",
  "updatedAt": "2026-10-10T12:00:00.000Z"
}
More about this endpoint

A mount is a folder Smallworld stores. Every command of a user who gets the mount sees it at its path, in every World. A new mount is empty: add files with PUT /mounts/:mountId/files/content.

Reads are always allowed. The settings govern agents' changes: allow saves them at the end of the command, ask holds the mount's changes for one approval at the end of the command, and deny makes the operation fail at once with Permission denied. A move to another folder is move; a new name in the same folder is rename.

A group mount belongs to exactly one group, and a user mount to exactly one user. Two groups that each need /workspace/docs get two mounts with separate files.

Two mounts with the same scope and target (two global mounts, two mounts of one group, or two mounts of one user) can't have the same path, or paths where one lies inside the other, such as /workspace/docs and /workspace/docs/team. Mounts of different scopes may overlap: for each user the broader one wins (global, then group, then user), and the other isn't mounted for that user while the overlap lasts. GET /users/:userId/mounts shows which one wins.

Deleting a group or a user also deletes their mounts with the files. Creating, editing, and deleting mounts is recorded in the workspace's audit log.